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

# Google OAuth

> Вход или регистрация через аккаунт Google

<ParamField body="id_token" type="string" required>
  Google ID token, полученный от Google OAuth на клиенте.
</ParamField>

## Процесс

1. Клиент запускает Google Sign-In и получает `id_token`
2. Отправьте `id_token` на этот endpoint
3. Elumenta проверяет его через Google, создаёт или авторизует пользователя
4. Возвращает ту же JWT-пару, что и [Login](/ru/api-reference/auth/login)

## Запрос

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

## Ответ

```json theme={null}
{
  "access_token": "eyJhbGciOiJIUzI1NiJ9...",
  "refresh_token": "eyJhbGciOiJIUzI1NiJ9...",
  "token_type": "bearer",
  "is_new_user": false,
  "user": {
    "id": 12345,
    "email": "user@gmail.com",
    "plan": "free",
    "token_balance": 50
  }
}
```
