> ## Documentation Index
> Fetch the complete documentation index at: https://docs.roolink.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> One key, one host per product, JSON in and out. What every Roolink endpoint has in common.

Every Roolink endpoint is a `POST` over HTTPS. You send JSON, you get JSON back, and the same API key works everywhere. The pages in this section are generated from the OpenAPI definitions the services are built against, so field names, types and status codes are exact. Use the playground on any page to send a real request with your key.

## Base URLs

Each product runs on its own host.

| Product    | Base URL                        |
| ---------- | ------------------------------- |
| Akamai Web | `https://web.roolink.io/api/v1` |
| Akamai BMP | `https://bmp.roolink.io/api/v1` |

## Authentication

Send your key in the `x-api-key` header on every request. Keys start with `roo_`. A missing or invalid key returns `401` before the request reaches a product.

```bash theme={null}
curl -X POST https://web.roolink.io/api/v1/parse \
  -H "x-api-key: $ROOLINK_API_KEY" \
  -H "Content-Type: text/plain" \
  --data-binary @script.js
```

## Request bodies

Send `Content-Type: application/json` and one JSON object. The one exception is Akamai Web `/parse`, which takes the raw script as `text/plain`. Send scripts exactly as fetched, without trimming or re-encoding.

## Status codes

| Status | Meaning                                                                                           | What to do                                          |
| ------ | ------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `200`  | Success. The body is the payload or the fields the page describes.                                | Use it.                                             |
| `400`  | The body is not valid JSON, or a script could not be parsed.                                      | Fix the request.                                    |
| `401`  | The key is missing or wrong.                                                                      | Check the `x-api-key` header.                       |
| `403`  | The plan on this key has expired.                                                                 | Renew it in the dashboard.                          |
| `413`  | The body is too large.                                                                            | Send only the script the page served.               |
| `422`  | A field is missing, a URL is not absolute, or Roolink has no browser profile for this User-Agent. | Read the `error` message and fix the field.         |
| `429`  | The product is not enabled on your key, or its quota is used up.                                  | Check your plan in the dashboard.                   |
| `503`  | The service is temporarily unavailable.                                                           | Wait a moment and retry, backing off if it repeats. |

Only `503` is worth retrying. Every other error means the request needs to change.

## Error bodies

Errors return JSON with a single `error` field that describes what was wrong.
