Success shape
Every successful response looks like this:data is endpoint-specific — see each operation’s reference page for its
shape. data may be null for actions that don’t return a resource (a
toggle, a delete).
Error shape
messageis written to be shown directly to an end user if you want to.error_codeis the stable, machine-readable field — switch your code on this, not onmessage(wording can change; the code won’t). Every code used across this API is documented on the operation that returns it.request_id— include this when contacting support about a specific failed call.errorsis only present on422validation failures — an object keyed by field name, each value an array of messages:
HTTP status codes used
A note on error_code values
error_code is only guaranteed present when it’s genuinely one of ours —
you’ll notice each operation’s reference lists a specific, finite set (e.g.
ACCOUNT_NOT_FOUND, INSUFFICIENT_BALANCE, DUPLICATE_REFERENCE). Don’t
assume every possible failure has a code beyond that documented set.