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 anok field that indicates success or failure:
Success 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
Theok 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 or missing API key)
- 404 - Not Found (resource doesn’t exist)
- 500 - Internal Server Error
