MailLandDocs
RéférenceRéférence de l’API

Domains

Add sending domains, read their DNS records and verify them.

GET/v1/domains/{domainId}/dmarc/summary

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

domainId*string

The domain's public id.

Query Parameters

days?|

1 to the plan's retention (30 / 90 / 180); default 30, or the retention when shorter.

Match^-?(?:0|[1-9]\d*)$
Formatint32

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string/dmarc/summary"
{  "domainId": "string",  "domain": "string",  "days": 0,  "retentionDays": 0,  "from": "2019-08-24T14:15:22Z",  "to": "2019-08-24T14:15:22Z",  "reports": 0,  "messages": 0,  "dmarcPass": 0,  "spfAligned": 0,  "dkimAligned": 0,  "dmarcPassRate": null,  "dispositions": {    "none": 0,    "quarantine": 0,    "reject": 0,    "other": 0  },  "latestReportReceivedAt": null}
GET/v1/domains/{domainId}/dmarc/sources

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

domainId*string

The domain's public id.

Query Parameters

days?|

As for the summary.

Match^-?(?:0|[1-9]\d*)$
Formatint32
limit?|

1 to 500, default 100.

Match^-?(?:0|[1-9]\d*)$
Formatint32

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string/dmarc/sources"
{  "domainId": "string",  "domain": "string",  "days": 0,  "retentionDays": 0,  "from": "2019-08-24T14:15:22Z",  "to": "2019-08-24T14:15:22Z",  "sources": [    {      "ip": "string",      "messages": 0,      "dmarcPass": 0,      "spfAligned": 0,      "dkimAligned": 0,      "dispositions": {        "none": 0,        "quarantine": 0,        "reject": 0,        "other": 0      },      "reports": 0,      "lastSeen": "2019-08-24T14:15:22Z"    }  ],  "truncated": true}

Get all domains for the authenticated user

GET/v1/domains

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Query Parameters

limit?|
Match^-?(?:0|[1-9]\d*)$
Formatint32
Default50
cursor?string

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains"
{  "items": [    {      "id": "string",      "domain": "string",      "verificationStatus": "pending",      "spfStatus": "pending",      "dkimStatus": "pending",      "dmarcStatus": "pending",      "verifiedAt": null,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "spfVerifiedAt": null,      "dkimVerifiedAt": null,      "dmarcVerifiedAt": null,      "trackingSubdomain": "string",      "trackingVerified": true,      "trackingVerifiedAt": null,      "useCustomTracking": true,      "marketingOpenTrackingEnabled": null,      "transactionalOpenTrackingEnabled": null,      "bounceSubdomain": "string",      "bounceVerified": true,      "bounceVerifiedAt": null,      "useCustomBounce": true,      "inboundEnabled": true,      "inboundSubdomain": null,      "mxVerified": true,      "mxVerifiedAt": null,      "lastDnsCheckAt": null,      "isFullyVerified": true,      "healthStatus": "unknown",      "lastHealthCheckAt": null,      "lastHealthyAt": null,      "lastStatusChangedAt": null,      "dnsFailureCount": 0,      "healthIssues": [        {          "code": "string",          "message": "string",          "severity": "string",          "record": null,          "details": null        }      ]    }  ],  "nextCursor": null,  "hasMore": true}

Add a new sending domain

POST/v1/domains

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Request Body

application/json

Cancellation token

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/domains"
{  "id": "string",  "domain": "string",  "verificationStatus": "pending",  "spfStatus": "pending",  "dkimStatus": "pending",  "dmarcStatus": "pending",  "verifiedAt": null,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "spfVerifiedAt": null,  "dkimVerifiedAt": null,  "dmarcVerifiedAt": null,  "trackingSubdomain": "string",  "trackingVerified": true,  "trackingVerifiedAt": null,  "useCustomTracking": true,  "marketingOpenTrackingEnabled": null,  "transactionalOpenTrackingEnabled": null,  "bounceSubdomain": "string",  "bounceVerified": true,  "bounceVerifiedAt": null,  "useCustomBounce": true,  "inboundEnabled": true,  "inboundSubdomain": null,  "mxVerified": true,  "mxVerifiedAt": null,  "lastDnsCheckAt": null,  "isFullyVerified": true,  "healthStatus": "unknown",  "lastHealthCheckAt": null,  "lastHealthyAt": null,  "lastStatusChangedAt": null,  "dnsFailureCount": 0,  "healthIssues": [    {      "code": "string",      "message": "string",      "severity": "string",      "record": null,      "details": null    }  ]}

