Skip to content

Create a new domain

POST
/api/domains

Add a new domain to the authenticated user’s account

Domain configuration details for creating a new domain

object
domain
required

Domain name

string
Example
example.com
dkim_key_length
required

DKIM key length

integer
Allowed values: 1024 2048
Example
2048

Domain created successfully

object
success

Indicates if the request was successful

boolean
Example
true
message

Human-readable success message

string
Example
Domain added successfully.
data

Created domain information

object
domain

The domain name that was successfully created

string
Example
example.com

Unauthorized

object
error

Error type indicating authentication failure

string
Example
Unauthorized
message

Human-readable error message explaining the authentication issue

string
Example
Authorization header is required

Validation Error

object
success

Indicates the request failed due to validation errors

boolean
message

Human-readable error message

string
Example
Validation failed.
errors

Field-specific validation error messages organized by field name

object

Too Many Requests - Rate limit exceeded. Retry after the specified time.

object
success
boolean
message
string
Example
Too many attempts. Please try again later.
Retry-After
integer

Seconds until rate limit resets

X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Remaining requests in current window

Server Error

object
success

Indicates the request failed due to a server error

boolean
message

Human-readable error message describing the server error

string
Example
An error occurred while processing the request.