Skip to main content

DNS API

Read and change the DNS records of your domains from scripts, CI jobs, infrastructure as code, and certificate clients that prove domain control with DNS-01. The DNS API uses the same API keys as the domain search API.

Records can be changed only on domains whose DNS CertPing serves. A domain that uses DNS hosted elsewhere can be listed but not edited.

Getting started​

  1. In the CertPing app, open Domains, then API keys, and select Create key.
  2. Under Permissions, tick DNS records: Read to read records, and Write to change them.
  3. Under Domains, choose the domains the key may use, or All domains, including ones added later. A key can hold up to 100 chosen domains.
  4. Optional: list the IP addresses or CIDR ranges your servers call from under Allowed IPs. Leave it empty for CI runners and hosted tools whose addresses change.
  5. Copy the key when it is shown: it starts with cpk_live_ and is shown only once.

You can later change a key's name, permissions, domains and allowed IPs with Edit, without changing its secret. The key's next request follows the new settings. If a key leaks, revoke it, or rotate it to get a new secret.

Permissions​

In the appPermissionAllows
DNS records: Readdns:readList and read records
DNS records: Writedns:editCreate, replace and delete records
Sent with any DNS accessdomains:readList the domains the key covers
Domain search and pricesdomains:searchThe domain search API

A key without the permission an endpoint needs is refused with 403 and the code PERMISSION_MISSING.

Authentication​

Send the key in the Authorization header of every request. Keep it on your servers and in your secrets store: anyone holding it can do everything its permissions allow on its domains.

Authorization header
Authorization: Bearer cpk_live_...

Every endpoint is under https://dns-api.certping.com/api/v1/domains/token-api.

Add, find and remove a TXT record
BASE=https://dns-api.certping.com/api/v1/domains/token-api
AUTH="Authorization: Bearer $CERTPING_API_KEY"

curl -X POST "$BASE/dns/zones/example.com/records" -H "$AUTH" \
-H "Content-Type: application/json" \
-d '{"recordType": "TXT", "host": "_acme-challenge", "value": "token-from-your-acme-client", "ttl": 60}'

curl "$BASE/dns/zones/example.com/records?type=TXT&name=_acme-challenge" -H "$AUTH"

curl -X DELETE "$BASE/dns/zones/example.com/records/1001" -H "$AUTH"

GET /dns/zones​

Needs domains:read. Lists the domains the key covers, ordered by name.

/dns/zones response
{
"items": [
{
"id": 42,
"name": "example.com",
"status": "ACTIVE",
"dnsProvider": "POWERDNS",
"expiresAt": "2027-03-01T00:00:00Z"
}
],
"nextCursor": null
}
  • dnsProvider is POWERDNS when CertPing serves the domain's DNS and EXTERNAL when it does not. Records can be changed only on POWERDNS domains.
  • expiresAt is null for a domain registered elsewhere.
  • In a path, {zone} is the domain name, with or without a trailing dot, in any case.
  • Your organization's domain outside the key is 403 with ZONE_NOT_COVERED. A domain that is not your organization's, or does not exist, is 404 with ZONE_NOT_FOUND. To keep a tool to fewer domains, give it a key with only those domains.

The record object​

Record
{
"id": 1001,
"recordType": "MX",
"host": "@",
"value": "mx1.example.net",
"ttl": 3600,
"servedTtl": 300,
"priority": 10,
"weight": null,
"port": null,
"caaFlag": null,
"caaTag": null,
"status": "ACTIVE",
"statusReason": null,
"systemManaged": false
}
  • host is relative to the domain: @ for the domain itself, www for www.example.com.
  • servedTtl is the TTL resolvers get for the record's set, the lowest TTL in the set. It is null for a record that was just deleted.
  • status is ACTIVE (on the nameservers), PENDING (saved, not yet on the nameservers) or FAILED (not published; statusReason says why).
  • systemManaged is true for a record CertPing manages: the domain's own NS records, and the MX record written by email forwarding or mailboxes. These cannot be changed through the API.
  • Fields a record type does not use are null, never missing. New fields may be added, so ignore fields you do not know.

GET /dns/zones/{zone}/records​

Needs dns:read. Lists the domain's records in id order.

ParameterDescription
typeOne record type, any case.
nameOne name: www, www.example.com or www.example.com.. The domain name itself for @.
sizeRecords per page, 1 to 100. Default 50.
cursorThe nextCursor of the previous page.

nextCursor is null on the last page. Records added or deleted between pages do not repeat or shift the others.

GET /dns/zones/{zone}/records/{recordId}​

Needs dns:read. One record, or 404 with RECORD_NOT_FOUND.

POST /dns/zones/{zone}/records​

Needs dns:edit. Creates a record.

Request body
{ "recordType": "TXT", "host": "_acme-challenge", "value": "token", "ttl": 60 }
FieldDescription
recordTypeUpper case. One of A, AAAA, CNAME, MX, TXT, SRV, NS, CAA, HTTPS, SVCB, TLSA, SSHFP, DS, PTR, NAPTR, URI, CERT, LOC, SMIMEA, OPENPGPKEY.
hostRequired. @, a name relative to the domain, a full name inside the domain, or a full name ending in a dot. A leading * label makes a wildcard. At most 253 characters.
valueRequired, at most 4,096 characters. A and AAAA take an address; CNAME, NS, MX and SRV a host name (. for MX and SRV means no service). Send a TXT value without quotes. CAA takes at most 255 characters, without quotes.
ttl60 to 86,400 seconds. Default 3,600.
priorityRequired for MX and SRV, 0 to 65,535.
weight, portRequired for SRV, 0 to 65,535.
caaFlagRequired for CAA, 0 to 255.
caaTagRequired for CAA: issue, issuewild, iodef, issuemail, issuevmc, contactemail or contactphone.

