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

# Refresh Token

> Renova o access token usando o refresh token

## Descricao

Gera um novo `accessToken` e `refreshToken` a partir do refresh token atual. O token anterior e invalidado (rotacao).

## Request

<ParamField body="refreshToken" type="string" required>
  UUID v4 do refresh token obtido no login ou no ultimo refresh.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.thalbank.com/auth/refresh \
    -H "Content-Type: application/json" \
    -d '{
      "refreshToken": "550e8400-e29b-41d4-a716-446655440000"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...(novo)",
    "refreshToken": "660e8400-e29b-41d4-a716-446655440001"
  }
  ```

  ```json 401 theme={null}
  {
    "statusCode": 401,
    "message": "Invalid or expired refresh token",
    "error": "Unauthorized"
  }
  ```
</ResponseExample>
