Test a token
/v1/ping Answers ok: true and the API's time when the token works. Any valid token can call it: it needs no scope and changes nothing.
Use it to check a new token, or that a token still works, before making real calls.
Scopes
Any valid token can make this request.
Example request
curl "https://api.rabbitflare.com/v1/ping" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/ping", {
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.meta.ping();
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/ping');
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/ping",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the Ping object in data.
The Ping object's fields 2 fields
| Field | Type and description |
|---|---|
ok | boolean Always true: the token works. |
time | string An ISO 8601 time, in UTC The API's clock when it answered, in UTC. |
Example response
{
"data": {
"ok": true,
"time": "2026-11-18T08:46:49.000Z"
}
} 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. |