---
title: "Start one-click PostHog sign-in and read-only project authorization"
method: POST
path: "/v1/auth/posthog"
tags: ["Auth"]
---

# Start one-click PostHog sign-in and read-only project authorization

`POST /v1/auth/posthog`

## Request

- Base URL: `https://api.agentry.sh`
- URL: `https://api.agentry.sh/v1/auth/posthog`
- Auth: none declared

Creates one short-lived PostHog Cloud OIDC + read-only project consent transaction bound to the initiating CLI's ephemeral 127.0.0.1 callback. The opaque poll token, loopback ticket, and verifier are local secrets; PostHog access and refresh tokens never leave the hosted control plane.

## Request body

- object
  - `region` 'us' | 'eu', required
  - `client_name` string: Optional agent or client name used for bounded attribution.
  - `distribution_surface` string: Optional coarse acquisition source such as codex_skill or cli.
  - `handoff_redirect_uri` string, required: Ephemeral callback created by the interactive CLI on this computer. Only exact 127.0.0.1 callbacks are accepted.
  - `handoff_challenge` string, required: SHA-256 base64url challenge binding the callback ticket to the initiating CLI.

## Response `200`

OK

- PosthogAuthStartResponse
  - `authorization_url` string, required
  - `poll_token` string, required
  - `expires_in` integer, required
  - `interval` integer, required
  - `next_action` string, required

## Other responses

- `default`: Error

---

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