Hoppa till innehållet

Add a sending domain

POST/v1/domains

TypeScript account.domains.create({ domain })

Python account.domains.create(domain=...)

PHP $account->domains->create(domain: $domain)

Java account.domains().create(domain)

Key ak_… an account key

Creates the domain with its own DKIM key and answers the two DNS records to add: a CNAME for the return path and a TXT record for the DKIM key. The domain may send once both records are seen, which Sendora checks on its own and on request. Domains belong to the account: every server sends from them, and an account key manages them; a server key cannot.

Request body

{
  "domain": "example.se"
}
  • domainstringrequired

    The domain mail is sent from, such as example.se; 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 sending domain and the two records it needs.

Example

{
  "domainId": "0d7f6a1e-4c0b-4b7e-9d3c-2a1f5e8b9c01",
  "domain": "example.se",
  "verified": false,
  "createdAt": "2026-09-15T12:00:00.000Z",
  "lastCheckedAt": null,
  "failingSince": null,
  "returnPath": {
    "type": "CNAME",
    "host": "sendora-bounces.example.se",
    "value": "bounces.sendora.se",
    "verified": false,
    "verifiedAt": null
  },
  "dkim": {
    "type": "TXT",
    "host": "s1._domainkey.example.se",
    "value": "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...",
    "verified": false,
    "verifiedAt": null
  }
}
  • domainIdstring (uuid)
  • domainstring
  • verifiedboolean

    True while both records count as found; only then may mail go out. A lookup that fails at the resolver never changes it, and a record found missing on a verified domain starts a 24-hour warning (failingSince) through which the domain stays verified.

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

    When the records were last looked up.

  • failingSincestring (date-time) or null

    When a check first found a record of this verified domain missing or wrong. Mail keeps going out, the records are looked up hourly, and the first check 24 hours after this that still misses one ends the verification. Null unless the domain is verified and in that warning; verified and each record tell the rest.

  • returnPathobject

    The return-path record, which also satisfies SPF.

    • type"CNAME"
    • hoststring

      The name to create the record under.

    • valuestring

      The value the record must hold.

    • verifiedboolean
    • verifiedAtstring (date-time) or null
  • dkimobject

    The DKIM public key record.

    • type"TXT"
    • hoststring

      The name to create the record under.

    • valuestring

      The value the record must hold.

    • verifiedboolean
    • verifiedAtstring (date-time) or null

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.
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.
domain_exists409The account already has that domain.
  • 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

domain_exists

Example

{
  "error": "domain_exists",
  "message": "Your account already has that domain.",
  "domainId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
  • domainIdstring (uuid)required

    The id of the domain the account already has.