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

Update domain

Update configuration settings for a domain.

patch
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
tracking_opt_out_enabledbooleanOptional

When enabled, recipients can opt out of open and click tracking via a link in tracked emails. Requires open or click tracking to be enabled.

auto_unsubscribe_link_enabledbooleanOptional
custom_domain_tracking_enabledbooleanOptional
health_alerts_enabledbooleanOptional
critical_alerts_enabledbooleanOptional
alert_recipient_emailstring · nullableOptional
inbound_enabledbooleanOptional

Whether inbound email is enabled for this domain. When enabled, an MX record (key: inbound_mx) is added to dns_records for inbound mail; see inbound_verified.

inbound_verifiedbooleanOptional

Whether the domain's inbound MX records have been verified. Inbound mail is only accepted once this is true.

patch/api/domains/{domain_id}
curl -X PATCH https://mailtrap.io/api/domains/{domain_id} \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "domain": {
      "open_tracking_enabled": true,
      "click_tracking_enabled": true,
      "tracking_opt_out_enabled": true,
      "auto_unsubscribe_link_enabled": false,
      "inbound_enabled": true
    }
  }'
{
  "id": 435,
  "domain_name": "mailtrap.io",
  "demo": false,
  "compliance_status": "compliant",
  "dns_verified": true,
  "dns_verified_at": "2024-12-26T09:40:44.161Z",
  "dns_records": [
    {
      "key": "verification",
      "domain": "ve6wza2rbpe60x7z.mailtrap.io",
      "type": "CNAME",
      "value": "smtp.mailtrap.live",
      "status": "pass",
      "name": "ve6wza2rbpe60x7z"
    },
    {
      "key": "dkim1",
      "domain": "rwmt1._domainkey.mailtrap.io",
      "type": "CNAME",
      "value": "rwmt1.dkim.smtp.mailtrap.live",
      "status": "pass",
      "name": "rwmt1._domainkey"
    },
    {
      "key": "dkim2",
      "domain": "rwmt2._domainkey.mailtrap.io",
      "type": "CNAME",
      "value": "rwmt2.dkim.smtp.mailtrap.live",
      "status": "pass",
      "name": "rwmt2._domainkey"
    },
    {
      "key": "dmarc",
      "domain": "_dmarc.mailtrap.io",
      "type": "TXT",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@smtp.mailtrap.live; ruf=mailto:dmarc@smtp.mailtrap.live; rf=afrf; pct=100",
      "status": "pass",
      "name": "_dmarc"
    },
    {
      "key": "link_verification",
      "domain": "mt-link.mailtrap.io",
      "type": "CNAME",
      "value": "t.mailtrap.live",
      "status": "pass",
      "name": "mt-link"
    },
    {
      "key": "inbound_mx",
      "domain": "mailtrap.io",
      "type": "MX",
      "value": "inbound-mailtrap.io",
      "status": "pass",
      "name": "@"
    }
  ],
  "open_tracking_enabled": true,
  "click_tracking_enabled": true,
  "tracking_opt_out_enabled": false,
  "auto_unsubscribe_link_enabled": true,
  "custom_domain_tracking_enabled": true,
  "health_alerts_enabled": true,
  "critical_alerts_enabled": true,
  "alert_recipient_email": "john.doe@mailtrap.io",
  "inbound_enabled": true,
  "inbound_verified": true,
  "permissions": {
    "can_read": true,
    "can_update": true,
    "can_destroy": true
  }
}

Last updated

Was this helpful?