HTTP status codes
The API returns standard HTTP status codes:Success codes (2xx)
The request succeeded. The response body contains the requested data.
A resource was successfully created. The response includes the new resource details.
The request has been accepted for processing but is not yet complete. Common for long-running operations.
The request succeeded but there’s no content to return. Common for DELETE operations.
Client error codes (4xx)
The request is malformed or contains invalid parameters. Check your request body and query parameters.
Authentication failed or no authentication token was provided. Verify your token is valid and properly formatted.
The authenticated user doesn’t have permission to access this resource. Check your organization and project permissions.
The requested resource doesn’t exist. Verify the resource name or ID.
The request conflicts with the current state of the resource. For example, trying to create a resource that already exists.
You’ve exceeded the API rate limit. Implement exponential backoff and retry logic.
Server error codes (5xx)
An unexpected error occurred on the server. Retry the request, and contact support if the issue persists.
The API is temporarily unavailable. Retry the request after a brief delay.
Error response format
Error responses follow a consistent JSON structure:Array of error objects with detailed information
Top-level error message summarizing the issue
Common error scenarios
Authentication errors
Validation errors
Resource errors
Rate limiting
429 - Too many requests
Error handling best practices
Implement retry logic
Implement retry logic
Implement exponential backoff for retrying failed requests, especially for 429 (rate limit) and 5xx (server error) responses.
Validate before sending
Validate before sending
Validate request parameters client-side before making API calls to avoid unnecessary round trips and rate limit consumption.
Log error details
Log error details
Log complete error responses including status codes, messages, and affected fields for easier troubleshooting.
Handle errors gracefully
Handle errors gracefully
Provide meaningful error messages to end users while logging technical details for debugging.
Check service status
Check service status
When encountering persistent 5xx errors, check the Aiven status page for ongoing incidents.
Use idempotency keys
Use idempotency keys
For critical operations, implement idempotency to safely retry requests without duplicating resources.
Rate limiting details
The Aiven API implements rate limiting to ensure fair usage:- Rate limits are applied per authentication token
- Different endpoints may have different rate limits
- When rate limited, wait for the time specified in the error message
- Implement exponential backoff starting with a 1-second delay
Getting help
If you encounter persistent errors or unexpected behavior:- Check the full API documentation for endpoint-specific details
- Review the Aiven status page for service incidents
- Search the Aiven community forum for similar issues
- Contact Aiven support with error details and request IDs