Use cases
The Aiven API is ideal for:CI/CD integration
Create test services during CI runs and tear them down automatically
Custom automation
Build custom tools and scripts for your specific workflows
Scheduled operations
Deploy and manage development or demo environments on a schedule
Dynamic scaling
Scale disk space based on metrics or events
Getting started
Create an authentication token
Generate a personal token from the Aiven Console:
- Click your user icon and select Tokens
- Click Generate token
- Provide a description and click Generate
- Copy the token immediately (it won’t be shown again)
Try the API with Postman
Use the Aiven Postman workspace to explore the API:
- Fork the Postman collection and environment
- Add your token to the
authTokenvariable in the environment - Send requests to explore the API
Authentication
All API requests require authentication using a bearer token in the Authorization header:Common API operations
List projects
Retrieve all projects you have access to:- Request
- Response
List cloud regions
Get available cloud regions (no authentication required):- Request
- Response
Create a service
Create a new PostgreSQL service:- Request
- Response
Get service details
Retrieve information about a specific service:- Request
- Response
Update a service
Modify service configuration (e.g., scale to a different plan):- Request
- Response
Delete a service
Permanently delete a service:API resources
Projects
List all projects
Get project details
Services
List services in a project
Create a new service
Get service details
Update service configuration
Delete a service
Service-specific operations
Manage databases (PostgreSQL, MySQL)
Manage service users
Manage Kafka topics
Manage Kafka ACLs
Rate limiting
The Aiven API implements rate limiting to ensure fair usage:- Rate limits: Vary by endpoint and authentication method
- Headers: Check
X-RateLimit-*headers in responses - Best practices: Implement exponential backoff for retries
Error handling
The API returns standard HTTP status codes:Request completed successfully
Invalid request parameters
Invalid or missing authentication token
Insufficient permissions
Resource not found
Rate limit exceeded
Server error - retry with exponential backoff
Best practices
Token security
Token security
- Store tokens in environment variables or secret managers
- Never commit tokens to version control
- Rotate tokens regularly
- Use separate tokens for different applications
Error handling
Error handling
- Implement retry logic with exponential backoff
- Handle rate limiting gracefully
- Log errors for debugging
- Validate responses before processing
Performance
Performance
- Cache responses when appropriate
- Use pagination for large result sets
- Batch operations when possible
- Monitor API usage and limits
SDKs and libraries
While the API is RESTful and language-agnostic, several community libraries are available:- Python: aiven-client (official CLI includes Python library)
- Go: aiven-go-client
- Terraform: Aiven Terraform Provider
- Kubernetes: Aiven Operator
Related resources
- API Reference Documentation
- Aiven Postman Workspace
- Authentication Tokens Guide
- Aiven CLI - Built on the Aiven API