Naijacloud
Docs

Email

Every /v1 route for email. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.

Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.

A workspace's sending domains

GET /v1/workspaces/{workspaceId}/mail/domains

Key scopes: READ and EMAIL_SEND.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Query parameters

NameTypeRequiredNotes
limitintegernoRows per page. Ignored when a cursor is given.
cursorstringnoThe nextCursor of the previous page, unchanged.

Returns

  • 200 with a page: { data: V1MailDomain[], nextCursor }, where each item is V1MailDomain.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/mail/domains" \ -H "Authorization: Bearer $NC_API_KEY"

Add a sending domain

POST /v1/workspaces/{workspaceId}/mail/domains

Returns the DNS records to publish, then verify it.

Key scopes: WRITE and EMAIL_SEND.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Headers

NameTypeRequiredNotes
Idempotency-KeystringnoAny unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours.

Body

FieldTypeRequiredNotes
namestringyese.g. mail.acme.ng
regionstringnoe.g. eu-west

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/mail/domains" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"mail.acme.ng"}'

A workspace's mail keys (hints only, never the key)

GET /v1/workspaces/{workspaceId}/mail/keys

Key scopes: READ and EMAIL_SEND.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Query parameters

NameTypeRequiredNotes
limitintegernoRows per page. Ignored when a cursor is given.
cursorstringnoThe nextCursor of the previous page, unchanged.

Returns

  • 200 with a page: { data: V1MailApiKey[], nextCursor }, where each item is V1MailApiKey.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/mail/keys" \ -H "Authorization: Bearer $NC_API_KEY"

A sending domain with its DNS records

GET /v1/workspaces/{workspaceId}/mail/domains/{domainId}

Key scopes: READ and EMAIL_SEND.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.
domainIdstringyesThe domain's id.

Returns

bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/mail/domains/$DOMAIN_ID" \ -H "Authorization: Bearer $NC_API_KEY"

Remove a sending domain

DELETE /v1/workspaces/{workspaceId}/mail/domains/{domainId}

Key scopes: WRITE and EMAIL_SEND.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.
domainIdstringyesThe domain's id.

Returns

  • 204 with no body.
bash
curl -X DELETE "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/mail/domains/$DOMAIN_ID" \ -H "Authorization: Bearer $NC_API_KEY"

Check a sending domain's DNS records now

POST /v1/workspaces/{workspaceId}/mail/domains/{domainId}/verify

Key scopes: WRITE and EMAIL_SEND.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.
domainIdstringyesThe domain's id.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/mail/domains/$DOMAIN_ID/verify" \ -H "Authorization: Bearer $NC_API_KEY"

Types

V1MailApiKey

FieldTypeNotes
createdAtstring (date-time)
idstring
isLiveboolean
keyHintstringFirst characters of the key, to identify it in a list.
lastUsedAtstring (date-time), or null
namestring
revokedAtstring (date-time), or null
scopeFULL, SEND
updatedAtstring (date-time)

V1MailDnsRecord

FieldTypeNotes
fqdnstringThe full DNS name this record must exist at, e.g. nm._domainkey.send.acme.com.
hoststringHost relative to the sending domain; "@" is the sending domain itself.
namestring
prioritynumber, or null
problemstring, or null
requiredboolean
typestring
valuestring
verifiedboolean
zoneHoststring, or nullHost relative to the DNS zone the customer edits (MailDomainDetail.zone); "@" is the zone root.

V1MailDnsZone

FieldTypeNotes
dnsZoneIdstring, or nullThe Naijacloud DNS zone id, when hostedOnNaijacloud.
hostedOnNaijacloudbooleanTrue when this zone is on Naijacloud DNS in the same workspace, so publishMailDomainRecords can add the records in one step.
namestringThe zone the records are added to, e.g. acme.com for send.acme.com. zoneHost on each record is relative to it.

V1MailDomain

FieldTypeNotes
createdAtstring (date-time)
dailyQuotainteger
dkimPublicKeystring
failingRecordsarray of string, or null
idstring
lastCheckedAtstring (date-time), or null
namestring
regionstring
statusBROKEN, PENDING, SUSPENDED, VERIFIED
suspendedAtstring (date-time), or null
suspendedReasonstring, or null
updatedAtstring (date-time)
verifiedAtstring (date-time), or null

V1MailDomainDetail

FieldTypeNotes
alignmentWarningstring, or nullSet when the customer DMARC policy would break signing.
domainV1MailDomain
propagatingboolean, or nullSet when DNS is right but not yet propagated.
recordsarray of V1MailDnsRecord
zoneV1MailDnsZone, or nullThe DNS zone the records go into; each record carries zoneHost relative to it.