Skip to content
Dark mode

Generate an access token

Exchanges a Call AI authorization code for a bearer access token and a refresh token.

Prerequisites

  1. Authentication: Client credentials and the authentication base URL from Mindtickle Support.
  2. Get an authorization code: The authorization code, which expires 10 minutes after it is issued.
POST /token

Base URL: the authentication base URL Mindtickle Support provides for issuing tokens.

Headers: Content-Type: application/json.

Parameter Type Required Description
client_id string Not specified Your unique client identifier.
client_secret string Not specified Your client secret.
grant_type string Required Must be set to authorization_code for this step.
code string Required The authorization code returned by the authorization grant call.
{
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET",
"grant_type": "authorization_code",
"code": "AUTHORIZATION_CODE"
}
Field Type Description
status number Status code in the response body. Check the HTTP status separately.
access_token string The bearer token to send with Call AI requests.
refresh_token string The token used to regenerate an access token.
token_type string The token type, Bearer.
expires_in Not specified Time until the access token expires. Confirm the value type and unit with Mindtickle Support before using this field to schedule token renewal.

Token values and EXPIRES_IN are placeholders. Do not infer the type or unit of expires_in from this example.

{
"status": 200,
"access_token": "ACCESS_TOKEN",
"refresh_token": "REFRESH_TOKEN",
"token_type": "Bearer",
"expires_in": "EXPIRES_IN"
}
  • Limits: access_token is valid for 1 day. refresh_token is valid for 365 days.
  • Expiration behavior: An expired token can appear as an authentication error inside the GraphQL errors array, even when the HTTP status is 200. Check the token-expiration error, then refresh the access token.