Generate API Credentials
Go to
Settings
βAPI Tokens
.Click "Generate Token"
Give it a description, and choose
Data API User
as the role.Click
Create
and copy aside theClient ID
andSecret
.
Important: The API credentials are secrets. Make sure you protect them well.
Generate API Token
Base URLs
EU region:
https://auth.app.coho.ai
US region:
https://auth.app.us.coho.ai
Endpoint
POST /identity/resources/auth/v2/api-token
Body
{
"clientId": "<your client id>",
"secret": "<your secret>"
}
Response
Successful Response
Status Code: 200 OK
Response Body:
The response body contains the following JSON structure:
{
"access_token": string, // Your API token
"refresh_token": string, // Your refresh token
"expires_in": number, // Seconds until expiration
"expires": string // Expiration time (human readable)
}
Error Responses
Status Code: 401 Unauthorized
Description: The API key is missing or invalid.
{
"error": "Unauthorized",
"message": "Invalid API key"
}
Exchange Refresh Token
Base URLs
EU region:
https://auth.app.coho.ai
US region:
https://auth.app.us.coho.ai
Endpoint
POST /identity/resources/auth/v2/api-token/token/refresh
Body
{
"refreshToken": "<your refresh token>"
}
Response
Successful Response
Status Code: 200 OK
Response Body:
The response body contains the same JSON structure, as the "Generate API Token" request.