# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nftrainbow.xyz/about-the-apis/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
