Skip to content

Custom Email Domains

To send emails with SendAPI, you must verify ownership of your sending domain. This ensures high deliverability and prevents spoofing.

List Domains

Retrieve all email domains associated with a specific project.

GET /v1/email/domains

Response

json
{
  "data": [
    {
      "id": 8,
      "domain": "updates.mycompany.com",
      "status": "verified",
      "dns_records": [
        {
          "type": "TXT",
          "name": "api._domainkey.updates.mycompany.com",
          "value": "k=rsa;t=s;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB...",
          "purpose": "DKIM — authenticates emails sent from this domain"
        },
        {
          "type": "TXT",
          "name": "updates.mycompany.com",
          "value": "v=spf1 include:spf.sendapi.co ~all",
          "purpose": "SPF — authorises the SendAPI sending pool"
        },
        {
          "type": "TXT",
          "name": "_dmarc.updates.mycompany.com",
          "value": "v=DMARC1; p=none; adkim=r; aspf=r",
          "purpose": "DMARC — builds sender reputation"
        },
        {
          "type": "MX",
          "name": "updates.mycompany.com",
          "value": "10 mail.updates.mycompany.com",
          "purpose": "MX — required by Gmail/Outlook to trust the domain"
        }
      ],
      "created_at": "2026-03-09T14:30:00.000000Z"
    }
  ]
}

Add a Domain

Register a new domain for sending emails. Adding a domain will generate the required DNS records (DKIM/SPF) that you must add to your DNS provider.

POST /v1/email/domains

Request Body

ParameterTypeRequiredDescription
domainstringYesThe fully qualified domain name (e.g., mg.example.com).

Response

The response includes the dns_records you must configure with your domain registrar.

json
{
  "success": true,
  "data": {
    "id": 9,
    "domain": "receipts.mycompany.com",
    "status": "pending",
    "dns_records": [
      {
        "type": "TXT",
        "name": "api._domainkey.receipts.mycompany.com",
        "value": "k=rsa;t=s;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB...",
        "purpose": "DKIM — authenticates emails sent from this domain"
      },
      {
        "type": "TXT",
        "name": "receipts.mycompany.com",
        "value": "v=spf1 include:spf.sendapi.co ~all",
        "purpose": "SPF — authorises the SendAPI sending pool"
      },
      {
        "type": "TXT",
        "name": "_dmarc.receipts.mycompany.com",
        "value": "v=DMARC1; p=none; adkim=r; aspf=r",
        "purpose": "DMARC — builds sender reputation"
      },
      {
        "type": "MX",
        "name": "receipts.mycompany.com",
        "value": "10 mail.receipts.mycompany.com",
        "purpose": "MX — required by Gmail/Outlook to trust the domain"
      }
    ]
  }
}

Verify a Domain

After adding the DNS records to your registrar (e.g., Cloudflare, Route53), call this endpoint to trigger verification. DNS propagation may take a few minutes.

POST /v1/email/domains/{id}/verify

If the DNS records are correctly detected, the domain's status will transition to verified and you can begin sending emails.


Delete a Domain

Remove a verified or pending domain from your project.

DELETE /v1/email/domains/{id}

Released under the MIT License.