Get the token in use
/v1/token Answers the token making the request: its name, scopes, the servers and IP addresses it is limited to, when it expires, when it was last used, and its rate limits. Any valid token can call it: it needs no scope.
The token's secret is never shown: only its first 8 and last 4 characters, to recognise it.
Scopes
Any valid token can make this request.
Example request
curl "https://api.rabbitflare.com/v1/token" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/token", {
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
const data = await rf.token.get();
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/token');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
print_r(json_decode($body, true)['data']); import os
import requests
response = requests.get(
"https://api.rabbitflare.com/v1/token",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the ApiToken object in data.
The ApiToken object's fields 17 fields
| Field | Type and description |
|---|---|
id | string The token's id. |
name | string The name the token was given in the panel. |
tokenStart | string The token's first 8 characters (rfp_ and 4 more), to recognise it. |
tokenLast4 | string The token's last 4 characters. |
scopes | array of strings What the token may do. Each operation lists the scopes it needs. Known values: |
allServers | boolean Whether the token reaches every server of the account, including servers added later. |
serverIds | array of strings The only servers the token reaches (and their sites), when |
ipAllowlist | array of strings The IP addresses and ranges the token may be used from. Empty: any address. |
expiresAt | string or null An ISO 8601 time, in UTC When the token stops working. |
createdAt | string An ISO 8601 time, in UTC When the token was made. |
lastUsedAt | string or null An ISO 8601 time, in UTC When the token was last used (updated at most every few minutes). |
rateLimits | object The token's rate limits, with any change support made for the account included. Each answer's RateLimit headers say how much is left. |
readPerMinute | integer Reads (GET and HEAD requests) the token may make per minute. |
writePerMinute | integer Changes (POST, PUT, PATCH and DELETE requests) the token may make per minute. |
heavyPerMinute | integer Requests per minute to operations that wait for a server or a service while you wait (file operations, tools, graphs, DNS checks). |
perHour | integer Requests of every kind the token may make per hour. |
concurrent | integer Requests the token may have in progress at the same time. |
Example response
{
"data": {
"id": "0b9f2c1e-5d0b-4b53-9a7e-2f1a3a6d7b11",
"name": "deploy-bot",
"tokenStart": "rfp_3kTq",
"tokenLast4": "a1B2",
"scopes": [
"servers:read",
"sites:read",
"sites:write"
],
"allServers": true,
"serverIds": [],
"ipAllowlist": [
"203.0.113.0/24"
],
"expiresAt": "2027-02-16T08:46:49.000Z",
"createdAt": "2026-11-18T08:46:49.000Z",
"lastUsedAt": "2026-11-18T09:12:03.000Z",
"rateLimits": {
"readPerMinute": 120,
"writePerMinute": 30,
"heavyPerMinute": 20,
"perHour": 3000,
"concurrent": 4
}
}
} 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 code | When, and what to do |
|---|---|
400 invalid_ | A query parameter is unknown or has a wrong value ( Correct or remove the parameter named in |
401 missing_ | No API token was sent. Send the header Authorization: Bearer <token>. |
401 invalid_ | 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_ | The token passed its expiry date ( Make a new token in the panel: an expired token can't be regenerated. |
401 token_ | 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_ | The API isn't open to this account. Contact support. |
403 api_ | Support paused this account's API access. Contact support. |
403 two_ | Two-factor authentication became required for this account and is off. Sign in to the panel and turn on two-factor authentication. |
403 ip_ | 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. |
429 rate_ | Too many requests. Wait for Retry-After seconds, then go on more slowly. |
429 concurrency_ | Too many requests of this token are in progress at once. Wait for a request to finish before sending the next. |
503 api_ | The API is switched off for everyone for a while. Try again later; Retry-After says when. |