---
title: "Google Login"
method: GET
path: "/api/v1/auth/google/login"
tags: ["authentication", "authentication", "google-oauth2"]
---

# Google Login

`GET /api/v1/auth/google/login`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/auth/google/login`
- Auth: none declared

Initiate Google OAuth2 login flow.

Generates OAuth2 authorization URL with CSRF state token.

Args:
    redirect_uri: Optional custom redirect URI (defaults to configured URI)
    return_to: If provided, auto-redirects browser to Google (for iOS/browser users)
    invite: Optional closed-beta invite token (#1581). Its hash is bound to
        this flow's state for the signup gate; malformed values are ignored.
    accepted_terms: The terms version the person agreed to on the sign-in
        page (#1665). Bound to this flow's state; ignored while
        ``TERMS_VERSION`` is empty.
    link_proof: This sign-in proves the account for an identity link
        (#1818): Google is asked for ``auth_time``, and the callback
        records it from the verified ID token. Ordinary sign-ins send the
        same request as before.

Returns:
    If return_to: RedirectResponse to Google OAuth (browser user)
    Otherwise: JSON {authorization_url, state} (API client)

Example:
    GET /api/v1/auth/google/login (API client)
    Response: {"authorization_url": "...", "state": "..."}

    GET /api/v1/auth/google/login?return_to=... (browser user)
    Response: 303 Redirect to Google OAuth

Note:
    Frontend should redirect user to authorization_url.
    State token is stored in Redis for CSRF validation.

## Query parameters

- `redirect_uri` string, nullable
- `return_to` string, nullable
- `add_account` boolean
- `invite` string, nullable
- `accepted_terms` string, nullable
- `link_proof` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
