---
title: "Delete project"
method: DELETE
path: "/v1/projects/{project_id}"
tags: ["Projects"]
---

# Delete project

`DELETE /v1/projects/{project_id}`

## Request

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

Durable owner-only deletion of Agentry-owned control-plane state. Requires a stable Idempotency-Key, fences new local mutations, and returns bounded 202 progress while cleanup completes. Agentry detaches or best-effort revokes its local PostHog OAuth connection; it never deletes or mutates the customer's PostHog project or telemetry. Exact retries recover the same terminal receipt.

## Path parameters

- `project_id` string, required

## Headers

- `Idempotency-Key` string, required

## Response `200`

OK

- DeleteProjectResponse
  - `id` string, required
  - `command_id` string, required
  - `status` 'in_progress' | 'succeeded', required
  - `deleted` boolean, required
  - `project_name` string
  - `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
  - `next_action` string, required

## Other responses

- `202`: Bounded local cleanup or a pre-fence external operation remains; retry the exact DELETE with the same key at retry_after_seconds
- `409`: Deletion conflict. project_deletion_terminal_audit_conflict is terminal and non-retryable: the project is preserved, the caller must stop retrying, and an operator must reconcile the exact command and immutable audit ids.
- `428`: Stable Idempotency-Key required for an authorized first attempt
- `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)
