> ## Documentation Index
> Fetch the complete documentation index at: https://docs-openpay.nipuntheekshana.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refresh Token

> Exchange a refresh token for a new access token and refresh token pair

## Request Body

<ParamField body="refreshToken" type="string" required>
  The refresh token received from a previous login or token refresh.
</ParamField>

### Example Request

```json theme={null}
{
  "refreshToken": "rt_def456..."
}
```

### Example Response (200)

```json theme={null}
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "refreshToken": "rt_ghi789..."
}
```

<Note>
  The previous refresh token is invalidated after use. Always store the new refresh token returned in the response.
</Note>

### Error Responses

```json 401 Invalid Token theme={null}
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Refresh token is invalid or expired"
  }
}
```
