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
1
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)
2
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
3
Make your first API call
Test authentication by listing your projects:
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
GET
List all projects
GET
Get project details
Services
GET
List services in a project
POST
Create a new service
GET
Get service details
PUT
Update service configuration
DELETE
Delete a service
Service-specific operations
GET/POST
Manage databases (PostgreSQL, MySQL)
GET/POST
Manage service users
GET/POST
Manage Kafka topics
GET/POST
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:Success
Request completed successfully
Bad Request
Invalid request parameters
Unauthorized
Invalid or missing authentication token
Forbidden
Insufficient permissions
Not Found
Resource not found
Too Many Requests
Rate limit exceeded
Internal Server Error
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