# Refresh token

POST `/refresh-token`

This endpoint lets you to refresh your API Key and Refresh Token by providing a valid Refresh Token.

**Headers**

No headers required.

**Request body**

| Parameter      | Type   | Description                                                                |
| -------------- | ------ | -------------------------------------------------------------------------- |
| `refreshToken` | string | The refresh token to validate and retrive a new API key and refresh token. |

**Response**

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

```json
{
  "status": "success",
    "data": {
        "apiKey": "e0dc59c5c2ac26aecae421318076efa420c219898fdaedd7cb6a8571b8043d10",
        "refreshToken": "030ed091334a11efb97d8829d1a28493a20379d22c759eb1528d37f43b9a374d76970395aa473cf4",
        "expiresAt": "2025-01-27T12:57:00.802Z"
    }
}
```

{% endtab %}

{% tab title="400 (invalid refresh token)" %}

```json
{
 "status": "error",
 "message": "Invalid refresh token"
}
```

{% endtab %}

{% tab title="400 (no refresh token)" %}

```json
{
 "status": "error",
 "message": "Refresh token is required"
}
```

{% endtab %}
{% endtabs %}


---

# 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.searchagora.com/basics/refresh-token.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.
