# Errors, retries, pages

One error shape, safe retries with idempotency keys, cursor pages, and dated versions.


## Errors {#errors}

```json
{ "error": { "type": "invalid_request", "code": "fields_missing", "message": "Fill these fields before sending: venue", "param": "data", "fields": ["venue"], "request_id": "req_…", "doc_url": "…" } }
```

`code` is stable and meant for programs; `message` is for people. `param` names the input at fault.

## Idempotency {#idempotency}

Send `Idempotency-Key: <unique>` with any `POST`. Repeating the request with the same key returns the first answer instead of acting twice, so a network timeout is safe to retry. The SDK adds keys by itself.

## Pagination {#pagination}

Lists take `limit` (up to 100), `starting_after` or `ending_before` (an object id), and answer `{ "object": "list", "data": [...], "has_more": true }`. The SDK's `all()` walks every page.

## Versions {#versions}

`Sendforsign-Version: 2026-12-01` pins the API's behaviour; without it, your account's version applies. New versions are dated; nothing changes under a version you pinned.

## Tenants {#tenants}

Platforms serving many businesses create a tenant per business (`POST /v2/tenants`) and act for it with the header `Sendforsign-Tenant: <tenant id>`; a key can also be bound to one tenant. Each tenant has its own documents, branding and sender name.
