Add a Cloudflare address
const url = 'https://api.clearance.rest/emails/cloudflare/accounts';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"email":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.clearance.rest/emails/cloudflare/accounts \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "email": "example" }'Registers an address on one of the domains from /emails/cloudflare/domains for the project. No authorization is needed.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Address to add, on a domain returned by /emails/cloudflare/domains.
Examplegenerated
{ "email": "example"}Responses
Section titled “Responses”Default Response
object
A Gmail, Outlook or Cloudflare address connected to the project.
object
Provider of an email account.
CONNECTED: notifications are active. RENEWING: the subscription expired or is not set up yet and will be renewed automatically. REAUTH_REQUIRED: the last token refresh or sync failed; the owner may need to authorize again. Cloudflare addresses are always CONNECTED.
Whether the mailbox granted the permission needed for mark_as_read.
Free-form JSON object (at most 16 KB, 5 levels deep, keys up to 64 characters).
object
Increases on every metadata change; use it in If-Match.
UTC timestamp (ISO 8601).
UTC timestamp (ISO 8601).
Example
{ "success": true, "account": { "email_provider": "gmail", "status": "CONNECTED" }}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}