Capturia measures its ads and site traffic with the Meta pixel and Google Analytics. You can decline at any time. Learn more

FR

Conventions

Request IDs, idempotency, cursor pagination, versioning, and transport rules, common to all v1 endpoints.

Request IDs

Each request gets an ID in ULID format prefixed with req_. This ID is returned in 2 headers (aliased):

  • X-Request-ID: req_01J9X8Z3F4K2M5N7P9Q1R3S5T7
  • Capturia-Request-ID: req_01J9X8Z3F4K2M5N7P9Q1R3S5T7

Give this ID to support: it is what lets us find your request in our logs.

Idempotency

These operations accept an optional Idempotency-Key header, so that a retry does not repeat an operation that already succeeded: POST /v1/contacts, POST /v1/contacts/batch, POST /v1/contacts/{id}/notes, POST /v1/conversation-imports, POST /v1/emails/send, POST /v1/events, POST /v1/leads/capture, POST /v1/purchases, POST /v1/purchases/refunds and POST /v1/quotes. Other endpoints ignore it.

Idempotency-Key: a1b2c3d4-1234-4567-89ab-cdef01234567
  • Format: 16 to 128 characters [A-Za-z0-9_-] (a UUID v4 works). A malformed key is refused with 400 invalid_request (details.field: idempotency-key); an empty header counts as no header

  • Memory: 24 hours

  • Scope: per API key (two different keys can use the same Idempotency-Key without conflict)

  • A refusal (status 400 or above) is not kept: resending the same key replays the request. After a 500 error, the operation may have gone through anyway: check the resource before sending it again

  • Exception: on POST /v1/emails/send, the key is scoped to the whole account with no time limit. Sent again later or from another API key of the account, it returns the email already queued, or 409 idempotency_conflict (details.reason: payload_mismatch) for a different body

Behaviors

ScenarioOutcome
First execution

Endpoint executed normally, response kept 24 hours

Replay (same body)

Original response replayed verbatim, same status, with the Idempotency-Replayed: true header

Conflict (different body)

409 idempotency_conflict with details.reason: payload_mismatch

Concurrent request (the first one is still in progress)

409 idempotency_conflict with details.reason: in_flight and Retry-After: 5

Pagination

All GET collection endpoints use opaque cursor-based pagination:

ParameterTypeDefaultMaxDescription
limitint20100

Page size (max 100, > 100 → 400 invalid_request)

cursorstringNoneNone

Opaque base64url cursor returned in the previous response's pagination.next_cursor

updated_afterdate-timeNoneNone

On contacts, deals, bookings, quotes and payments: only what changed since this date (inclusive), oldest change first. Restart from the updated_at of the last resource you read, minus 2 minutes, and drop duplicates by id

{
  "data": [...],
  "pagination": {
    "next_cursor": "eyJ2IjoxLCJmIjoiY3JlYXRlZF9hdCIsInMiOiJkZXNjIiwidmFsIjoiMjAyNi0wNS0wNFQxMDowMDowMFoiLCJpZCI6ImN0X2FiYyJ9",
    "has_more": true,
    "limit": 20
  }
}

Error format

Every refusal follows the same envelope, and its exact shape is the example the reference shows for that endpoint: error.type, error.code (the stable code, the one to test), error.message often followed by error.hint, error.doc_url, error.request_id and, when relevant, error.details. The refusal is written in French if the request sends Accept-Language: fr, in English otherwise; codes never change language. Every endpoint and every one of its refusals is in the reference. The list of codes: Error catalog.

  • Unserved method: 405 method_not_allowed, with the Allow header listing the address's methods.
  • Unknown address under /v1: 404 not_found.
  • Call from a browser (Origin header): 403 browser_not_allowed, except on POST /v1/leads/capture, POST /v1/contacts/batch, GET /v1/me and GET /v1/usage. An API key is a secret: use it from a server.
  • Body over 4.5 MB: our host, Vercel, answers 413 FUNCTION_PAYLOAD_TOO_LARGE, in its own shape.

Versioning and deprecation

URL versioning (/v1/, future /v2/). A major version is bumped only for breaking changes — backwards-compatible additions stay in the current version.

  • Minimum 12-month delay between deprecation announcement and removal

  • Headers emitted on deprecated endpoints: Deprecation (RFC 9745) + Sunset (RFC 8594) + Link: <url>; rel="deprecation"

  • Public changelog page: /developers/api/v1/changelog

Dry-run mode

No endpoint has a trial mode: a ?dry_run=true parameter is ignored and the request runs normally.

Content-Type

Strict application/json (with or without charset=utf-8). Refused: multipart/form-data, application/x-www-form-urlencoded, etc. → 415 invalid_content_type.

Body size

Limit: 1 MB per request. Over → 413 payload_too_large, with details.max_bytes and, when the request sends Content-Length, details.received_bytes. For large batches (more than 100 contacts), use several smaller requests, each with its own Idempotency-Key.

Encoding

Strict UTF-8. Any other charset rejected → 400 invalid_encoding.

Compression

Handled automatically by Vercel: Accept-Encoding: gzip, br supported. The Vary: Accept-Encoding header is emitted for intermediate caches.