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

# Обновление токена

> Получить новый access token с помощью refresh token

<ParamField body="refresh_token" type="string" required>
  Refresh token, полученный при входе, регистрации или предыдущем обновлении.
</ParamField>

## Запрос

```bash theme={null}
curl -X POST https://elumenta.ru/api/v2/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{"refresh_token": "eyJhbGciOiJIUzI1NiJ9..."}'
```

## Ответ

```json theme={null}
{
  "access_token": "eyJhbGciOiJIUzI1NiJ9...",
  "refresh_token": "eyJhbGciOiJIUzI1NiJ9...",
  "token_type": "bearer"
}
```

Access токены истекают через **15 минут**. Refresh токены действительны **30 дней** и ротируются при каждом использовании — всегда сохраняйте последний.

## Ошибки

| Код   | Значение                               |
| ----- | -------------------------------------- |
| `401` | Refresh token истёк или недействителен |
