> For the complete documentation index, see [llms.txt](https://therootshive.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://therootshive.gitbook.io/docs/reference/authentication/generate-access-token.md).

# Generate Access Token

Authorize this API call by including Authorization header that contains the word 'Basic' followed by a space and a base64-encoded string 'appid:rhkey' i.e. 'Basic base64(appid:rhkey)'

## Authorize Calls

## This endpoint authorizes your API calls

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/auth`

#### Headers

| Name                                    | Type   | Description               |
| --------------------------------------- | ------ | ------------------------- |
| Basic<mark style="color:red;">\*</mark> | String | Basic base64(appid:rhkey) |

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

```json
{
    "status": "200",
    "logged": true,
    "data": {
        "authid": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2OTIyNjk0NTgsImlzcyI6ImFwaS50aGVyb290c2hpdmUuY29tIiwibmJmIjoxNjkyMjY5NDU4LCJleHAiOjE2OTIyNzMwNTgsInVzZXIiOiJteXJvb3RzaGl2ZUBnbWFpbC5jb20iLCJkYXRhIjp7InhwdWIxIjoiODl0YUlGYS9WSUZ0akdQbkFHT1M5VWZkMWU2c1FiNGZLblQrUnBZYjNKTElsTHJWNExNSEwvMGs4cnZzc3U5WitMUzR2Z0dJWFgvWEQ0NVpUUDlQMVE9PSIsInhwdWIyIjoiVmlNYXFNQkxHWUE3N1dobTVxZW9YWGw5a3dTcHFNdHVySEs3aCtGRDY0MD0iLCJ4cHViMyI6IkNFR1J4T0w3RkZxUlBjTEFrcWQ0NURzdytUbTdxb3EzbW5UMFpWRU50S2o0ZnlCcTd1TXJxVjU0UGd6WGxvaHoifX0.dPTCG_Gqhu906XCV1p0Xqr8ges85A5qHdfmxCjC5UvllNyvJK1Dh8-VQ6IKFd3nmSPS910VTruK9ARFB84fTrw"
    }
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

```json
{
    "status": "401",
    "logged": false,
    "data": {
        "message": "missing parameter"
    }
}

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** Rootshive's core security protocol is OAuth 2.0, which authenticates API requests via associated API keys that can be managed directly from the dashboard. Rootshive provides an APPID, that is used together with a secret key to generate a basic token and a secret key that should be kept confidential and stored exclusively on the user's servers. The secret API key provides unrestricted access to Monnify's API and authorizes all API calls. In case of any suspicion of compromise, the secret key can be reset from your Rootshive dashboard.
{% endhint %}
