Skip to main content
The Aiven API provides programmatic access to the Aiven platform, allowing you to automate service management, integrate with existing systems, and build custom workflows.

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:
  1. Click your user icon and select Tokens
  2. Click Generate token
  3. Provide a description and click Generate
  4. 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:
  1. Fork the Postman collection and environment
  2. Add your token to the authToken variable in the environment
  3. Send requests to explore the API
3

Make your first API call

Test authentication by listing your projects:
curl -H "Authorization: aivenv1 YOUR_TOKEN" \
  https://api.aiven.io/v1/project

Authentication

All API requests require authentication using a bearer token in the Authorization header:
Authorization: aivenv1 YOUR_TOKEN
curl -H "Authorization: aivenv1 YOUR_TOKEN" \
  https://api.aiven.io/v1/project

Common API operations

List projects

Retrieve all projects you have access to:
curl -H "Authorization: aivenv1 YOUR_TOKEN" \
  https://api.aiven.io/v1/project

List cloud regions

Get available cloud regions (no authentication required):
curl https://api.aiven.io/v1/clouds

Create a service

Create a new PostgreSQL service:
curl -X POST \
  -H "Authorization: aivenv1 YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "cloud": "google-europe-north1",
    "plan": "startup-4",
    "service_name": "my-postgres",
    "service_type": "pg"
  }' \
  https://api.aiven.io/v1/project/PROJECT_NAME/service

Get service details

Retrieve information about a specific service:
curl -H "Authorization: aivenv1 YOUR_TOKEN" \
  https://api.aiven.io/v1/project/PROJECT_NAME/service/SERVICE_NAME

Update a service

Modify service configuration (e.g., scale to a different plan):
curl -X PUT \
  -H "Authorization: aivenv1 YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "plan": "business-4"
  }' \
  https://api.aiven.io/v1/project/PROJECT_NAME/service/SERVICE_NAME

Delete a service

Permanently delete a service:
This operation is irreversible. All data will be permanently deleted.
curl -X DELETE \
  -H "Authorization: aivenv1 YOUR_TOKEN" \
  https://api.aiven.io/v1/project/PROJECT_NAME/service/SERVICE_NAME

API resources

Projects

/v1/project
GET
List all projects
/v1/project/{project}
GET
Get project details

Services

/v1/project/{project}/service
GET
List services in a project
/v1/project/{project}/service
POST
Create a new service
/v1/project/{project}/service/{service}
GET
Get service details
/v1/project/{project}/service/{service}
PUT
Update service configuration
/v1/project/{project}/service/{service}
DELETE
Delete a service

Service-specific operations

/v1/project/{project}/service/{service}/database
GET/POST
Manage databases (PostgreSQL, MySQL)
/v1/project/{project}/service/{service}/user
GET/POST
Manage service users
/v1/project/{project}/service/{service}/topic
GET/POST
Manage Kafka topics
/v1/project/{project}/service/{service}/acl
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:
200
Success
Request completed successfully
400
Bad Request
Invalid request parameters
401
Unauthorized
Invalid or missing authentication token
403
Forbidden
Insufficient permissions
404
Not Found
Resource not found
429
Too Many Requests
Rate limit exceeded
500
Internal Server Error
Server error - retry with exponential backoff
Error responses include details:
{
  "errors": [
    {
      "message": "Service 'non-existent' does not exist",
      "status": 404
    }
  ]
}

Best practices

  • Store tokens in environment variables or secret managers
  • Never commit tokens to version control
  • Rotate tokens regularly
  • Use separate tokens for different applications
  • Implement retry logic with exponential backoff
  • Handle rate limiting gracefully
  • Log errors for debugging
  • Validate responses before processing
  • 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:

Build docs developers (and LLMs) love