> ## 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.

# Vercel BotID

> Endpoints protected by Vercel BotID expect an x-is-human header built from a challenge script. Roolink builds it.

Vercel BotID is Vercel's bot protection for the API routes of sites hosted on its platform. It is built on Kasada, but it works differently from the challenge flows on the other Kasada pages: there is no `429`, no `/tl` and no session token. Instead, protected requests carry a header named `x-is-human`, and the value is derived from a challenge script the page loads.

## How to recognize it

Look at a protected request in your powhttp recording. If it carries an `x-is-human` header whose value is a JSON object, the endpoint is behind BotID. The page will also have loaded a script named `c.js` from a path on the same site with random segments and a query string like `?i=0&v=3&h=www.example.com`. That is the challenge script.

## The flow

**1. Fetch the challenge script**

`GET` the `c.js` URL from your recording, through your session, with the script headers the browser used. Keep the body exactly as received. It is limited to 1 MiB.

**2. Ask Roolink for the header**

Call `/botid` with the script body. Roolink returns a JSON object with six fields: `b`, `v`, `e`, `s`, `d` and `vr`. That object, serialized as JSON, is the header value. Counts against your Kasada plan.

```python Python theme={null}
header = requests.post(f"{ROOLINK}/botid",
    headers={"x-api-key": os.environ["ROOLINK_API_KEY"]},
    json={"script": script.text},
).text  # already a JSON object; send it as-is
```

```go Go theme={null}
header := callRoolink("/botid", map[string]string{"script": script})
// header is the JSON object; send string(header) as-is
```

```typescript TypeScript theme={null}
const header = JSON.stringify(await roolinkPost("/botid", { script: script.body }));
```

**3. Send the protected request**

Make the request with the browser's headers for that endpoint from your recording, and put the JSON string in `x-is-human` in the position the browser had it. Sites built on Vercel commonly send `x-path` and `x-method` alongside it; if your recording shows them, send them too, with the endpoint's path and method.

## When to generate a new header

Generate a fresh header when you start a new session, when the IP changes, or when a protected request answers `429`. Within one session a header can be reused for a while, but generating one per request is cheap and removes the guesswork. The script itself changes rarely; refetch it when a header built from your cached copy starts being refused.

## Request fields

| Field | Required | What it does |
| - | - | - |
| `script` | yes | The `c.js` challenge script, exactly as fetched. Up to 1 MiB. |

## Troubleshooting

> [accordion] Roolink answers 422 with invalid\_script
>
> The body was not a BotID challenge script Roolink can read. Confirm you fetched `c.js` and not another asset, and that the body was not re-encoded. If the site has updated its script, bring the URL to [Discord](https://discord.gg/rooapi).

> [accordion] Roolink answers 413 with script\_too\_large
>
> The script exceeds 1 MiB, which a real BotID script never does. You fetched the wrong file.

> [accordion] The endpoint answers 403 or 429 with the header set
>
> Compare the request with the browser's in powhttp: the `x-is-human` position, the `x-path` and `x-method` values, the content type, and the origin. If they match, the verdict is about the IP or the rest of the fingerprint; change proxy session and try again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.