Skip to main content
All CollectionsData API
API Authentication
API Authentication
Updated over a week ago

Generate API Credentials

  1. Go to Settings β†’ API Tokens.

  2. Click "Generate Token"

  3. Give it a description, and choose Data API User as the role.

  4. Click Create and copy aside the Client ID and Secret.

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.

Did this answer your question?