API Documentation

Integrate Subilex domain and email services into your applications.

REST API JSON Bearer Auth v1.0
Authentication All API requests require a Bearer token in the Authorization header. Get your token by logging in via POST /api/users/login.

Domain Endpoints

GET /api/domains/search?domain=example.com Search domain availability

Check if a domain is available for registration and get pricing.

ParamTypeDescription
domainstringDomain name to check (required)
tokenstringAuth token (optional, shows ownership)

Response

{
  "domain": "example.com",
  "available": true,
  "pricing": { "registration": 11.28, "renewal": 11.28 }
}
POST /api/domains/register Register a domain

Register a new domain name. Requires authentication.

Request Body

{
  "domain": "example.com",
  "years": 1,
  "nameservers": ["ns1.subilex.com", "ns2.subilex.com"]
}
GET /api/domains/pricing Get domain pricing

Returns pricing for all supported TLDs.

GET /api/domains/list List user domains

Returns all domains owned by the authenticated user.

Email Endpoints

POST /api/email/mailbox Create mailbox

Create a new email mailbox for a domain.

Request Body

{
  "mailbox": "support",
  "domain": "example.com",
  "password": "securepass123"
}
GET /api/email/mailboxes List mailboxes

Returns all mailboxes for the authenticated user.

DELETE /api/email/mailbox/:id Delete mailbox

Remove an email mailbox.

Payment Endpoints

POST /api/payments/pay Process payment

Process a payment for domains, email, or wallet top-up.

Request Body

{
  "amount": 11.28,
  "method": "stripe",
  "description": "Domain registration: example.com"
}
GET /api/payments/history Payment history

Returns payment history for the authenticated user.

User Endpoints

POST /api/users/register Register account

Request Body

{
  "name": "John Doe",
  "email": "john@example.com",
  "password": "securepass123"
}
POST /api/users/login Login

Request Body

{
  "email": "john@example.com",
  "password": "securepass123"
}

Response

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "user": { "id": "...", "name": "John Doe", "email": "john@example.com" }
}
GET /api/users/profile Get profile

Returns the authenticated user's profile including domains, mailboxes, and balance.