Hoppa till innehållet

Tracking domains

Add a tracking domain

POST/v1/tracking-domains

TypeScript account.trackingDomains.create({ host })

Python account.tracking_domains.create(host=...)

PHP $account->trackingDomains->create(host: $host)

Java account.trackingDomains().create(host)

Key ak_… an account key

Claims a host under one of the account’s verified sending domains and answers the CNAME record to add. A host whose records are not right within 7 days goes. An account key manages tracking domains; a server key cannot.

Request body

{
  "host": "links.example.se"
}
  • hoststringrequired

    The host tracked links and the open pixel use, such as links.example.se: a subdomain of a verified sending domain of the account. Lower-cased and IDNA-encoded.

Responses

Every field of a response is always present. A field that can be null says so in its type.

201A tracking domain, the record it needs and what the last check found.

Example

{
  "trackingDomainId": "3f2b8c1e-6a7d-4e9f-8b10-5c4d3e2f1a09",
  "host": "links.example.se",
  "sendingDomainId": "0d7f6a1e-4c0b-4b7e-9d3c-2a1f5e8b9c01",
  "state": "pending",
  "createdAt": "2026-11-05T12:00:00.000Z",
  "lastCheckedAt": null,
  "certificateReadyAt": null,
  "failingSince": null,
  "expiresAt": "2026-11-12T12:00:00.000Z",
  "cname": {
    "type": "CNAME",
    "host": "links.example.se",
    "value": "track.sendora.se",
    "check": null
  },
  "caa": {
    "check": null,
    "record": null
  }
}
  • trackingDomainIdstring (uuid)
  • hoststring

    The host, lower-cased and IDNA-encoded.

  • sendingDomainIdstring (uuid) or null

    The sending domain whose new mail will use the host; null once that domain is deleted.

  • state"pending" | "waiting_for_certificate" | "ready" | "failing" | "stopped" | "sending_domain_lost"

    pending: the records have not been right yet, and the host goes at expiresAt. waiting_for_certificate: the records are right. ready: new mail from the sending domain uses the host. failing: a check found the records wrong, and new mail keeps using a host that was ready until 24 hours after failingSince. stopped: those 24 hours have passed. sending_domain_lost: the sending domain is deleted or has lost its verification, so new mail does not use the host.

  • createdAtstring (date-time)
  • lastCheckedAtstring (date-time) or null

    When the records were last looked up.

  • certificateReadyAtstring (date-time) or null

    When the certificate was proved to work; null before that.

  • failingSincestring (date-time) or null

    When a check first found the records wrong on a host whose records have been right. Null unless it is in that warning or past it.

  • expiresAtstring (date-time) or null

    When a host whose records have never been right goes; null once they have been.

  • cnameobject

    The CNAME record to add.

    • type"CNAME"
    • hoststring

      The name to create the record under.

    • valuestring

      The value the record must hold.

    • check"ok" | "missing" | "mismatch" | "proxied" | "dns_error" or null

      What the last check found; null before the first. mismatch is a record that points elsewhere, an A record included. proxied is a proxy in front of the name, such as Cloudflare’s, which must be switched off. dns_error is a resolver failure, not an absent record, and changes nothing.

  • caaobject

    Whether CAA records let Let’s Encrypt issue the certificate.

    • check"ok" | "no_lets_encrypt" | "other_account" | "no_http_01" | "dns_error" or null

      What the last check of the CAA records on the host and its parents found; null before the first. dns_error is a resolver failure and changes nothing.

    • recordobject or null

      What lets the certificate be issued; null unless the check found a problem.

      • type"CAA"
      • hoststring

        The name that holds the CAA records in the way.

      • valuestring

        The record to add beside them.

Errors

Every error answers error, the code, and message, a sentence for a person. A code that adds fields is shown in full below the table.

CodeStatusMeaning
invalid_request400The body, the query or a header does not match what the route takes.
domain_reserved400The name is Sendora’s own, or holds a domain’s return path.
unauthorized401The key is missing, malformed or revoked.
wrong_token_kind403The key is of the other kind: a server key (sk_) where an account key (ak_) is needed, or the reverse. The message names the kind the operation takes.
not_for_connections403A connected app called an operation that no tool of the MCP server calls. An API key can.
read_only_connection403A connected app may only read here: the account is read only through a connection, and a live server takes changes only if the person allowed them when connecting.
test_server_only403A connected app may create a secret, or do what cannot be undone, on a test server only.
tracking_domain_exists409The account already has that host, or a host on that sending domain.
tracking_host_taken409Another account holds the host, and its sending domain is still verified.
tracking_domain_limit409The account has as many tracking domains as it may have.
tracking_host_is_sending_domain422The host is a sending domain itself. A tracking domain is a subdomain of one.
tracking_host_not_verified422The host is not under a verified sending domain of this account.
  • WWW-Authenticateheader on 401"Bearer"

    Always Bearer: send the key as Authorization: Bearer <key>.

invalid_request

Example

{
  "error": "invalid_request",
  "message": "The request is invalid: to.0: Invalid email address",
  "issues": [
    {
      "path": "to.0",
      "message": "Invalid email address"
    }
  ]
}
  • issuesarray of object

    One entry per invalid field; absent when a header is wrong.

    • pathstringrequired

      The field, dotted, such as to.0.email; empty when the whole body is wrong.

    • messagestringrequired

tracking_domain_exists

Example

{
  "error": "tracking_domain_exists",
  "message": "The account already has that host, or a host on that sending domain.",
  "trackingDomainId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
  • trackingDomainIdstring (uuid)required

    The id of the tracking domain the account already has.