Domains

Register and verify custom sending domains for Sendook.

Domains let you send email from your own brand while Sendook manages DNS records like SPF, DKIM, and DMARC. Use these endpoints to automate onboarding flows and domain health checks.

Create a domain

  • Method: POST
  • Path: /v1/domains
  • Auth: Required

Request body

{
  "name": "agents.example.com"
}
FieldTypeRequiredDescription
namestringYesFully qualified domain (no protocol).

Response 201 Created

{
  "id": "dom_01J3ZG3A4E6R5ZXC9HKN3S4TBQ",
  "name": "agents.example.com",
  "status": "pending_verification",
  "createdAt": "2024-10-10T18:45:13Z"
  // ...additional DNS guidance fields may be present
}

After creation, surface the DKIM/SPF instructions from the additional properties returned by the API.

List domains

  • Method: GET
  • Path: /v1/domains
  • Auth: Required

Response 200 OK

[
  {
    "id": "dom_01J3ZG3A4E6R5ZXC9HKN3S4TBQ",
    "name": "agents.example.com",
    "verified": false,
    "records": [
      {
        "type": "MX",
        "name": "@",
        "value": "inbound-smtp.us-east-2.amazonaws.com",
        "status": "pending"
      },
      {
        "type": "TXT",
        "name": "@",
        "value": "v=spf1 include:amazonses.com ~all",
        "status": "pending"
      }
    ],
    "createdAt": "2024-10-10T18:45:13Z",
    "updatedAt": "2024-10-10T18:45:13Z"
  }
]

Retrieve domain details

  • Method: GET
  • Path: /v1/domains/{domainId}
  • Auth: Required

Path parameters

ParameterTypeDescription
domainIdstringThe unique identifier of the domain (for example dom_...).

Response 200 OK

{
  "id": "dom_01J3ZG3A4E6R5ZXC9HKN3S4TBQ",
  "name": "agents.example.com",
  "verified": true,
  "records": [
    {
      "type": "MX",
      "name": "@",
      "value": "inbound-smtp.us-east-2.amazonaws.com",
      "status": "verified"
    },
    {
      "type": "TXT",
      "name": "@",
      "value": "v=spf1 include:amazonses.com ~all",
      "status": "verified"
    }
  ],
  "createdAt": "2024-10-10T18:45:13Z",
  "updatedAt": "2024-10-10T18:45:13Z"
}

Monitor the verified field to determine when sending is allowed. The records array contains DNS records that need to be configured for domain verification.

Get DNS records

  • Method: GET
  • Path: /v1/domains/{domainId}/dns
  • Auth: Required

Returns the DNS records that need to be configured for domain verification, including MX, SPF, DMARC, and DKIM records.

Path parameters

ParameterTypeDescription
domainIdstringThe unique identifier of the domain.

Response 200 OK

[
  {
    "type": "MX",
    "name": "@",
    "value": "inbound-smtp.us-east-2.amazonaws.com"
  },
  {
    "type": "TXT",
    "name": "@",
    "value": "v=spf1 include:amazonses.com ~all"
  },
  {
    "type": "TXT",
    "name": "_dmarc",
    "value": "v=DMARC1; p=reject;"
  },
  {
    "type": "CNAME",
    "name": "abc123._domainkey.agents.example.com",
    "value": "abc123.dkim.amazonses.com"
  }
]

Delete a domain

  • Method: DELETE
  • Path: /v1/domains/{domainId}
  • Auth: Required

Deleting a domain removes all associated DNS expectations and prevents further sending.

Response 200 OK

{
  "id": "dom_01J3ZG3A4E6R5ZXC9HKN3S4TBQ",
  "name": "agents.example.com",
  "verified": false,
  "records": [],
  "createdAt": "2024-10-10T18:45:13Z",
  "updatedAt": "2024-10-10T18:45:13Z"
}

Trigger domain verification

  • Method: POST
  • Path: /v1/domains/{domainId}/verify
  • Auth: Required

This endpoint re-runs the verification checks after DNS changes propagate.

Response 200 OK

{
  "id": "dom_01J3ZG3A4E6R5ZXC9HKN3S4TBQ",
  "name": "agents.example.com",
  "verified": true,
  "records": [
    {
      "type": "MX",
      "name": "@",
      "value": "inbound-smtp.us-east-2.amazonaws.com",
      "status": "verified"
    }
  ],
  "createdAt": "2024-10-10T18:45:13Z",
  "updatedAt": "2024-10-10T18:45:13Z"
}

The response returns the updated domain with verification status. Poll GET /v1/domains/{domainId} to observe status changes.