Skip to main content
Every response from the estudjo API — success or error — uses the same JSON envelope shape, making it straightforward to handle consistently across your codebase. You never need to inspect HTTP status codes alone; the success flag tells you immediately whether the call succeeded.

Success Envelope

When a request succeeds, the response body contains success: true and a data object holding the result payload:
The shape of data varies by endpoint and is documented on each individual endpoint reference page.

Error Envelope

When a request fails, the response body contains success: false and an error object with a machine-readable code and a human-readable message:
Always branch on error.code (stable, snake_case), never on error.message — the message text can change without notice and is intended for display purposes only.

HTTP Status Codes

estudjo uses standard HTTP status codes alongside the JSON envelope. Use the success flag for branching logic, and use the HTTP status code for coarse-grained categorization (for example, in logging or alerting).

Parsing Example

The pattern below covers the full response-handling lifecycle: fetch, parse, branch on success, and switch on error.code for specific recovery logic.
response-handler.js
All error codes, including every possible error.code value and the conditions that trigger them, are documented on the Error Codes reference page.