Authentication
The Aive API uses the OAuth2 Client Credentials Flow to authenticate API-to-API communication.
This authentication method is available for the public GraphQL API.
For more information about the OAuth2 Client Credentials Flow, see the official OAuth 2.0 specification.
Only users with the Manage API Credentials permission in a workspace can create OAuth2 clients and generate API credentials.
Create an OAuth2 client
To create an OAuth2 client:
- Sign in to app.aive.com using your account credentials.
- Go to Profile → Manage API clients.
- Click New API client.
- Fill in the required information and create the client.
The generated client provides:
client_id: the identifier of your OAuth2 client.client_secret: the secret used to authenticate your client.
You can also configure the access token validity duration. This defines how long generated access tokens remain valid.
Since access tokens are sent over the network with each API request, we recommend setting a short expiration time (for example, 10 minutes) to reduce security risks.
Generate an access token
To authenticate API requests, you must first generate an access token using your client_id and client_secret.
Request an access token:
curl --request POST \
--url https://hydra.aive.com/oauth2/token \
--header 'content-type: application/x-www-form-urlencoded' \
--data client_id=<client_id> \
--data client_secret=<client_secret> \
--data grant_type=client_credentialsThe response contains your access token:
{
"access_token": "<access_token>",
"token_type": "bearer",
"expires_in": 1800
}Use the access token
All requests to the public GraphQL API are POST requests to a single endpoint:
https://graphql.aive.com/graphqlInclude the access token in the Authorization header for every API request:
Authorization: Bearer <access_token>Example GraphQL request:
curl --request POST \
--url https://graphql.aive.com/graphql \
--header "Authorization: Bearer <access_token>" \
--header "Content-Type: application/json" \
--data '{"query":"query { viewer { id } }"}'Refresh an access token
OAuth2 Client Credentials Flow does not use refresh tokens.
When an access token expires, generate a new one by repeating the access token generation request using your client_id and client_secret.
For security reasons, avoid storing access tokens permanently. Generate them when needed and replace expired tokens.
Next steps
- Upload a container to start integrating media into Aive.
- Event handling explains how to track asynchronous operations.
- Error handling explains how mutations report failures.