Fields a type does not use are dropped, and unknown fields are ignored. Each of these is refused with the code shown under Errors:

  • No CNAME, NS or DS at @. The domain's NS records are CertPing's, and its DS record comes from the DNSSEC setting.
  • A CNAME cannot share its name with any other record.
  • A DS needs NS records at the same name, and cannot be a wildcard.
  • An HTTPS or SVCB record in alias mode (priority 0) must be the only record of its type at its name.
  • A name has at most one SPF record (v=spf1) and one DMARC record (v=DMARC1), and each must be valid. An SPF record may need at most 10 DNS lookups, its includes counted.
  • The same type, name and value twice is a duplicate, RECORD_EXISTS. A DNS-01 client can treat it as done.
  • A domain holds at most 1,000 records.
  • While email forwarding or mailboxes receive the domain's mail, no other MX can be added at @.

PUT /dns/zones/{zone}/records/{recordId}​

Needs dns:edit. Replaces the record with the body, which has the same shape and rules as a create. The record keeps its id.

DELETE /dns/zones/{zone}/records/{recordId}​

Needs dns:edit. Deletes the record.

POST /dns/zones/{zone}/records/bulk-delete​

Needs dns:edit. Deletes 1 to 100 records of the domain in one change: all of them, or none.

Request body
{ "ids": [1001, 1002] }
Response
{ "deletedIds": [1001, 1002], "status": "ACTIVE" }

If any id is not a record of the domain, nothing is deleted: 422 with RECORD_NOT_FOUND, and refusedIds names them.

Write results​

A change is sent to the nameservers before it is answered.

EndpointOn the nameserversSaved, not yet on them
Create201 with the record202 with the record, status: PENDING
Replace200 with the record202 with the record, status: PENDING
Delete204, no body202 with the deleted record, status: PENDING
Bulk delete200, status: ACTIVE202, status: PENDING

A 202 change is saved and keeps being sent until it is published. Read the record, or the list for a delete, until it is ACTIVE before relying on it, for example before asking a certificate authority to check a DNS-01 record.

Records can be changed while a domain is PENDING, ACTIVE or DELEGATED. Any other status, such as expired or transferred out, is 409 with ZONE_NOT_WRITABLE. A domain whose DNS is served elsewhere is 422 with DNS_NOT_HOSTED.

Rate limits​

LimitValue
Per source address, before the key is checked60 a minute. A request whose key is valid does not count.
Per key300 a minute, bursts of 100
Per organization, all keys together1,200 a minute, bursts of 300

Answers carry RateLimit-Limit and RateLimit-Remaining for the key. A refused request is 429 with Retry-After, the seconds to wait. Domain availability checks have their own limit, described in the domain search API.

Errors​

Every error has one shape:

Error
{
"status": 409,
"error": "Conflict",
"code": "RECORD_EXISTS",
"message": "A TXT record at _acme-challenge.example.com with this value already exists.",
"path": "/api/v1/domains/token-api/dns/zones/example.com/records",
"timestamp": "2026-11-30T09:16:30.0889Z",
"requestId": "req-http-...",
"correlationId": "corr-http-..."
}

message is written for people and may change, so act on status and code. A refused field adds fieldErrors, such as [{"field": "value", "message": "..."}]. Quote requestId when you contact support.

CodeStatusMeaning
INVALID_RECORD400A field breaks its rule; fieldErrors names it. Also a bulk delete ids list outside 1 to 100.
INVALID_REQUEST400The body is not one JSON object of the endpoint's shape, or recordId, size, cursor, type or name is invalid.
PERMISSION_MISSING403The key lacks the permission the endpoint needs; the message names it.
ZONE_NOT_COVERED403Your organization's domain, but not one the key covers.
ZONE_NOT_FOUND404No domain of your organization by that name.
RECORD_NOT_FOUND404, or 422 on bulk deleteNo record of the domain with that id.
ZONE_NOT_WRITABLE409The domain's status allows no changes.
DNS_NOT_HOSTED422CertPing does not serve this domain's DNS.
RECORD_LIMIT422The domain already has 1,000 records.
RECORD_EXISTS409The same record is already there.
CNAME_CONFLICT409A CNAME would share its name with another record.
DS_WITHOUT_NS409A DS would stand where there are no NS records.
ALIAS_NOT_ALONE409An alias-mode HTTPS or SVCB record would share its set.
SPF_EXISTS409The name already has an SPF record; change it instead.
DMARC_EXISTS409The name already has a DMARC record; change it instead.
MX_OWNED_BY_FORWARDING409Email forwarding holds the domain's MX. Turn it off in the app to release it.
MX_OWNED_BY_MAILBOXES409Mailboxes hold the domain's MX. Turn them off in the app to release it.
SYSTEM_MANAGED409The record is managed by CertPing, such as the domain's NS records.
RECORD_CHANGED409The record changed while the request ran. Read it again and retry.
DNS_REFUSED422The nameservers refused the change, and it was undone.

These errors have the same shape without a code:

StatusMeaning
401The key is missing, unknown, revoked or expired.
403The key is used from an address outside its allowed IPs.
429A rate limit. Wait the seconds in Retry-After.
500Something failed on our side. Try again in a moment.
503The key check is briefly unavailable. Try again shortly.