Naijacloud
Docs

Custom domains

Every /v1 route for custom domains. 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.

Detach a custom domain

DELETE /v1/custom-domains/{domainId}

A redeploy drops the route, so the domain stops serving.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
domainIdstringyesThe domain's id.

Returns

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

Re-check a custom domain's DNS now

POST /v1/custom-domains/{domainId}/verify

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
domainIdstringyesThe domain's id.

Returns

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

List a service's custom domains, oldest first

GET /v1/services/{serviceId}/custom-domains

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service'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: V1CustomDomain[], nextCursor }, where each item is V1CustomDomain.
bash
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/custom-domains" \ -H "Authorization: Bearer $NC_API_KEY"

Attach a custom domain to a web service

POST /v1/services/{serviceId}/custom-domains

Create the records in dnsTarget at your DNS provider, then verify. The route and certificate apply on a redeploy that starts automatically.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service'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
domainstringyese.g. www.example.com

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/services/$SERVICE_ID/custom-domains" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"domain":"www.example.com"}'

Types

V1CustomDomain

FieldTypeNotes
idstring (uuid)
serviceIdstring (uuid)
domainstringe.g. www.example.com
statusPENDING, ACTIVE
lastCheckstring, or nullWhat the last DNS check found.
dnsTargetV1DnsTarget
verifiedAtstring (date-time), or null
createdAtstring (date-time)

V1DnsRecord

FieldTypeNotes
contentstring
createdAtstring (date-time)
editableboolean
idstring
namestring
originMAIL, SERVICE, USER
priorityinteger, or null
ttlinteger
typeA, AAAA, ALIAS, CAA, CNAME, MX, NS, SRV, TXT
updatedAtstring (date-time)
zoneIdstring

V1DnsTarget

FieldTypeNotes
cnamestringCNAME target for a subdomain.
aRecordstring, or nullA-record address, when an apex domain cannot use a CNAME.
isApexboolean
recordsarray of V1DnsRecordRecords to create.
conflictsarray of V1DnsRecordExisting records that block verification; remove them.