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:
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
