Create a new domain
const url = 'https://smtp-app.kirim.email/api/domains';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"domain":"example.com","dkim_key_length":1024}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://smtp-app.kirim.email/api/domains \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "domain": "example.com", "dkim_key_length": 1024 }'Add a new domain to the authenticated user’s account
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Domain configuration details for creating a new domain
object
Domain name
Example
example.comDKIM key length
Example
2048object
Domain name
Example
example.comDKIM key length
Example
2048Responses
Section titled “Responses”Domain created successfully
object
Indicates if the request was successful
Human-readable success message
Created domain information
object
The domain name that was successfully created
Example
{ "success": true, "message": "Domain added successfully.", "data": { "domain": "example.com" }}Unauthorized
object
Error type indicating authentication failure
Human-readable error message explaining the authentication issue
Example
{ "error": "Unauthorized", "message": "Authorization header is required"}Conflict - Domain already exists
object
Field-specific validation errors
object
Example
{ "success": false, "message": "This domain is already registered in our system. Please use a different domain.", "errors": { "domain": [ "This domain is already registered in our system. Please use a different domain." ] }}Validation Error
object
Indicates the request failed due to validation errors
Human-readable error message
Field-specific validation error messages organized by field name
object
Example
{ "success": false, "message": "Validation failed."}Too Many Requests - Rate limit exceeded. Retry after the specified time.
object
Example
{ "success": false, "message": "Too many attempts. Please try again later."}Headers
Section titled “Headers”Seconds until rate limit resets
Maximum requests per minute
Remaining requests in current window
Server Error
object
Indicates the request failed due to a server error
Human-readable error message describing the server error
Example
{ "success": false, "message": "An error occurred while processing the request."}