Sign inGet Started

Update a sending domain

PATCH
/v1/email/domains/{domain_id}
await bird.domains.update("dom_01krdgeqcxet5s7t44vh8rt9mg", {
  settings: { click_tracking: true, open_tracking: true },
  tracking: { name: "links" },
});
响应200
{
  "id": "dom_01krdgeqcxet5s7t44vh8rt9mg",
  "workspace_id": "ws_01krdgeqcxet5s7t44vh8rt9mg",
  "domain": "mail.acme.com",
  "vendor": "other",
  "status": "pending",
  "next": [
    {
      "kind": "operation"
    }
  ],
  "dkim": {
    "mode": "txt",
    "selector": "bird1",
    "key_size": 2048
  },
  "capabilities": {
    "sending": {
      "status": "verified",
      "pending": {
        "domain": "rp.mail.acme.com",
        "status": "pending"
      }
    },
    "return_path": {
      "status": "verified",
      "pending": {
        "domain": "rp.mail.acme.com",
        "status": "pending"
      }
    },
    "dmarc": {
      "status": "verified",
      "pending": {
        "domain": "rp.mail.acme.com",
        "status": "pending"
      }
    },
    "tracking": {
      "status": "verified",
      "pending": {
        "domain": "rp.mail.acme.com",
        "status": "pending"
      }
    },
    "inbound": {
      "status": "verified",
      "pending": {
        "domain": "rp.mail.acme.com",
        "status": "pending"
      }
    }
  },
  "dns_records": [
    {
      "type": "TXT",
      "purpose": "dkim",
      "state": "active",
      "status": "pending"
    }
  ]
}

Updates settings and configuration on a sending domain. settings changes apply immediately. Changes to return_path, tracking, or dkim on a verified capability are staged: the current configuration keeps serving until the new one's DNS records verify, then the change is promoted automatically. Staged values are visible under capabilities.*.pending. The records to publish appear in dns_records with state: pending.

Invalid combinations are rejected. Enabling tracking toggles without a tracking domain, or removing the tracking domain while a toggle is on, returns 409. Enabling inbound receiving has verification prerequisites that return 422. Each rule is detailed on its field.

参数

domain_idstring

ID of the domain to update.

请求载荷

settings
object

Per-domain behavior toggles. Changes apply immediately to new sends.

显示子参数
settings.click_tracking
boolean

Rewrite links in HTML email through your tracking domain to record clicks. You can enable this before your tracking domain has verified; it begins working once verification completes. A tracking domain must be configured; enabling it without one returns 409.

settings.open_tracking
boolean

Insert a tracking pixel in HTML email to record opens. You can enable this before your tracking domain has verified: it begins working once verification completes. A tracking domain must be configured; enabling it without one returns 409.

return_path
object

Change the return-path name part. Cannot be removed: the return-path is required for sending.

显示子参数
tracking
nullable object

Set or change the tracking name part, or remove tracking by passing null. Removal requires click_tracking and open_tracking to be disabled first, and returns 409 otherwise. After removal, links in previously sent email keep resolving while the tracking records are reported as deprecated.

显示子参数
dkim
object

Change how the DKIM key is published. The current key keeps signing until the new configuration verifies, so mail is never sent unsigned during the transition.

显示子参数
inbound
object

Enable or disable receiving on this domain. Enabling claims the domain for inbound and moves capabilities.inbound.status from not_configured to pending, then verified once the MX records resolve to us. The MX records to publish are always present under dns_records (purpose: inbound_mx) as a regional reference. Their presence does not mean receiving is enabled; enable the domain whenever capabilities.inbound.status is not_configured. Enabling requires the domain's DKIM to be verified first. A fresh enable on a domain whose DKIM is not verified returns 422 with E05019 and claims nothing. A domain already receiving inbound for another organization returns 422 with E05018.

显示子参数

响应载荷

id
string
必填
workspace_id
string
必填
domain
string
必填

The sending domain name. Set at creation and immutable.

vendor
string
必填

The DNS provider hosting this domain's nameservers, so you know which provider's dashboard to manage the required DNS records in. Returns other when the provider has not been detected or is not recognized.

Possible values: other, cloudflare, route53, godaddy, namecheap, google, azure, digitalocean, squarespace

status
string
必填

Domain ownership verification, proven by the DKIM record. Readiness to send or track is reported separately per capability under capabilities.*.status.

  • pending: the DKIM record has not been published yet.
  • verified: the DKIM record is in place; ownership is confirmed.
  • failed: a DKIM record exists but does not match the expected value (for example a stale record from an earlier setup), or a previously verified record was removed. Correct the record to recover.
  • temporary_failure: DNS resolution failed transiently, such as from a timeout or unreachable nameserver. Verification retries automatically; do not change the DNS records unless they are incorrect.
  • rejected: the domain was refused for policy reasons and cannot be used for sending. Contact support if you believe this is an error.

Possible values: pending, verified, failed, temporary_failure, rejected

settings
object
必填

Per-domain behavior toggles. Changes apply immediately to new sends.

显示子属性
next
array of object

What to do next about this domain, given the state it is in. Each entry names one action and says why it is worth taking, so you can act on this response without working out the order yourself. Present on reads that compute it: an empty list means there is nothing to do, and the field is absent entirely on responses that do not report next actions.

This answers whether you own the domain, which is what status reports. What each capability still needs before it can send or receive is reported separately under capabilities, so an empty list here does not on its own mean the domain is ready.

显示子属性
dkim
object
必填

Active DKIM signing configuration for the domain.

显示子属性
capabilities
object
必填
显示子属性
dns_records
array of object
必填

The domain's DNS records and their individual verification state, returned in full on both the list and single-domain responses. This is the complete set to publish across DKIM, return-path, DMARC, tracking, and inbound; records for a staged change carry state: pending. Inbound MX records are always included as a regional reference, even while receiving is off and capabilities.inbound.status is not_configured. Their presence alone does not mean receiving is enabled; see DomainUpdate.inbound.

显示子属性
last_checked_at
nullable string

When we last checked this domain's DNS records, whether or not the outcome changed. Updated on every verification: your manual refresh and the periodic automatic re-checks alike. null if the domain has never been checked.

verified_at
nullable string

When the domain's ownership was confirmed: the moment status became verified via the DKIM record. Unchanged by later re-checks while it stays verified. null if the domain has never been verified.

created_at
string
必填

When the domain was added.

updated_at
string
必填

When the domain's configuration was last changed (such as a settings or return-path change). Verification re-checks do not change this; see last_checked_at and verified_at for verification timing.