Registrar Sandbox
Use the Registrar Sandbox API to test domain search, availability checks, registration, and domain management flows without buying real domains.
This API is a test environment for the production Registrar API.
Prerequisites
Before using this API, make sure you have:
- Cloudflare account — the caller must have a valid Cloudflare account.
- API authentication — create an API token with Registrar Sandbox permissions.
How the Sandbox API differs from the production Registrar API
Because the Sandbox API is intended for testing, it behaves differently from the production Registrar API in a few important ways:
- No billing — you will not be charged real money for purchasing a domain.
- No real domains — purchased domains are test records and will not be reachable on the Internet.
- No DNS zones — purchasing a domain does not create a zone resource.
- No Registration Express Mode — you must provide full contact data.
Sandbox purchases are still persisted. If you purchase a domain in the sandbox, that domain will not be available for others to purchase in the sandbox.
Terminology: domain extension
Throughout this API, “extension” refers to the domain extension part of a fully
qualified domain name — the portion after the registrable label. For example,
in example.co.uk, the extension is co.uk (not just uk). This covers both
top-level domains like com and multi-level extensions like co.uk. This is
distinct from other uses of the word “extension” (e.g., EPP extensions).
Supported extensions
The Sandbox API currently supports programmatic registration for these extensions:
com, net
The production Registrar API supports 40+ extensions.
Cloudflare Registrar supports 400+ extensions in the dashboard. Extensions
not listed above can be registered at https://dash.cloudflare.com/{account_id}/domains/registrations.
Typical workflow
- Search — call
GET /domain-search?q={keyword}to discover available domains. - Check — call
POST /domain-checkwith candidate domains to verify real-time availability and pricing. - Review the response — if
registrable: false, inspectreasonto understand whether the domain is unavailable, the extension is not supported by this API, the extension is not supported by Cloudflare Registrar at all, or the extension’s registry has frozen new registrations. - Handle premium domains — if
tier: premium, premium registration is not currently supported by this API. The Sandbox API currently supports onlycomandnet, which do not have premium registrations, but clients should still handle this response for consistency with the production Registrar API. Surface the premium pricing to the user, but do not proceed toPOST /registrationsfor that domain. - Register — call
POST /registrationswith the chosen domain name for supported non-premium registrations. - Confirm completion — if the response is
201 Created, registration completed within the default timeout and no polling is needed. - Poll when needed — if the response is
202 Accepted, polllinks.selffrom the workflow response. - Stop for user action — if
state: action_required, stop polling and surfacecontext.actionto the user. The workflow will not resolve on its own. - Continue when blocked — if
state: blocked, continue polling and inform the user that a third party, such as the extension registry or losing registrar, is delaying progress. - Review failures before retrying — if
state: failed, reviewerror.codeanderror.message, then decide whether user action or a new Check call is needed.
Default behavior for mutating operations
By default, mutating operations such as create and update hold the connection for a bounded, server-defined amount of time while the operation completes. In most cases, the response contains a completed workflow status and no polling is required.
- Completed within the synchronous wait window: Returns
201(create) or200(update) with aworkflow_statuswherestate: succeededandcompleted: true. - Still processing after the synchronous wait window: Returns
202 Acceptedwith aworkflow_statuswherecompleted: false. Use thelinks.selfURL to poll for completion.
Non-blocking mode
To receive an immediate 202 Accepted response without waiting, send the
Prefer: respond-async request header (RFC 7240). The server will acknowledge
it with a Preference-Applied: respond-async response header.
Polling
When the response is 202, poll the workflow status endpoint indicated by
links.self in the response body until the workflow reaches a terminal
state or requires user action.