---
title: "How requests work · API docs — Reeflip"
description: "The rules every request to the API follows: keys and access, errors, long lists, limits, and sending a request again safely."
url: "https://reeflip.com/docs/requests"
---

# How requests work · API docs — Reeflip

The same rules hold for every request.

## Keys and access

Send your key with every request, in the `Authorization` header. A key works for your business only.

Each area has its own access. Read lets a key look (GET requests). Read and write lets it change things too. A key can't make or revoke keys, or make, publish or delete flipbooks and catalogs: do those in Reeflip.

A wrong or revoked key gets `invalid_api_key`. A key without the access needed gets `api_key_permission_required`.

## Errors

When something goes wrong, the status is 400 or above and the answer always has the same shape.

Check `code` in your program: it never changes. `message` is written for people, so you can show it. `retryable` tells you if the same request may work later.

```json
{
  "error": {
    "code": "product_not_found",
    "message": "This product does not exist, or was deleted.",
    "details": {},
    "retryable": false
  }
}
```

### Errors any request can get

| Code | Status | What it means |
| --- | --- | --- |
| `invalid_request` | 400 | Something you sent is wrong. `details` names the field. |
| `invalid_api_key` | 401 | The key is wrong, or it was revoked. |
| `api_key_permission_required` | 403 | The key doesn't have the access this needs. |
| `…_not_found` | 404 | Nothing with that id in your business, such as `product_not_found`. |
| `…_conflict` | 409 | It changed after you read it, such as `product_conflict`. Read it again, then make your change. |
| `rate_limited` | 429 | Too many requests. Wait for `Retry-After`. |
| `internal_error` | 500 | Something broke on our side. Try again later. |
| `service_unavailable` | 503 | Reeflip is busy for a moment. Try again later. |

Each endpoint lists the other errors it can give.

## Long lists

Lists come a page at a time. Send `limit` for the page size, 1 to 100 (50 if you leave it out).

While `next_cursor` isn't `null`, send it back as `cursor` to get the next page.

## Limits

Each key can send 200 requests a minute. Past that you get `rate_limited` with a `Retry-After` header: wait that many seconds, then send again.

Your other keys, and Reeflip itself, have limits of their own.

## Sending again safely

If a request times out, you can't tell whether it worked. To send it again without doing it twice, add an `Idempotency-Key` header to POST requests: any unique text, such as a UUID. Make it once, and send the same one with every try.

For 24 hours, the same key with the same request gets the first answer again, with `Idempotent-Replayed: true`. The same key with a different request gets `idempotency_key_reused`.
