Link Google Calendar from sign-in tokens (unified auth)
Store a Google calendar connection from tokens already obtained by the app's sign-in grant (unified auth: one Google consent covers identity and calendar). The connection and the selected primary calendar are set to the token's own account, replacing any stale selection — which is what makes a wrong-account attach impossible. JWT user session only (an API key can't represent a user's Google grant). Stores for the authenticated user.
Auth required: Yes
access_token: string (required) — Google access token from the sign-in sessionrefresh_token: string — Google refresh token, if re-issued (omit to preserve a stored one)expires_in: integer — Seconds until the access token expires (default 3600)201: Calendar linked400: Validation error401: Authentication required or invalid403: A user session is required (API keys cannot link a calendar).422: The token lacks `calendar.events` (can list calendars but not read events) —
e.g. an existing user's cached grant. Nothing was stored. The client should
re-run sign-in with `prompt=consent` to obtain the scope.
Requires authentication. Pass a Bearer token (Supabase JWT) or an API key (`Authorization: Bearer vennio_sk_live_*`) in the request headers.
Base URL: https://api.vennio.app