# Generate Access Token

{% hint style="warning" %}
Validity of the auth token is 60min ,post that we need to recall the API for fresh auth token value.
{% endhint %}

{% hint style="success" %}
Replace the `{{BaseURL}}` with the one mentioned [here ](https://docs.truecaller.com/truecaller-for-business/verified-campaigns/api-webhook-documentation/webhook-connectors)
{% endhint %}

<mark style="color:green;">`POST`</mark> `{{BaseURL}/organisations/{organisationid}/campaigns/token`&#x20;

{% hint style="success" %}
{organisationid}: This can be taken directly from the self serve portal under the API Setup Page&#x20;
{% endhint %}

<figure><img src="https://524139107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnvD14ounFJ30uTgr4F8f%2Fuploads%2FZkzglGhvzVVEPv5w1bxs%2FCamapign%20Org%20Id.gif?alt=media&#x26;token=e91f99d5-357c-455f-8115-db5c70eb8110" alt=""><figcaption></figcaption></figure>

**Headers**

| Name            | Value | Description |
| --------------- | ----- | ----------- |
| X-Public-Access | allow | Required    |

**Body**

| Name     | Type   | Description                                         |
| -------- | ------ | --------------------------------------------------- |
| api\_key | string | <p>Required<br>API key from the API Set up Page</p> |
| key\_id  | string | <p>Required<br>Key ID from the API Setup Page</p>   |

<figure><img src="https://524139107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnvD14ounFJ30uTgr4F8f%2Fuploads%2FhXO6N2rLBTtrPddWWwMO%2FVerified%20CampaignAPIKey.gif?alt=media&#x26;token=8f5cfd28-14ba-4806-9040-4137ea50915c" alt=""><figcaption></figcaption></figure>

#### Request

{% tabs %}
{% tab title="JSON" %}

```json
{
    "api_key": "9325a824-8a9b-4684-99d3-33c10b8ae1d3",
    "key_id": "ad1c032c-2856-4cf8-9b1f-20b555b610d7"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "token": "a4p0sTtfFbsSfRlm4_CazHEbv0guHq4u0tID1TTe4CX4KIu_20BMgI0Bc7qXdmr7",
    "created_at": "2025-08-19T06:27:31.193Z"
}
```

{% endtab %}

{% tab title="401 Unauthorized" %}

```json
{
    "slug": "authorization-error",
    "message": "Missing authorization header"
}
```

{% endtab %}
{% endtabs %}
