Gestión de errores
The vitalera healthcare API uses standard HTTP status codes and returns structured error responses to help you diagnose and resolve issues in your remote patient monitoring (RPM) integration. Whether you are collecting vital signs from medical devices or managing clinical workflows, consistent error handling ensures reliable data exchange.
Formato de respuesta de error
All error responses follow a consistent JSON structure:
{
"detail": "A human-readable description of the error.",
"code": "error_code"
}
For validation errors, the response includes field-level details:
{
"field_name": ["This field is required."],
"nested_field": {
"sub_field": ["Ensure this value is greater than 0."]
}
}
Códigos de estado HTTP comunes
Errores del cliente (4xx)
| Code | Meaning | Description |
|---|---|---|
400 | Bad Request | The request body is malformed or missing required fields. Check the response for field-level validation errors. |
401 | Unauthorized | Authentication failed. The JWT token is missing, expired, or invalid. |
403 | Forbidden | The authenticated user does not have permission to access this resource or perform this action. |
404 | Not Found | The requested resource does not exist, or the user does not have visibility to it. |
422 | Unprocessable Entity | The request is well-formed but contains semantic errors (e.g., invalid state transition, business rule violation). |
429 | Too Many Requests | Rate limit exceeded. See Rate Limiting for details on limits and retry strategies. |
Errores del servidor (5xx)
| Code | Meaning | Description |
|---|---|---|
500 | Internal Server Error | An unexpected error occurred on the server. If this persists, contact support with the request ID. |
502 | Bad Gateway | A downstream service is temporarily unavailable. Retry after a short delay. |
503 | Service Unavailable | The service is undergoing maintenance. Check the status page for updates. |
Errores de autenticación
Token expirado
{
"detail": "Given token not valid for any token type",
"code": "token_not_valid"
}
Resolution: Request a new access token using your refresh token or client credentials. See Authentication.
Token ausente
{
"detail": "Authentication credentials were not provided."
}
Resolution: Include a valid JWT token in the Authorization: Bearer <token> header.
Errores de validación
Validation errors return 400 Bad Request with field-specific messages:
{
"status": ["\"invalid\" is not a valid choice."],
"effective_period_start": ["This field is required."]
}
Resolution: Fix the indicated fields and retry the request. Refer to the API Reference for valid field values.
Errores de limitación de tasa
When you exceed the rate limit, the API returns 429 Too Many Requests:
{
"detail": "Request was throttled. Expected available in 30 seconds."
}
Resolution: Wait for the duration indicated in the response or the Retry-After header before retrying. See Rate Limiting for quota details.
Consejos de solución de problemas
- Check the response body -- error responses always include a human-readable
detailmessage. - Validate your JWT -- use jwt.io to decode your token and check its expiration (
expclaim). - Verify permissions -- ensure your application or user role has access to the requested resource.
- Review request format -- compare your request against the API Reference examples.
- Check rate limits -- if you receive
429responses, implement exponential backoff. - Contact support -- for persistent
500errors, contact support@vitalera.io with the request timestamp and endpoint.