Naijacloud
Docs

Domains & DNS

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

Replace a record

PATCH /v1/dns-records/{recordId}

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
recordIdstringyesThe record's id.

Body

FieldTypeRequiredNotes
namestringyes"@" for the zone apex, or a label.
typestringyesA, AAAA, CNAME, MX, TXT, …
contentstringyes
ttlintegerno
priorityintegerno

Returns

bash
curl -X PATCH "https://api.naijacloud.com/v1/dns-records/$RECORD_ID" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"…","type":"…","content":"…"}'

Delete a record

DELETE /v1/dns-records/{recordId}

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
recordIdstringyesThe record's id.

Returns

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

Stop hosting a zone, with all its records

DELETE /v1/dns-zones/{zoneId}

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
zoneIdstringyesThe zone's id.

Returns

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

Turn auto-renew on or off, or change the nameservers

PATCH /v1/registered-domains/{domainId}

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
domainIdstringyesThe domain's id.

Body

FieldTypeRequiredNotes
autoRenewbooleanno
nameserverModeCUSTOM, NCnoUse our nameservers, or your own (then nameservers).
nameserversarray of stringno

Returns

bash
curl -X PATCH "https://api.naijacloud.com/v1/registered-domains/$DOMAIN_ID" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"autoRenew":true,"nameserverMode":"CUSTOM"}'

The zone as a BIND zone file

GET /v1/dns-zones/{zoneId}/export

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
zoneIdstringyesThe zone's id.

Returns

  • 200 with no body.
bash
curl "https://api.naijacloud.com/v1/dns-zones/$ZONE_ID/export" \ -H "Authorization: Bearer $NC_API_KEY"

A zone's records

GET /v1/dns-zones/{zoneId}/records

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
zoneIdstringyesThe zone'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: V1DnsRecord[], nextCursor }, where each item is V1DnsRecord.
bash
curl "https://api.naijacloud.com/v1/dns-zones/$ZONE_ID/records" \ -H "Authorization: Bearer $NC_API_KEY"

Add a record; published straight away

POST /v1/dns-zones/{zoneId}/records

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
zoneIdstringyesThe zone'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
namestringyes"@" for the zone apex, or a label.
typestringyesA, AAAA, CNAME, MX, TXT, …
contentstringyes
ttlintegerno
priorityintegerno

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/dns-zones/$ZONE_ID/records" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"…","type":"…","content":"…"}'

Check ownership now and publish when proven

POST /v1/dns-zones/{zoneId}/verify

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
zoneIdstringyesThe zone's id.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/dns-zones/$ZONE_ID/verify" \ -H "Authorization: Bearer $NC_API_KEY"

What renewing would cost, and the new expiry

GET /v1/registered-domains/{domainId}/renewal-quote

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
domainIdstringyesThe domain's id.

Query parameters

NameTypeRequiredNotes
yearsintegerno

Returns

bash
curl "https://api.naijacloud.com/v1/registered-domains/$DOMAIN_ID/renewal-quote" \ -H "Authorization: Bearer $NC_API_KEY"

POST /v1/registered-domains/{domainId}/renewals

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
domainIdstringyesThe domain'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
yearsnumberno

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/registered-domains/$DOMAIN_ID/renewals" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"years":1}'

A workspace's DNS zones

GET /v1/workspaces/{workspaceId}/dns-zones

Key scopes: READ and PLATFORM_API.

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: V1DnsZone[], nextCursor }, where each item is V1DnsZone.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/dns-zones" \ -H "Authorization: Bearer $NC_API_KEY"

Host a domain’s DNS with us

POST /v1/workspaces/{workspaceId}/dns-zones

The zone stays unpublished until ownership is proven: add verificationRecord, or point the nameservers at us, then verify.

Key scopes: WRITE and PLATFORM_API.

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. acme.ng

Returns

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

Whether exact names can be bought, and for how much

GET /v1/workspaces/{workspaceId}/domain-availability

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Query parameters

NameTypeRequiredNotes
domainsarray of stringyesUp to 20 full names, e.g. domains=acme.ng&domains=acme.com

Returns

  • 200 with a page: { data: V1DomainSearchRow[], nextCursor }, where each item is V1DomainSearchRow.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/domain-availability?domains=%E2%80%A6" \ -H "Authorization: Bearer $NC_API_KEY"

Domain purchases and renewals, newest first

GET /v1/workspaces/{workspaceId}/domain-orders

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Returns

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

Search for a domain to buy, with prices in kobo

GET /v1/workspaces/{workspaceId}/domain-search

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Query parameters

NameTypeRequiredNotes
querystringyes

