---
title: "Google Auth"
method: POST
path: "/auth/google"
tags: ["internal"]
---

# Google Auth

`POST /auth/google`

## Request

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

Authenticate or register with Google.

Accepts a Google ID token credential. If the email matches an existing account,
the Google identity is linked. If no account exists, a new one is created.

Returns requires_2fa=true if the linked account has 2FA enabled.

## Query parameters

- `locale` string: Locale for new users

## Request body

- GoogleAuthRequest: Request to authenticate via Google.
  - `credential` string, required
  - `marketing_consent` boolean, nullable
  - `partner_code` string, nullable

## Response `200`

Successful Response

- GoogleAuthResponse: Response from Google OAuth login.
  - `requires_2fa` boolean
  - `temp_token` string, nullable
  - `access_token` string, nullable
  - `token_type` string
  - `is_new_user` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/companydata/apis/companydata-dk-api.md) · [All operations](https://skmtc.dev/companydata/apis/companydata-dk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/companydata/apis/companydata-dk-api/revisions/1cc6c361ae64?raw)