Get a specific domain by ID

GET/v1/domains/{id}

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string"
{  "id": "string",  "domain": "string",  "verificationStatus": "pending",  "spfStatus": "pending",  "dkimStatus": "pending",  "dmarcStatus": "pending",  "verifiedAt": null,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "spfVerifiedAt": null,  "dkimVerifiedAt": null,  "dmarcVerifiedAt": null,  "trackingSubdomain": "string",  "trackingVerified": true,  "trackingVerifiedAt": null,  "useCustomTracking": true,  "marketingOpenTrackingEnabled": null,  "transactionalOpenTrackingEnabled": null,  "bounceSubdomain": "string",  "bounceVerified": true,  "bounceVerifiedAt": null,  "useCustomBounce": true,  "inboundEnabled": true,  "inboundSubdomain": null,  "mxVerified": true,  "mxVerifiedAt": null,  "lastDnsCheckAt": null,  "isFullyVerified": true,  "healthStatus": "unknown",  "lastHealthCheckAt": null,  "lastHealthyAt": null,  "lastStatusChangedAt": null,  "dnsFailureCount": 0,  "healthIssues": [    {      "code": "string",      "message": "string",      "severity": "string",      "record": null,      "details": null    }  ]}

Delete a domain

DELETE/v1/domains/{id}

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID to delete

Response Body

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/domains/string"
Empty
POST/v1/domains/{id}/verify

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID to verify

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/domains/string/verify"
{  "domainId": "string",  "domain": "string",  "isVerified": true,  "spfStatus": "pending",  "dkimStatus": "pending",  "dmarcStatus": "pending",  "verifiedAt": null,  "message": "string",  "dnsRecords": {    "spfRecord": "string",    "dkimSelector": "string",    "dkimRecord": "string",    "dmarcRecord": "string"  },  "spfErrorMessage": null,  "dkimErrorMessage": null,  "dmarcErrorMessage": null,  "trackingVerified": true,  "trackingVerifiedAt": null,  "trackingErrorMessage": null,  "bounceVerified": true,  "bounceVerifiedAt": null,  "bounceErrorMessage": null,  "mxVerified": true,  "mxVerifiedAt": null,  "mxErrorMessage": null,  "lastDnsCheckAt": null}
GET/v1/domains/{id}/dns-records

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string/dns-records"
{  "domain": "string",  "spfRecord": {    "recordType": "string",    "hostName": "string",    "value": "string",    "status": "pending",    "instructions": "string"  },  "dkimRecord": null,  "noActiveDkimKey": true,  "dmarcRecord": {    "recordType": "string",    "hostName": "string",    "value": "string",    "status": "pending",    "instructions": "string"  },  "trackingRecord": null,  "bounceRecords": null,  "notes": [    "string"  ]}

Get DNS setup instructions for a domain

GET/v1/domains/{id}/dns-instructions

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string/dns-instructions"
{  "domain": "string",  "spfRecord": {    "recordType": "string",    "hostName": "string",    "value": "string",    "status": "pending",    "instructions": "string"  },  "dkimRecord": null,  "noActiveDkimKey": true,  "dmarcRecord": {    "recordType": "string",    "hostName": "string",    "value": "string",    "status": "pending",    "instructions": "string"  },  "trackingRecord": null,  "bounceRecords": null,  "notes": [    "string"  ]}
GET/v1/domains/{id}/deletion-impact

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string/deletion-impact"
{  "trackingHosts": [    "string"  ],  "clicksAndOpensWorkUntil": null,  "unsubscribeWorksUntilAccountErasure": true,  "certificateRenewsWhileCnamePointsHere": true,  "hostsReservedUntilAccountErasure": true}
PATCH/v1/domains/{id}/settings

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Request Body

