Skip to main content
For how history and change approval work, see History and change approval.

Endpoints

History

GET /api/zones/{id}/versions
string
ui, cli, api, dns_update, ddns, acme, caddy, traefik, proxy or transfer.
integer
Change requests of this zone waiting for approval.
Page back with ?before=<version> (and limit, up to 500). GET …/versions/{version} adds what the version changed:
A change has no before when the record was added and no after when it was removed. Records carry every field of the record format. settings is {"before": {...}, "after": {...}} of enabled, default_ttl, forward_missing and dnssec when those changed. GET /api/zones/{id}/diff?from=10&to=14 answers the same changes and settings between two versions, with summary and the added, removed and changed counts. Leave out to to compare with the zone as it is now. A version that isn’t kept any more answers 400.

Roll back

POST /api/zones/{id}/rollback
integer
required
The zone becomes as it was right after this version.
The rollback is checked like any edit (400 or 409 with the reason) and waits for approval like one.

Edits that wait for approval

When an approval policy covers the caller, these writes are not applied:
  • POST /api/zones/{id}/records, PATCH and DELETE /api/records/{id}
  • POST /api/zones/{id}/records/bulk
  • PATCH /api/zones/{id}
  • POST /api/zones/{id}/import with apply
  • POST /api/zones/{id}/rollback
They answer 202 Accepted with a Location header:
Without a policy covering the caller, every endpoint answers as usual (200, 201 or 204), so a client only needs to handle 202 when approval is in use.

Follow a change request

GET /api/changes/{id} returns the change_request object, plus comments. API tokens may call it. Poll it until status is no longer pending: A Cloudflare copy into an existing zone, which can take several zones at once, answers 200 with "status": "pending" and change_request_id for each zone instead.

Decide

POST /api/changes/{id}/approve with an optional {"comment": "…"} applies the change as a whole, checked against the zone as it is now. On a conflict it answers 409 with the reason, applies nothing, and the request stays pending. POST /api/changes/{id}/reject needs {"comment": "why"}. Both need a signed-in person with changes.approve, other than who asked; API tokens get 400.

Policies

A zone’s mode is inherit (the division’s policy), on with its own roles and tokens, or off. GET on either path also lists the roles and the division’s tokens to pick from.