---
title: "Delete authenticated user account"
method: POST
path: "/v1/auth/self_delete"
tags: ["Auth"]
---

# Delete authenticated user account

`POST /v1/auth/self_delete`

## Request

- Base URL: `https://api.agentry.sh`
- URL: `https://api.agentry.sh/v1/auth/self_delete`
- Auth: HTTP bearer

Requires confirm=DELETE_AGENTRY_ACCOUNT and a stable Idempotency-Key. Before admission it rejects active or unresolved Stripe billing; the same transaction installs an account checkout fence. Finalization removes Agentry-owned account/project state and detaches or best-effort revokes local PostHog OAuth connections. It never deletes or mutates customer-owned PostHog data. It returns 202 while bounded local cleanup is active and 409 when billing remediation is required. Its surviving hash-only tombstone lets an exact retry recover only the terminal manifest after account authority is revoked.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `confirm` 'DELETE_AGENTRY_ACCOUNT', required: Acknowledges deletion of Agentry-owned account and project state. Customer-owned PostHog data is untouched.

## Response `200`

OK

- object
  - `status` 'deleted', required
  - `command_id` string, required
  - `user_id` string, required
  - `cascaded` object, required
  - `cleanup` object, required
    - `automation_deletion_manifest` AutomationDeletionManifest, required
      - `as_of` integer, required
      - `project_ids` string[], required
      - `sample_limit` 20, required
      - `counts` object, required
        - `enabled_contracts` integer, required
        - `enabled_schedules` integer, required
        - `active_runner_credentials` integer, required
        - `ready_or_claimed_receipts` integer, required
        - `nonterminal_runs` integer, required
        - `active_claims` integer, required
        - `pending_approvals` integer, required
        - `issued_or_consumed_draft_pr_grants` integer, required
        - `known_pr_identifiers` integer, required
        - `known_pr_proof_identifiers` integer, required
        - `known_deploy_identifiers` integer, required
        - `known_external_effects` integer, required
        - `possible_or_unknown_external_effects` integer, required
      - `samples` object[], required
        - `project_id` string, required
        - `kind` 'enabled_contract' | 'enabled_schedule' | 'active_runner_credential' | 'ready_or_claimed_receipt' | 'nonterminal_run' | 'active_claim' | 'pending_approval' | 'draft_pr_grant' | 'known_run_effect' | 'known_deploy', required
        - `id` string, required
        - `automation_id` string, nullable, required
        - `run_id` string, nullable, required
        - `status` string, required
        - `external_effect_state` 'none_known' | 'known' | 'possible_or_unknown', required
        - `recorded_at` integer, nullable, required
        - `pr_url` string
        - `pr_proof_hash` string
        - `deploy_id` string
        - `deploy_sha` string
        - `provider_ref` string
      - `samples_truncated` boolean, required
      - `external_follow_up` object, required
        - `required` boolean, required
        - `provider_state_reversible_by_agentry` false, required
        - `actions` string[], required
        - `note` string, required
  - `idempotent_replay` boolean
  - `receipt_recovery` object
  - `note` string
  - `next_action` string

## Other responses

- `202`: Bounded Agentry-owned cleanup remains active; retry at retry_after_seconds with the same key and credential. Customer-owned PostHog data remains untouched
- `409`: Deletion was not admitted or cannot finalize because a billing mutation is unresolved or Stripe billing can still charge; follow error.details.billing.next_action, then retry with the same deletion key
- `428`: Stable Idempotency-Key required after confirmation validates
- `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)