application/json

Cancellation token

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/domains/string/settings"
{  "id": "string",  "domain": "string",  "verificationStatus": "pending",  "spfStatus": "pending",  "dkimStatus": "pending",  "dmarcStatus": "pending",  "verifiedAt": null,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "spfVerifiedAt": null,  "dkimVerifiedAt": null,  "dmarcVerifiedAt": null,  "trackingSubdomain": "string",  "trackingVerified": true,  "trackingVerifiedAt": null,  "useCustomTracking": true,  "marketingOpenTrackingEnabled": null,  "transactionalOpenTrackingEnabled": null,  "bounceSubdomain": "string",  "bounceVerified": true,  "bounceVerifiedAt": null,  "useCustomBounce": true,  "inboundEnabled": true,  "inboundSubdomain": null,  "mxVerified": true,  "mxVerifiedAt": null,  "lastDnsCheckAt": null,  "isFullyVerified": true,  "healthStatus": "unknown",  "lastHealthCheckAt": null,  "lastHealthyAt": null,  "lastStatusChangedAt": null,  "dnsFailureCount": 0,  "healthIssues": [    {      "code": "string",      "message": "string",      "severity": "string",      "record": null,      "details": null    }  ]}
POST/v1/domains/{id}/dkim/generate

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/domains/string/dkim/generate"
{  "key": {    "id": "string",    "domainId": "string",    "domain": "string",    "selector": "string",    "publicKey": "string",    "keyType": "rsa",    "isActive": true,    "createdAt": "2019-08-24T14:15:22Z",    "rotatedAt": null,    "dnsRecordValue": "string",    "dnsRecordHost": "string"  },  "dnsInstructions": {    "recordType": "string",    "hostName": "string",    "value": "string",    "instructions": "string"  },  "message": "string"}

Get all DKIM keys for a domain

GET/v1/domains/{id}/dkim

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string/dkim"
[  {    "id": "string",    "domainId": "string",    "domain": "string",    "selector": "string",    "publicKey": "string",    "keyType": "rsa",    "isActive": true,    "createdAt": "2019-08-24T14:15:22Z",    "rotatedAt": null,    "dnsRecordValue": "string",    "dnsRecordHost": "string"  }]
POST/v1/domains/{id}/dkim/{keyId}/rotate

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID (PublicId)

keyId*string

DKIM key ID (PublicId) to rotate

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/domains/string/dkim/string/rotate"
{  "key": {    "id": "string",    "domainId": "string",    "domain": "string",    "selector": "string",    "publicKey": "string",    "keyType": "rsa",    "isActive": true,    "createdAt": "2019-08-24T14:15:22Z",    "rotatedAt": null,    "dnsRecordValue": "string",    "dnsRecordHost": "string"  },  "dnsInstructions": {    "recordType": "string",    "hostName": "string",    "value": "string",    "instructions": "string"  },  "message": "string"}
DELETE/v1/domains/{id}/dkim/{keyId}

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID (PublicId)

keyId*string

DKIM key ID (PublicId) to deactivate

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/domains/string/dkim/string"
Empty

Force DNS health check for a domain

POST/v1/domains/{id}/health-check

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/domains/string/health-check"
{  "domainName": "string",  "status": "unknown",  "previousStatus": "unknown",  "issues": [    {      "code": "string",      "message": "string",      "severity": "string",      "record": null,      "details": null    }  ],  "statusChanged": true,  "checkedAt": "2019-08-24T14:15:22Z",  "observationId": {    "value": "a860a344-d7b2-406e-828e-8d442f23f344"  },  "spf": null,  "dkim": null,  "dmarc": null,  "mx": null}

Get DNS health history for a domain

GET/v1/domains/{id}/health-history

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Domain ID

Query Parameters

from?string

Start date (defaults to 30 days ago)

Formatdate-time
to?string

End date (defaults to now)

Formatdate-time

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/domains/string/health-history"
[  {    "domainName": "string",    "prevStatus": "string",    "newStatus": "string",    "issues": [      "string"    ],    "reason": "string",    "checkedAt": "2019-08-24T14:15:22Z"  }]