API reference

Response formats

Read the JSON envelope, request IDs, value types, and billing metadata that responses share.

Most operations return a JSON envelope: data and meta on success, error and meta on failure. This page describes the shared parts. The payload of each operation is in its API reference page.

Envelope

The shapes below show the envelope only, not the payload of a particular operation.

{"data": {}, "meta": {"request_id": "req_example"}}
{"error": {"code": "validation_error", "message": "Invalid request."}, "meta": {"request_id": "req_example"}}
  • Use error.code for program logic. Messages can change.
  • The X-Request-ID response header matches meta.request_id. Keep it for troubleshooting.

Value types

ValueFormat
Money and ratesDecimal strings
CreditsIntegers
Optional valuesnull has a field-specific meaning. Do not convert every null to zero.

Billing and paging metadata

FieldMeaning
meta.billableWhether the request uses credit billing.
meta.credit.costCredits charged. A charged response can include it.
meta.credit.remainingRemaining credits, estimated under concurrent use.
meta.pagePresent when the response lists a page. Contains limit, has_next, and next_cursor.

GET /me returns account totals in data.credit instead.

Exceptions

  • The export body is the document itself. Read billing from the X-Billable, X-Credit-Cost, and X-Credit-Remaining headers.
  • A 304 response has no body.
  • Health and other documented exceptions follow their operation schema.

Next, see errors or read price data.