Overview
The Vepler API uses standard HTTP status codes and returns detailed error objects to help you handle errors gracefully. All errors follow a consistent structure for easy parsing and debugging.Error Response Structure
All API errors return a JSON response with the following structure:Error Fields
| Field | Type | Description |
|---|---|---|
code | string | Machine-readable error code |
message | string | Human-readable error message |
details | object | Additional context about the error |
request_id | string | Unique request identifier for support |
timestamp | string | ISO 8601 timestamp of the error |
HTTP Status Codes
Success Codes (2xx)
| Status | Description | When Used |
|---|---|---|
| 200 OK | Request succeeded | Successful GET, PUT, DELETE |
| 201 Created | Resource created | Successful POST creating new resource |
| 204 No Content | Request succeeded, no content | Successful DELETE |
Client Error Codes (4xx)
| Status | Error Code | Description |
|---|---|---|
| 400 Bad Request | INVALID_REQUEST | Malformed request syntax or invalid parameters |
| 401 Unauthorized | UNAUTHORIZED | Missing or invalid API key |
| 403 Forbidden | FORBIDDEN | Valid API key but insufficient permissions |
| 404 Not Found | RESOURCE_NOT_FOUND | Requested resource doesn’t exist |
| 409 Conflict | CONFLICT | Request conflicts with current state |
| 422 Unprocessable Entity | VALIDATION_ERROR | Request body validation failed |
| 429 Too Many Requests | RATE_LIMIT_EXCEEDED | Rate limit exceeded |
Server Error Codes (5xx)
| Status | Error Code | Description |
|---|---|---|
| 500 Internal Server Error | INTERNAL_ERROR | Unexpected server error |
| 502 Bad Gateway | GATEWAY_ERROR | Upstream service error |
| 503 Service Unavailable | SERVICE_UNAVAILABLE | Service temporarily unavailable |
| 504 Gateway Timeout | GATEWAY_TIMEOUT | Upstream service timeout |
Common Error Codes
Authentication Errors
| Code | Description | Solution |
|---|---|---|
MISSING_API_KEY | No API key provided | Include x-api-key header |
INVALID_API_KEY | API key is malformed or doesn’t exist | Check your API key |
EXPIRED_API_KEY | API key has expired | Generate a new API key |
INSUFFICIENT_PERMISSIONS | API key lacks required permissions | Upgrade plan or request access |
Validation Errors
| Code | Description | Solution |
|---|---|---|
VALIDATION_ERROR | Request parameters invalid | Check field requirements |
INVALID_DATE_FORMAT | Date format incorrect | Use ISO 8601 format |
INVALID_COORDINATES | Lat/lng out of range | Verify coordinate values |
INVALID_POSTCODE | UK postcode invalid | Check postcode format |
Resource Errors
| Code | Description | Solution |
|---|---|---|
RESOURCE_NOT_FOUND | Resource doesn’t exist | Verify resource ID |
RESOURCE_DELETED | Resource has been deleted | Resource no longer available |
RESOURCE_LOCKED | Resource temporarily locked | Retry after delay |
Rate Limiting Errors
| Code | Description | Solution |
|---|---|---|
RATE_LIMIT_EXCEEDED | Too many requests | Wait for reset or upgrade |
DAILY_QUOTA_EXCEEDED | Daily limit reached | Wait until tomorrow or upgrade |
CONCURRENT_LIMIT_EXCEEDED | Too many concurrent requests | Reduce parallel requests |
Query Errors
| Code | Description | Solution |
|---|---|---|
QUERY_TOO_BROAD | Query returns too many results | Add more filters |
INVALID_QUERY_SYNTAX | Query syntax incorrect | Check query format |
UNSUPPORTED_FILTER | Filter not supported | Remove unsupported filter |
Error Handling Examples
TypeScript/JavaScript
Python
cURL
Retry Strategy
Implement exponential backoff for transient errors:Error Recovery Patterns
Circuit Breaker
Prevent cascading failures:Graceful Degradation
Provide fallback behavior:Debugging
Use therequest_id for support requests:
Best Practices
Always Handle Errors
Always Handle Errors
Never assume API calls will succeed:
Log Errors Properly
Log Errors Properly
Include context in error logs:
Use Specific Error Handlers
Use Specific Error Handlers
Handle different errors appropriately:
Implement Timeouts
Implement Timeouts
Set reasonable timeouts: