> For the complete documentation index, see [llms.txt](https://docs.nftrainbow.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nftrainbow.xyz/about-the-apis/authentication.md).

# Authentication

All the open APIs use a single authentication scheme: a Bearer JWT passed in the HTTP request header.

To obtain the access to [open APIs](/api-reference/open-api.md), users have to do the following:

1. Use `app_id` and `app_secret` to call [login](/api-reference/open-api/login.md#login) to get the JWT.
2. Add the `Authorization: Bearer {JWT}` in the request header to call the corresponding API. The corresponding example can refer to [sample](/api-reference/open-api/login.md#request-sample).

{% hint style="info" %}
**Note:** `app_id` and `app_secret` are obtained from Rainbow Console.
{% endhint %}

The Bearer JWT is valid for one hour to call [open APIs](/api-reference/open-api.md). Once the token is expired for one hour, users have to call [Refersh JWT](/api-reference/open-api/login.md#refresh_token) to obtain a new JWT. The corresponding example can refer to [sample](/api-reference/open-api/login.md#request-sample-1).

{% hint style="info" %}
**Note:** Bearer JWT is valid for five hours to call [Refersh JWT](/api-reference/open-api/login.md#refresh_token). Once the token is expired for five hours, users have to call [login](/api-reference/open-api/login.md#login) again.
{% endhint %}

To debug various error codes related to authentication, please see[ Error codes.](/about-the-apis/error-codes.md)
