Validation failed (400)
The request was refused because a value is missing, malformed or out of range.
Status: 400 Bad Request · type: https://api.sparkle.ai/errors/validation
When it happens
- A required field is missing, or a value isn't in the expected format (a URL, an ID, a date).
- The body isn't valid JSON, has a field the operation doesn't accept, or a value of the wrong type.
- A path ID or a query parameter couldn't be read, such as a
limitthat isn't a number. - A
POSTorPUTcame without anIdempotency-Keyheader, or reused a key for a different method or path.
How to fix it
Fix the request before sending it again; the same request gets the same error. When the error is about fields, errors holds one item per field, with the field in field (dot notation, such as metadata.source) and the reason in code. Branch on code in your code; detail and message are for whoever is debugging and can change.
Example
{
"type": "https://api.sparkle.ai/errors/validation",
"title": "Validation Failed",
"status": 400,
"detail": "webhook URL is required",
"instance": "/public/v1/webhooks",
"code": "validation.webhook.url_required",
"request_id": "req_abc123",
"timestamp": "2026-02-15T12:00:00Z",
"documentation_url": "https://docs.sparkle.ai/docs/api/errors/validation",
"errors": [
{
"field": "url",
"message": "webhook URL is required",
"code": "validation.webhook.url_required",
"resource": "WebhookSubscription"
}
]
}