Skip to content

Revoke the token in use

DELETE /v1/token

Revokes the token making the request. It stops working at once: every later call with it answers 401 token_revoked. This can't be undone; make a new token in the panel if you need one again.

The webhook endpoints it added are turned off with it (they can be turned on again in the panel).

Use it when a token may have leaked, or when the script that used it is retired. Any valid token can revoke itself: it needs no scope.

Scopes

Any valid token can make this request.

Headers

FieldType and description
Idempotency-Key

string 1 to 255 characters

A key of your own for this request, like a UUID: letters, digits and _ - : . Send the request again with the same key (after a timeout, say) and it's done only once. Keys are kept for 24 hours (see Idempotency).

Example request

curl -X DELETE "https://api.rabbitflare.com/v1/token" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

204 No Content The answer has no body.

Example response

204 No Content

No content: the answer has no body.

Errors

The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).

Status and codeWhen, and what to do
400 invalid_parameter

A query parameter is unknown or has a wrong value (fields names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.

Correct or remove the parameter named in fields.

400 invalid_json

The body isn't valid JSON, or isn't a JSON object where one is expected.

Send a JSON object.

400 invalid_idempotency_key

The Idempotency-Key is empty, too long, or has characters other than A-Z a-z 0-9 _ - : .

Use a UUID.

401 missing_token

No API token was sent.

Send the header Authorization: Bearer <token>.

401 invalid_token

The token is malformed or unknown.

Check you copied the whole token. Make a new one in the panel if it's lost.

401 token_expired

The token passed its expiry date (expiredAt).

Make a new token in the panel: an expired token can't be regenerated.

401 token_revoked

The token was revoked, or replaced by a regenerated one whose grace time has passed.

Use the token's new value, or make a new token.

403 api_not_enabled

The API isn't open to this account.

Contact support.

403 api_access_suspended

Support paused this account's API access.

Contact support.

403 two_factor_required

Two-factor authentication became required for this account and is off.

Sign in to the panel and turn on two-factor authentication.

403 ip_not_allowed

The request came from an address that isn't on the token's list of allowed IP addresses.

Call from an allowed address, or change the token's list in the panel.

409 idempotency_in_progress

A request with this Idempotency-Key is still running.

Wait a moment (Retry-After), then send the same request again.

415 unsupported_media_type

The body isn't sent as application/json (or application/octet-stream for uploads).

Send Content-Type: application/json with a JSON body.

422 validation_failed

One or more fields are missing or wrong. fields names each one with what's wrong.

Correct the fields named in fields. Unknown fields are refused too.

422 idempotency_key_reused

The Idempotency-Key was already used in the last 24 hours with another operation or another body, or by another token of the account.

Use a new key for a new request.

429 rate_limited

Too many requests. scope says which limit: token, account, create, operation or network.

Wait for Retry-After seconds, then go on more slowly.

429 concurrency_limited

Too many requests of this token are in progress at once.

Wait for a request to finish before sending the next.

503 api_unavailable

The API is switched off for everyone for a while.

Try again later; Retry-After says when.

503 api_read_only

Only reads are served for a while (for example during maintenance).

Try the change again later; Retry-After says when.

Rate limit

Write requests: 30 a minute per token, 60 per account. More in Rate limits.

Added on .

Popular

API docs