Skip to main content

Response Format

All API responses follow a consistent, type-safe format that makes error handling straightforward.
Type Safety: When response.ok is true, the data field is guaranteed to be defined. When response.ok is false, the data field will not be defined. This pattern enables type-safe response handling.

Response Structure

Every API response includes an ok field that indicates success or failure: Success Response:
Error Response:
Pagination: endpoints that support keyset pagination (e.g. accounts.getAccounts(), posts.getPosts()) include an additional nextCursor field alongside data when a limit was passed — pass it back as cursor to fetch the next page. See each endpoint’s reference page for details.

Using the Response Pattern

The ok field allows you to easily check if the request succeeded:

HTTP Status Codes

Common status codes you may encounter:
  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (invalid, missing, or expired API key)
  • 403 - Forbidden (the key is valid but lacks the required scope, or is not bound to that resource)
  • 404 - Not Found (resource doesn’t exist)
  • 500 - Internal Server Error