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

# Generate a web sensor

> POST /api/v1/sensor on web.veilroute.dev

```http theme={null}
POST https://web.veilroute.dev/api/v1/sensor
```

Generates `sensor_data` for the Akamai browser challenge.

## Request

### Headers

**X-Api-Key** `string` *required*

Your Akamai Web API key.

**Content-Type** `string` *required*

Must be `application/json`.

### Body

**cookies** `string`

The Akamai cookies you currently hold for the target site, as a single `Cookie`-header string
(for example `_abck=...; bm_sz=...`). Up to 4096 characters. Omit on the very first call if you
have none yet.

## Response

**sensor\_data** `string`

The sensor value. Post this to the target site's Akamai endpoint as `sensor_data`.

**length** `number`

Length of `sensor_data`, for convenience.

**cookies** `string`

The updated cookie jar after generating the sensor. Carry this forward onto your next request.

The response also carries an `x-cold` header (`true`/`false`) indicating whether it was served from
a freshly booted runtime. It is informational only.

```bash curl theme={null}
curl -X POST https://web.veilroute.dev/api/v1/sensor \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $VEILROUTE_KEY" \
  -d '{"cookies":"_abck=...; bm_sz=..."}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://web.veilroute.dev/api/v1/sensor",
    headers={"X-Api-Key": os.environ["VEILROUTE_KEY"]},
    json={"cookies": "_abck=...; bm_sz=..."},
    timeout=30,
)
data = r.json()
sensor = data["sensor_data"]
cookies = data["cookies"]
```

```javascript Node theme={null}
const res = await fetch("https://web.veilroute.dev/api/v1/sensor", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": process.env.VEILROUTE_KEY,
  },
  body: JSON.stringify({ cookies: "_abck=...; bm_sz=..." }),
});
const { sensor_data, cookies } = await res.json();
```

```json 200 OK theme={null}
{
  "sensor_data": "7a74G7m23Vrp0o5c9...",
  "length": 2456,
  "cookies": "_abck=...; bm_sz=..."
}
```

See [Errors](/errors) for non-`200` responses.


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