---
title: "Google Login"
method: POST
path: "/api/v1/auth/google"
tags: ["api", "api", "auth"]
---

# Google Login

`POST /api/v1/auth/google`

## Request

- Base URL: `https://www.faroz.uz` (the document declares no server; this is the origin it was published from)
- URL: `https://www.faroz.uz/api/v1/auth/google`
- Auth: none declared

Google Sign-In orqali tizimga kiradi yoki yangi hisob yaratadi.

Frontend Google SDK dan olingan id_token ni yuboradi.
Backend uni Google serverlarida tasdiqlaydi.

Uch holat:
- Google ID mavjud → kirish
- Email mavjud, Google ID yo'q → Google ulanadi va kirish
- Yangi foydalanuvchi → hisob yaratiladi va kirish

## Request body

- GoogleLoginRequest: Google Sign-In so'rovi. Frontend Google SDK orqali olingan id_token ni shu yerga yuboradi. Backend tokenni Google serverlarida tasdiqlaydi. Misol: POST /api/v1/auth/google {"id_token": "eyJhbGci..."}
  - `id_token` string, required

## Response `200`

Successful Response

- TokenResponse: Token javob modeli — register, login, refresh va google login da qaytariladi.
  - `access_token` string, required
  - `refresh_token` string, required
  - `token_type` string

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/faroz/apis/edu-app-api.md) · [All operations](https://skmtc.dev/faroz/apis/edu-app-api/llms.txt) · [OpenAPI document](https://skmtc.dev/faroz/apis/edu-app-api/revisions/414a551ba773?raw)
