Error codes, HTTP status mapping, and troubleshooting.
When something goes wrong with an API request, Oquira returns a structured error response that helps you identify and resolve the issue.
Oquira uses standard HTTP response codes to indicate the success or failure of an API request.
| Code | Description |
|---|---|
200 OK | The request succeeded |
201 Created | A resource was successfully created |
204 No Content | The request succeeded with no response body |
| Code | Description |
|---|---|
400 Bad Request | The request is invalid (e.g., malformed JSON, missing fields) |
401 Unauthorized | Authentication is required or failed |
403 Forbidden | You do not have permission to perform this action |
404 Not Found | The requested resource does not exist |
409 Conflict | Conflict with the current state (e.g., duplicate identifier) |
422 Unprocessable Entity | The data failed validation |
429 Too Many Requests | Rate limit exceeded |
| Code | Description |
|---|---|
500 Internal Server Error | An unexpected error occurred on our side |
502 Bad Gateway | Temporary upstream service issue |
503 Service Unavailable | Service temporarily unavailable |
All error responses follow this structure:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable explanation of what went wrong",
"details": {
"field": "Which field caused the error",
"reason": "Why it failed"
},
"timestamp": "2024-03-20T10:00:00.000Z",
"requestId": "req_5f2b8c9d1e"
}
}| Error Code | HTTP Status | Description |
|---|---|---|
AUTHENTICATION_ERROR | 401 | Missing or invalid credentials |
TOKEN_EXPIRED | 401 | Session token has expired |
INVALID_API_KEY | 401 | The API key is invalid or malformed |
KEY_REVOKED | 403 | The API key has been revoked |
| Error Code | HTTP Status | Description |
|---|---|---|
AUTHORIZATION_ERROR | 403 | Insufficient permissions for this operation |
SCOPE_REQUIRED | 403 | API key lacks the required scope |
RESOURCE_FORBIDDEN | 403 | Access to this specific resource is denied |
| Error Code | HTTP Status | Description |
|---|---|---|
VALIDATION_ERROR | 422 | Data validation failed (see details for fields) |
INVALID_FORMAT | 400 | Request body is malformed (e.g., invalid JSON) |
MISSING_FIELD | 400 | A required field is missing |
INVALID_VALUE | 422 | A field value is outside acceptable range |
| Error Code | HTTP Status | Description |
|---|---|---|
NOT_FOUND | 404 | The requested resource could not be found |
DUPLICATE_RESOURCE | 409 | A resource with this identifier already exists |
RESOURCE_CONFLICT | 409 | The resource state conflicts with the operation |
| Error Code | HTTP Status | Description |
|---|---|---|
API_RATE_LIMIT_EXCEEDED | 429 | Too many API requests in a short period |
QUOTA_EXCEEDED | 403 | Monthly or daily quota has been exceeded |
| Error Code | HTTP Status | Description |
|---|---|---|
QUEUE_CLOSED | 403 | The queue is currently closed |
QUEUE_PAUSED | 403 | The queue is temporarily paused |
QUEUE_FULL | 403 | Maximum queue capacity has been reached |
TICKET_LIMIT_REACHED | 403 | Customer has reached maximum active tickets |
TICKET_EXPIRED | 410 | The ticket has expired |
TICKET_ALREADY_CALLED | 409 | This ticket has already been called |
NO_TICKETS_WAITING | 404 | No tickets are waiting in this queue |
| Error Code | HTTP Status | Description |
|---|---|---|
SUBSCRIPTION_REQUIRED | 403 | This feature requires a paid subscription |
PLAN_LIMIT_EXCEEDED | 403 | You've exceeded the limits of your plan |
For VALIDATION_ERROR, the details object provides specific information about what failed:
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed for 2 fields",
"details": {
"errors": [
{
"field": "email",
"message": "Must be a valid email address",
"received": "invalid-email"
},
{
"field": "phone",
"message": "Must match format: +1234567890",
"received": "123"
}
]
},
"timestamp": "2024-03-20T10:00:00.000Z",
"requestId": "req_5f2b8c9d1e"
}
}The message field provides a human-readable explanation. Start here to understand what went wrong.
For validation errors, the details object tells you exactly which fields failed and why.
Common issues to check:
If you receive a 429 error:
Retry-After header for when to retryAlways log the requestId from error responses. When contacting support, provide:
requestIdIf you can't resolve an issue:
requestId and error detailssupport@oquira.com with:
requestId