---
title: "Init Oauth"
method: GET
path: "/api/v1/admin/vendors/oauth/init"
tags: ["admin-vendors"]
---

# Init Oauth

`GET /api/v1/admin/vendors/oauth/init`

Start the OAuth flow — redirect to Google's authorization screen.

Generates a single-use state token (uuid4 hex), stores
``{admin_id, env}`` in Redis under ``vendors_oauth_state:{state}`` with
a 10-minute TTL, then 302s to Google. The callback verifies + deletes
the state token on consumption.

``access_type=offline`` and ``prompt=consent`` are BOTH required so
Google always returns a refresh token (without prompt=consent, repeat
consents skip issuing one).

## Query parameters

- `env` 'staging' | 'prod', required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/prototyping/apis/prototyping-io-api.md) · [All operations](https://skmtc.dev/prototyping/apis/prototyping-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/prototyping/prototyping-io-api/revisions/f4a0079fbb57/schema)
