4xx or 5xx status code and a JSON body with three fields: message, status and data. The status code tells you what kind of error it is, and message says what went wrong.
Error body
What went wrong, such as
Application not found or This API key is missing the APP:UPDATE permission. Grant it to the key or use a key that has it.Details, when there are any. Usually empty (
{}). On most 500 responses, it has code, the request ID, and message, which asks you to contact support with that code. On some 400 responses, it has issues: see Schema validation errors.404 with a different body:
Status codes
Successful requests return200 or 201 with the object or list, 202 when the work continues in the background (see Long-running operations), or 204 with no body. Errors use these codes:
Schema validation errors
A body, query parameter or path parameter that doesn’t match the operation’s schema returns400 with the message Request doesn't match the schema. The API checks the schema before the API key, so a malformed request gets 400 even without a valid key.
On operations whose reference page doesn’t list a 400 response, such as Get application, data.issues describes each problem:
400 response, such as Create application, data is empty. Compare the request with the operation’s body and parameters in this reference.
Request IDs
Every response has anx-request-id header. If you send your own x-request-id header, the response carries the same value, so you can match your logs with Sevalla’s. On most 500 responses, data.code holds the same ID, and data.message asks you to contact support with it.
Include the request ID when you contact support.
Handle errors in code
Check the status code first, then readmessage. This helper throws an error that carries both, with the request ID:
sevalla.ts
Retry safely
4xxerrors fail again until you change the request or the state it depends on. Don’t retry them unchanged, except429.429: wait the number of seconds inretry-after, then retry. See Handle 429 responses.500: retryGETrequests with exponential backoff. Before you retry a write, check whether it took effect, for example by listing the application’s deployments before you trigger another one.