---
title: "Get an authorization code"
description: "Returns a temporary authorization code that you exchange for a Call AI access token."
contentType: "api-reference"
url: "https://developer.mindtickle.com/docs/call-ai/authentication/get-an-authorization-code/"
---

## Prerequisites

1. [Authentication](/docs/call-ai/authentication/): Client credentials, tenant details, and the authentication base URL from Mindtickle Support.

## Endpoint

```http
POST /get-authorisation-grant
```

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

Headers: `Content-Type: application/json`.

## Request

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `client_id` | string | Not specified | Your unique client identifier. |
| `user_id` | string | Not specified | The user authorized to make requests. |
| `tenant_id` | string | Not specified | Your tenant identifier. |

### Request example

```json
{
  "client_id": "CLIENT_ID",
  "user_id": "USER_ID",
  "tenant_id": "TENANT_ID"
}
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `status` | number | Status code in the response body. Check the HTTP status separately. |
| `grant_type` | string | The grant type of the code returned, `authorization_code`. |
| `code` | string | The authorization code to exchange for an access token. |

### Response example

```json
{
  "status": 200,
  "grant_type": "authorization_code",
  "code": "AUTHORIZATION_CODE"
}
```

## Notes

- **Limits:** The code in the response expires in 10 minutes. Use it immediately to generate an access token.
- **Behavior:** Run this request once per client during initial setup. If the refresh token expires, restart this step as described in [Refresh an access token](/docs/call-ai/authentication/refresh-an-access-token/).

## Related

- [Generate an access token](/docs/call-ai/authentication/generate-an-access-token/): Exchange the authorization code for an access token.
