# Verify events

Source: https://langbot.ai/docs/api/receipts/verify

`POST /v1/receipts/verify`

Recompute the hashes of events you hold and check them against the record, plus signed provenance and evidence reports.

**Auth.** None. Without a token the call is served as Free (the Free delay and request budget, shared per IP); send `Authorization: Bearer lb_…` for your plan's.

**Limits.** Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

## Parameters

### Body

| Name | Type | Required | Description |
|---|---|---|---|
| `events` | array of object | no | Events as you received them. Up to 500 items. |
| `reports` | array of object | no | Signed provenance reports or evidence packs. Up to 50 items. |

## Request

**curl**

```bash
curl -X POST "https://api.langbot.ai/v1/receipts/verify" \
  -H "Content-Type: application/json" \
  -d '{"events": [{"id": "evt_01K7Q0000000000000000000A2", "hash": "5d0e05c3…", "…": "…"}]}'
```

**Python**

```python
from langbot import LangbotClient

async with LangbotClient() as lb:
    results = await lb.verify_receipts(events)  # recomputes locally, then asks the feed
    print(results)
```

**TypeScript**

```ts
const res = await fetch("https://api.langbot.ai/v1/receipts/verify", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"events": [{"id": "evt_01K7Q0000000000000000000A2", "hash": "5d0e05c3\u2026", "\u2026": "\u2026"}]}),
});
console.log(await res.json());
```

## Response

`201 Created`

```json
{
  "results": [
    { "id": "evt_01K7Q0000000000000000000A2", "status": "match", "computed_hash": "5d0e05c3…", "stored_hash": "5d0e05c3…", "chain_ok": true, "chain_seq": 2, "checkpoint": { "chain_seq": 2, "key_id": "56475aa75463474c", "signature": "cEf385IN…" } }
  ]
}
```

`status` is `match`, `mismatch` or `unknown`. `chain_ok` says whether the stored `prev_hash` equals the stored hash one position earlier (`null` for the first event). No plan delay applies: you already hold the events.

## Errors

| Status | `code` | When |
|---|---|---|
| 401 | `token_invalid` | A token was sent and not recognised. Send a valid one, or none to call anonymously. |
| 422 | `validation_error` | A parameter failed validation; `detail[].loc` names it. |
| 429 | `rate_limited` | Over your request budget; wait `Retry-After` seconds. |

Every error body is `{"detail": …, "code": "…"}`; branch on `code`. All codes: [Errors](https://langbot.ai/docs/api#errors).
