Enable Aiven for PostgreSQL® Data API Limited availability
Enable Data API to expose a database in your Aiven for PostgreSQL® service as REST endpoints.
Prerequisites
To enable Data API, you need the following:
- Limited availability access to Data API. To request access, contact Aiven.
- The
project:services:writepermission. If you don't have it, ask an admin to grant it. See Manage permissions. - An identity provider (IdP) that issues JWTs and publishes a JWKS URL over HTTPS. Auth0, Okta, and Microsoft Entra ID are common options.
Enable Data API for a database
- In the Aiven Console, open your Aiven for PostgreSQL service.
- Click Connect > Data API.
- In the Database list, select the database to expose.
- Click Set up API.
- In the Data API for [database] dialog, configure the following:
- Under Identity provider:
- JWKS URL: Enter the HTTPS URL where your IdP publishes its public keys.
- Audience (optional): Enter the API identifier configured in your IdP.
- If Aiven has a recommendation for this service, choose a deployment mode under
Settings:
- Recommended (default): Deploys the underlying Aiven Runtime application on the cheapest available paid plan, using the same cloud and region as your PostgreSQL service when possible, or the nearest available region otherwise.
- Custom: Configure your own cloud, region, and plan under Cloud and plan.
- Under Cloud and plan, shown when there's no recommendation or you choose
Custom:
- Cloud: Defaults to the same cloud and region as your PostgreSQL service. You can select a different cloud and region that supports the Aiven Runtime application. The picker only ever lists clouds and regions that Aiven Runtime actually supports.
- Plan: Select a plan for the Aiven Runtime application. Free-tier plans aren't available for Data API, so choose a paid plan.
- Under Identity provider:
- Review the Summary panel on the right, which shows the cloud, plan, and estimated monthly price for the Aiven Runtime application.
- Click Confirm and deploy.
If the cloud, region, and plan you select don't support the Aiven Runtime application, Data API shows an error message so that you can pick a different combination.
Data API starts deploying and the Status shows Deploying. When the app is healthy, the status changes to Running and the endpoints become available. While the service is still being provisioned, setup is unavailable and the Aiven Console shows Set up your data API with a note that the service is still being provisioned.
For details on the JWKS URL and audience fields, see Configure authentication.
Next steps
- Configure authentication and authorization for the Data API.
- Call the endpoints with code snippets.
- Manage your Data API, including exposing more databases and removing the API.