Returns

bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/domain-search?query=acme" \ -H "Authorization: Bearer $NC_API_KEY"

Domains this workspace owns through us

GET /v1/workspaces/{workspaceId}/registered-domains

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Returns

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

Start buying a domain

POST /v1/workspaces/{workspaceId}/registered-domains

Returns a checkout link; the domain is registered once it is paid. The price is our catalogue price for the term.

Key scopes: WRITE and PLATFORM_API.

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
domainstringyese.g. acme.com.ng
yearsintegeryes
contactobjectyesThe registrant: the same contact fields as the dashboard checkout. The price is never taken from the request.

Returns

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

Types

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

V1DnsZone

FieldTypeNotes
createdAtstring (date-time)
idstring
lastErrorstring, or null
namestring
publishedboolean
publishedAtstring (date-time), or null
teamIdstring
updatedAtstring (date-time)
verificationMethodLEGACY, NS, PURCHASE, TXT, or nullHow ownership of the domain was proven; null while pending.
verificationRecordV1DnsZoneVerificationRecord, or nullThe TXT record that proves ownership while the zone is pending verification; null once ownership is proven.
verifiedAtstring (date-time), or nullWhen ownership of the domain was proven. Null while the zone is pending verification: it is not published and its name is not yet exclusively held.

V1DnsZoneVerificationRecord

FieldTypeNotes
hoststringRecord name relative to the domain, e.g. _naijacloud-verify
namestringFully-qualified record name, e.g. _naijacloud-verify.example.com
typestringAlways TXT.
valuestringThe exact value the TXT record must hold.

V1DomainCheckout

FieldTypeNotes
amountKobonumberWhat they will be charged, in kobo
checkoutUrlstringThe hosted payment page to send the customer to
referencestringOur reference for the order; echoed back on payment

V1DomainOrder

FieldTypeNotes
amountKobonumber
createdAtstring (date-time)
domainstring
failureReasonstring, or null
idstring
kindREGISTER, RENEW
referencestring
statusABANDONED, FULFILLED, PAID, PENDING, REFUNDED, REFUND_DUE
teamIdstring
updatedAtstring (date-time)
yearsnumber

V1DomainRenewalQuote

FieldTypeNotes
amountKobonumberWhat the customer pays, in kobo. Firm — the checkout is created for exactly this amount.
domainstring
expiresAtstring (date-time), or nullThe current expiry date, or null if we hold none
newExpiresAtstring (date-time)What the expiry becomes once paid. Extends the current date rather than restarting from today, so renewing early loses nothing.
yearsintegerYears this quote covers

V1DomainSearchResults

FieldTypeNotes
availablearray of V1DomainSearchRowWhat they asked for and can have, cheapest first
availableCountintegerHow many rows across all groups can be bought
querystringThe bare name searched, after stripping any URL
suggestionsarray of V1DomainSearchRowName variants they could have instead, cheapest first. Always available — a suggestion somebody else owns is not a suggestion.
unavailablearray of V1DomainSearchRowWhat they cannot have, each row carrying its own reason. Returned rather than dropped: somebody who typed a .ng needs to see why.

V1DomainSearchRow

FieldTypeNotes
availablebooleanWhether this domain can be bought here, right now
domainstring
premiumbooleanPremium names are priced individually by the registry and cost far more than the standard rate
priceKobonumber, or nullWhat the customer pays, in kobo, for years. Firm, not an estimate — the checkout is created for exactly this amount, so the row, the payment page and the receipt agree. Null when it cannot be sold or cannot be priced right now.
unavailableCodeCHECK_FAILED, PRICING_UNAVAILABLE, TAKEN, TLD_COMING_SOON, TLD_UNSUPPORTED, or nullThe same answer as a code. Branch on this, not on the sentence — the sentence is copy and will be reworded, and "somebody else has it" and "we cannot sell it yet" are opposite answers that look alike.
unavailableReasonstring, or nullWhy it cannot be bought, in words meant for the customer
yearsintegerYears the price covers — some registries only allow one

V1RegisteredDomain

FieldTypeNotes
autoRenewboolean
createdAtstring (date-time)
customNameserversarray of string, or null
domainstring
expiresAtstring (date-time), or null
idstring
lastErrorstring, or null
nameserverModeCUSTOM, NC
registeredAtstring (date-time), or null
registrantVerifiedAtstring (date-time), or null
statusACTIVE, DELETED, EXPIRING, FAILED, GRACE, PENDING_PAYMENT, REDEMPTION, REGISTERING
teamIdstring
tldstring
transferLockUntilstring (date-time), or null
updatedAtstring (date-time)