Errors¶
Every error response has the same shape:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "amount must be a positive integer",
"details": { "field": "amount" }
}
}
details is optional. The SDKs raise a typed error (OuraError, OuraException or *oura.Error)
that exposes code, status and message.
| Code | HTTP | What to do |
|---|---|---|
VALIDATION_ERROR |
400 | Fix the request. details says which field. |
UNAUTHORIZED |
401 | The key is missing, malformed or revoked. |
FORBIDDEN |
403 | The key can't do this, for example a test key reading live data. |
NOT_FOUND |
404 | No such payment for this key's mode. |
CONFLICT |
409 | The payment's state doesn't allow this (such as cancelling a paid payment), or a request with the same idempotency key is still in progress. |
RATE_LIMITED |
429 | Slow down and retry with backoff. |
INTERNAL |
500 / 502 | Something failed on our side or at the rail. Retry with the same idempotency key. |
The SDKs also define IDEMPOTENCY_CONFLICT and PROVIDER_ERROR for future use. Handle unknown codes
by their HTTP status.
The SDKs also use CONNECTION_ERROR when they can't reach the API at all.