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

# Request IDs

> Trace a request with X-Request-ID.

Every response from `/api/v1/crm` and `/api/v2` has an `X-Request-ID` header. Quote it when you contact support: it lets us find the exact request in our logs.

## Sending your own id

If you send an `X-Request-ID` request header, the API reuses it. This lets you correlate your own logs with ours.

* Allowed characters: letters, digits, `_`, `.` and `-`.
* Length: 1 to 128 characters.
* A missing or invalid value is replaced by a generated UUID. The request still succeeds.

```bash theme={null}
curl https://client-backend.oktivo.com/api/v2/calls \
  -H "Authorization: Bearer okt_your_token" \
  -H "X-Request-ID: checkout-7f3a91"
```

The response carries `X-Request-ID: checkout-7f3a91`.

## Where it appears

| Place | v1 | v2 |
| - | - | - |
| `X-Request-ID` response header | Yes | Yes |
| `requestId` in error bodies | Yes | Yes |
| `requestId` in success bodies | Yes (added to every JSON object body) | Yes |

The value in the body is always the same as the header. A success body from `/api/v1/crm` that is not a JSON object (an array, a file or a stream) carries the header only. A response replayed by an [Idempotency-Key](https://docs.oktivo.com/api-reference/idempotency.md) gets the `requestId` of the replaying request.

Use a fresh id per request. If you retry, send a new id and keep the `Idempotency-Key` the same.


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