Documentation

Learn how to integrate and use DDMARC

REST API

Domains API

Programmatically manage domains in your DDMARC account. Add new domains, verify ownership, configure settings, and retrieve DNS records.

Endpoints

MethodEndpointDescription
GET/api/v1/domainsList all domains
POST/api/v1/domainsAdd a new domain
GET/api/v1/domains/:idGet domain details
PUT/api/v1/domains/:idUpdate domain settings
DELETE/api/v1/domains/:idRemove a domain
GET/api/v1/domains/:id/dnsGet DNS records to configure
POST/api/v1/domains/:id/verifyVerify domain ownership
GET

List All Domains

Retrieve a list of all domains in your organization.

GET /api/v1/domains
curl -X GET "https://api.ddmarc.com/v1/domains" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response200 OK
{
  "data": [
    {
      "id": "dom_abc123",
      "domain": "example.com",
      "status": "verified",
      "dmarc_policy": "reject",
      "pass_rate": 98.5,
      "created_at": "2024-01-15T10:30:00Z",
      "verified_at": "2024-01-15T11:00:00Z"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "per_page": 20
  }
}
POST

Add New Domain

Add a new domain to your organization for DMARC monitoring.

POST /api/v1/domains
curl -X POST "https://api.ddmarc.com/v1/domains" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com"
  }'

Request Body

FieldTypeRequiredDescription
domainstringRequiredThe domain name to add
Response201 Created
{
  "data": {
    "id": "dom_xyz789",
    "domain": "example.com",
    "status": "pending",
    "verification_token": "ddmarc-verify-abc123",
    "created_at": "2024-01-20T15:00:00Z"
  }
}
GET

Get Domain Details

Retrieve detailed information about a specific domain.

GET /api/v1/domains/:id
curl -X GET "https://api.ddmarc.com/v1/domains/dom_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"
POST

Verify Domain Ownership

Trigger domain verification. The domain must have the DMARC record configured.

POST /api/v1/domains/:id/verify
curl -X POST "https://api.ddmarc.com/v1/domains/dom_abc123/verify" \
  -H "Authorization: Bearer YOUR_API_KEY"
Success Response200 OK
{
  "data": {
    "id": "dom_abc123",
    "domain": "example.com",
    "status": "verified",
    "verified_at": "2024-01-20T15:30:00Z"
  },
  "message": "Domain verified successfully"
}
GET

Get DNS Records

Retrieve the DNS records that should be configured for a domain.

GET /api/v1/domains/:id/dns
curl -X GET "https://api.ddmarc.com/v1/domains/dom_abc123/dns" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response200 OK
{
  "data": {
    "dmarc": {
      "host": "_dmarc",
      "type": "TXT",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@rua.ddmarc.com"
    },
    "mta_sts": {
      "host": "_mta-sts",
      "type": "TXT",
      "value": "v=STSv1; id=20240120"
    },
    "verification": {
      "host": "_ddmarc-verify",
      "type": "TXT",
      "value": "ddmarc-verify-abc123"
    }
  }
}
DELETE

Delete Domain

Remove a domain from your organization. This will delete all associated reports.

DELETE /api/v1/domains/:id
curl -X DELETE "https://api.ddmarc.com/v1/domains/dom_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Warning: This action is irreversible. All reports and data for this domain will be permanently deleted.

Domain Object

FieldTypeDescription
idstringUnique domain identifier
domainstringThe domain name
statusstringpending, verified, or failed
dmarc_policystringCurrent DMARC policy (none, quarantine, reject)
pass_ratenumberAuthentication pass rate (0-100)
created_atstringISO 8601 creation timestamp
verified_atstringISO 8601 verification timestamp

Continue to