Get the OpenAPI document
/v1/openapi.json Answers the API's OpenAPI 3.1 document: every operation, schema, scope and error of v1. Needs no token.
The document itself is the answer (it isn't wrapped in data). It can be cached for 5 minutes. Code generators, Postman and other API tools can read it directly.
Example request
curl "https://api.rabbitflare.com/v1/openapi.json" \
-OJ import { writeFile } from "node:fs/promises";
const res = await fetch("https://api.rabbitflare.com/v1/openapi.json");
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
await writeFile("download", Buffer.from(await res.arrayBuffer())); import { writeFile } from "node:fs/promises";
import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare();
const res = await rf.meta.openapi();
await writeFile("download", Buffer.from(await res.arrayBuffer())); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/openapi.json');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
file_put_contents('download', $body); import requests
response = requests.get(
"https://api.rabbitflare.com/v1/openapi.json",
timeout=120,
)
response.raise_for_status()
with open("download", "wb") as f:
f.write(response.content) Response
200 OK The answer is the file itself, as application/json, without the data envelope.
Example response
The file itself, as application/json, without the data envelope.
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 |
429 rate_ | Too many requests. Wait for Retry-After seconds, then go on more slowly. |
503 api_ | The API is switched off for everyone for a while. Try again later; Retry-After says when. |