Skip to content

Requests and responses

The base URL, JSON, ids, times, amounts and the shape of every answer.

3 min read Updated

How every request is sent and every answer is shaped. The rules are the same for every operation, so code written for one fits the others.

The base URL

Base URL
https://api.rabbitflare.com/v1

Every path starts with /v1, and every request goes over HTTPS. Send bodies as JSON, with Content-Type: application/json, up to 1 MB. Every answer is JSON in UTF-8, and every field name is in camelCase.

Ids, times, amounts and sizes

ValueRuleExample
Field names camelCase. "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d"
"createdAt": "2026-11-18T08:46:49.000Z"
Ids Strings. A resource's own id is id; an id of something else ends in Id. "id": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d"
Times ISO 8601 in UTC, with milliseconds. Their names end in At. "createdAt": "2026-11-18T08:46:49.000Z"
Amounts US cents, in a field whose name has Cents in it, with currency (always usd) beside it. Whole cents, except a price per GB, which can have decimals (extraCentsPerGbMonth: 2.085). "priceMonthlyCents": 5200
"currency": "usd"
Sizes The unit is in the name. "memoryGb": 1
"diskGb": 25
Fixed values lower_snake_case words. New ones can appear (see below). "status": "pending_payment"
Nothing null. The field is still there. "lastError": null
Lists Always arrays, never null. "serverIds": []

The shape of every answer

An answer's top level holds only data (what you asked for), pagination (beside a list's page) and error (what went wrong). Never a bare list or a bare value, so you can always read data:

JSON
{ "data": { "id": "…", "name": "Production", … } }
{ "data": [ … ], "pagination": { "limit": 25, "hasMore": true, "nextCursor": "…" } }
{ "error": { "type": "…", "code": "…", "message": "…", … } }

Status codes

RequestStatusBodyFor example
Read one thing 200 OK data: the thing Get a server
Read a list 200 OK data: a page of items, and pagination List servers
Create 201 Created data: what was made. Location gives where to read it: its address, or, for a domain connected to a site, the site's list of domains Create a site
Change, or an action that's done 200 OK data: the resource as it is now Change a server's log clean-up
Work accepted, still running 202 Accepted data: the resource in its in-between state Reboot a server
Deleted, nothing left to show 204 No Content None Delete a webhook endpoint
Deleting that takes time 202 Accepted data with status deleting; or 200 and deleted when it was removed at once Destroy a server

A request that fails answers with a status of 400 or more and an error (see Errors).

Requests are strict

A typo never does nothing quietly: what the API doesn't know, it refuses.

  • A body field the operation doesn't have, like planID for planId when you create a server, answers 422 validation_failed, with "fields": { "planID": "Unknown field." }. Every problem is reported at once, by the field's path, like site.adminEmail.
  • An unknown query parameter, a boolean other than true or false, or a time without its time zone (use 2026-11-18T00:00:00Z) answers 400 invalid_parameter. So does a query string over 16,384 characters as sent, or a parameter's name over 64.
  • A body that isn't JSON, or isn't an object, answers 400 invalid_json; one sent as anything but JSON, 415 unsupported_media_type; one over 1 MB, 413 payload_too_large.
  • An operation that takes no body accepts an empty one or {}.
  • A path that ends with a slash answers 404 unknown_endpoint.
  • An id in a path is never . or ..: URL libraries (curl's, fetch's and others) remove such a segment before the request leaves, .. with the segment before it (written %2e or %2E%2E too), so the request reaches another path and the API can't tell. GET /v1/servers/../sites arrives as GET /v1/sites and lists every site. Check an id you didn't get from the API before you put it in a path; the SDK refuses these two. A change can never reach another operation this way: no operation's path leads to another change when an id is left out. A client that sends such a path as written gets the same: it reaches the other path.

Answers grow

Within v1, answers only grow: new fields, new values in a field of fixed values (a status, say), new event types and new error codes can appear at any time. Write your code so they don't break it:

  • Ignore fields you don't know.
  • Treat a status, type or value you don't know as something new: show it, log it, carry on.
  • For an error code you don't know, go by its type and the HTTP status.

Anything that could break your code comes in a new version (see Versioning).

The request id

Every answer carries an X-Request-Id header, like req_8Zk2mPq4Xc7Lw9Tn0Bv3Ys; an error has the same id in requestId. Log it, and quote it when you contact support: it finds the request on our side, and, for a change, a failure or an answer that held a secret, in your own request log (API → Activity in the panel; successful reads are only counted there).

Timeouts

Some calls wait for one of your servers to answer: allow 120 seconds for an answer, as the samples do. Work that takes longer, like setting up a server, answers at once and goes on in the background (see Long-running operations). An upload must arrive whole within 5 minutes of its start, or it's cut off and nothing is kept. Its samples wait 6 minutes for the answer, so they never give up on an upload that arrived (Upload a file to a site, Upload a file for a ticket message).

Not for browsers

The API sends no CORS headers, so a web page can't call it. That's on purpose: a token in a page's code is there for anyone who opens the page. Call the API from your server, a script or a CI job, and keep the token there.

Still have a question?

Our team answers support tickets about the API, and other developers answer in the community.

Contact support

Popular

API docs