Skip to content

Error Handling

All Opelyx API errors use the RFC 9457 Problem Details format with content type application/problem+json. This provides structured, machine-readable error information.

{
"type": "https://api.opelyx.com/problems/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Invalid ZIP code format. Expected 5 digits.",
"instance": "/v1/health/plans"
}
FieldDescription
typeURI identifying the error type
titleHuman-readable error category
statusHTTP status code
detailSpecific error message for this occurrence
instanceThe request path that generated the error
StatusTypeMeaning
400validation-errorInvalid request parameters
401unauthorizedMissing or invalid API key
402payment-requiredFeature requires a higher subscription tier
404not-foundResource does not exist
405method-not-allowedHTTP method not supported on this endpoint
406not-acceptableNon-JSON Accept header
429rate-limit-exceededDaily rate limit exceeded
500internal-errorUnexpected server error

Some error responses include additional fields:

{
"type": "https://api.opelyx.com/problems/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Invalid input.",
"errors": [
{ "field": "age", "message": "Expected number, received string" },
{ "field": "zip", "message": "String must contain exactly 5 characters" }
]
}
{
"type": "https://api.opelyx.com/problems/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "Plan comparison requires a Pro subscription.",
"required_tier": "pro",
"upgrade": "https://opelyx.com/#pricing"
}

Check the Retry-After header to know when to retry:

{
"type": "https://api.opelyx.com/problems/rate-limit-exceeded",
"title": "Rate Limit Exceeded",
"status": 429,
"detail": "Daily request limit reached. Resets at midnight UTC.",
"upgrade": "https://opelyx.com/#pricing"
}
  1. Always check status before processing response data
  2. Parse type to programmatically identify error categories
  3. Log instance and X-Request-Id for debugging and support requests
  4. Handle 429 gracefully with exponential backoff respecting Retry-After
  5. Show detail to users as it contains actionable error messages