For the complete documentation index, see llms.txt. This page is also available as Markdown.

Domains

Manage verified domains

Configure and verify domains for email sending to ensure deliverability.

List domains

get

Get all domains and their verification status

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Responses
200

List of domains

application/json
get/api/domains

Create domain

post

Create a domain for email authentication. After creation, verify the domain by adding DNS records.

Process:

  1. Create the domain

  2. Add DNS records (SPF, DKIM, DMARC)

  3. Verify the records

  4. Start sending emails

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Body
Responses
200

Domain details

application/json
idintegerOptional
domain_namestringOptional
demobooleanOptional
compliance_statusstring · enumOptional

Indicates the compliance verification status of the domain. The domain must reach compliant status before you can send emails in production.

  • demo - A demo domain provided by Mailtrap. Can only send emails to the account owner.
  • demo_exhausted - A demo domain that has used up its sending allowance. Cannot send emails.
  • unverified_dns - Domain DNS records have not been verified yet. Open your domain on the Domains page and follow the Sending Domain Setup guide.
  • missing_company_info - Account is missing required company information. Go to Company Information and fill in the required details.
  • under_review - Domain is undergoing automatic compliance review. No action needed — typically completes within 2 minutes.
  • awaiting_questionnaire - Automatic review required additional information. Open your domain on the Domains page and fill in the compliance questionnaire.
  • awaiting_card_verification - Compliance questionnaire was submitted but credit card identity verification is still needed. Open your domain on the Domains page and enter card details. The charged amount is refunded immediately and the card is not stored.
  • non_compliant - Domain did not pass compliance checks. Sending is not allowed. Contact Mailtrap Support for details and next steps.
  • compliant - Domain has passed all compliance checks and is ready to send emails.
  • suspended - Domain sending has been suspended. Contact Mailtrap Support to resolve the issue.
Possible values:
dns_verifiedbooleanOptional
dns_verified_atstring · nullableOptionalExample: 2024-12-26T09:40:44.161Z
open_tracking_enabledbooleanOptional
click_tracking_enabledbooleanOptional
auto_unsubscribe_link_enabledbooleanOptional
custom_domain_tracking_enabledbooleanOptional
health_alerts_enabledbooleanOptional
critical_alerts_enabledbooleanOptional
alert_recipient_emailstring · nullableOptional
post/api/domains

Get domain

get

Get details and verification status of a specific domain

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
domain_idintegerRequired

Domain ID

Example: 1
Responses
200

Domain details

application/json
idintegerOptional
domain_namestringOptional
demobooleanOptional
compliance_statusstring · enumOptional

Indicates the compliance verification status of the domain. The domain must reach compliant status before you can send emails in production.

  • demo - A demo domain provided by Mailtrap. Can only send emails to the account owner.
  • demo_exhausted - A demo domain that has used up its sending allowance. Cannot send emails.
  • unverified_dns - Domain DNS records have not been verified yet. Open your domain on the Domains page and follow the Sending Domain Setup guide.
  • missing_company_info - Account is missing required company information. Go to Company Information and fill in the required details.
  • under_review - Domain is undergoing automatic compliance review. No action needed — typically completes within 2 minutes.
  • awaiting_questionnaire - Automatic review required additional information. Open your domain on the Domains page and fill in the compliance questionnaire.
  • awaiting_card_verification - Compliance questionnaire was submitted but credit card identity verification is still needed. Open your domain on the Domains page and enter card details. The charged amount is refunded immediately and the card is not stored.
  • non_compliant - Domain did not pass compliance checks. Sending is not allowed. Contact Mailtrap Support for details and next steps.
  • compliant - Domain has passed all compliance checks and is ready to send emails.
  • suspended - Domain sending has been suspended. Contact Mailtrap Support to resolve the issue.
Possible values:
dns_verifiedbooleanOptional
dns_verified_atstring · nullableOptionalExample: 2024-12-26T09:40:44.161Z
open_tracking_enabledbooleanOptional
click_tracking_enabledbooleanOptional
auto_unsubscribe_link_enabledbooleanOptional
custom_domain_tracking_enabledbooleanOptional
health_alerts_enabledbooleanOptional
critical_alerts_enabledbooleanOptional
alert_recipient_emailstring · nullableOptional
get/api/domains/{domain_id}

Delete domain

delete

Remove a domain from your account

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
domain_idintegerRequired

Domain ID

Example: 1
Responses
204

Domain successfully deleted

No content

delete/api/domains/{domain_id}

No content

Update domain

patch

Update configuration settings for a domain.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
domain_idintegerRequired

Domain ID

Example: 1
Body
Responses
200

Domain details

application/json
idintegerOptional
domain_namestringOptional
demobooleanOptional
compliance_statusstring · enumOptional

Indicates the compliance verification status of the domain. The domain must reach compliant status before you can send emails in production.

  • demo - A demo domain provided by Mailtrap. Can only send emails to the account owner.
  • demo_exhausted - A demo domain that has used up its sending allowance. Cannot send emails.
  • unverified_dns - Domain DNS records have not been verified yet. Open your domain on the Domains page and follow the Sending Domain Setup guide.
  • missing_company_info - Account is missing required company information. Go to Company Information and fill in the required details.
  • under_review - Domain is undergoing automatic compliance review. No action needed — typically completes within 2 minutes.
  • awaiting_questionnaire - Automatic review required additional information. Open your domain on the Domains page and fill in the compliance questionnaire.
  • awaiting_card_verification - Compliance questionnaire was submitted but credit card identity verification is still needed. Open your domain on the Domains page and enter card details. The charged amount is refunded immediately and the card is not stored.
  • non_compliant - Domain did not pass compliance checks. Sending is not allowed. Contact Mailtrap Support for details and next steps.
  • compliant - Domain has passed all compliance checks and is ready to send emails.
  • suspended - Domain sending has been suspended. Contact Mailtrap Support to resolve the issue.
Possible values:
dns_verifiedbooleanOptional
dns_verified_atstring · nullableOptionalExample: 2024-12-26T09:40:44.161Z
open_tracking_enabledbooleanOptional
click_tracking_enabledbooleanOptional
auto_unsubscribe_link_enabledbooleanOptional
custom_domain_tracking_enabledbooleanOptional
health_alerts_enabledbooleanOptional
critical_alerts_enabledbooleanOptional
alert_recipient_emailstring · nullableOptional
patch/api/domains/{domain_id}
cURL

Send setup instructions

post

Email DNS configuration instructions for the domain

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
domain_idintegerRequired

Domain ID

Example: 1
Body
emailstring · emailRequired

Email address to receive setup instructions

Responses
204

Instructions sent successfully

No content

post/api/domains/{domain_id}/send_setup_instructions

No content

Get company info

get

Get company information associated with a domain / account.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
domain_idintegerRequired

Domain ID

Example: 1
Responses
200

Company information

application/json
get/api/domains/{domain_id}/company_info
cURL

Create company info

post

Create company information for a domain / account. Company info is required for domain compliance verification.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
domain_idintegerRequired

Domain ID

Example: 1
Body
Responses
200

Company information

application/json
post/api/domains/{domain_id}/company_info
cURL

Update company info

patch

Update company information for a domain / account. All fields are optional; only the fields provided in the request will be updated.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
domain_idintegerRequired

Domain ID

Example: 1
Body
Responses
200

Company information

application/json
patch/api/domains/{domain_id}/company_info
cURL

Last updated

Was this helpful?