---
title: "Detach the PostHog OAuth connection"
method: DELETE
path: "/v1/projects/{project_id}/posthog-connection"
tags: ["PostHog Connection"]
---

# Detach the PostHog OAuth connection

`DELETE /v1/projects/{project_id}/posthog-connection`

## Request

- Base URL: `https://api.agentry.sh`
- URL: `https://api.agentry.sh/v1/projects/{project_id}/posthog-connection`
- Auth: HTTP bearer

Owner-only detach/revoke. Agentry destroys its local OAuth ciphertext and best-effort revokes provider tokens. It never deletes, mutates, or otherwise affects customer-owned PostHog data.

## Path parameters

- `project_id` string, required

## Response `200`

OK

- object
  - `connection` object, required
    - `status` 'detached' | 'active' | 'reauth_required', required
    - `region` 'us' | 'eu', nullable, required
    - `posthog_host` string, nullable, required
    - `posthog_project_id` integer, nullable, required
    - `organization_id` string, nullable, required
    - `scopes` string[], required
    - `connected_at` integer, nullable, required
    - `last_verified_at` integer, nullable, required
    - `capabilities` object, nullable, required
    - `next_action` string, nullable, required
  - `revocation_confirmed` boolean, nullable, required
  - `customer_posthog_data_affected` false, required
  - `next_action` string, nullable, 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)
