---
title: "Google Oauth Callback"
method: GET
path: "/api/oauth/google/callback"
tags: ["oauth", "oauth"]
---

# Google Oauth Callback

`GET /api/oauth/google/callback`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/oauth/google/callback`
- Auth: none declared

Universal OAuth callback endpoint for Google services (Calendar, Gmail).

Google redirects here after user authorizes (or denies) access.
This endpoint:
1. Determines service type by checking Redis state prefixes
2. Exchanges the code for tokens
3. Creates/updates the channel_account
4. Saves OAuth tokens
5. Redirects to frontend with success/error status

Args:
    code: Authorization code from Google
    state: State token for CSRF protection
    error: Error code if user denied access
    error_description: Human-readable error description

Returns:
    Redirect to frontend integrations page with status

## Query parameters

- `code` string, nullable
- `state` string, nullable
- `error` string, nullable
- `error_description` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
