API reference
Errors
The Spark error shape, HTTP classes, error codes, and how to handle them.
Error shape
Every error returns the same JSON shape. Spark also sends x-request-id on every response.
JSON
{
"error": {
"code": "invalid_request",
"message": "Choose a valid role."
}
}Fields
code— a short, stable machine token.message— human-readable text, when Spark has one.
HTTP classes
| Status | Meaning |
|---|---|
| 2xx | The request succeeded. |
| 400 | The request body or query is invalid. |
| 401 | The API key is missing, invalid, expired, or revoked. |
| 403 | The key is valid but lacks the required role. |
| 404 | The workspace or resource was not found. |
| 409 | The change conflicts with a workspace rule, such as last admin. |
| 413 | The JSON body is larger than 16,384 bytes. |
| 5xx | A Spark error. Safe to retry idempotent calls. |
Was this page helpful?