---
title: "delete_application"
description: "Generated reference for the management action delete_application: its description, access metadata, payload contract, and registration status."
slug: /reference/actions/delete-application
order: 23
visibility: public
redirects_from: []
---

# delete\_application

Generated automatically from the [published contract sources](/cloud/reference/about/#contract-sources).

A script calls this action over HTTPS at `POST https://tzcloud.dev.turnzero.ai/v1/delete_application`, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool `tzcloud_delete_application`.

OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts ([Sign-in, sessions, and tokens](/cloud/concepts/sign-in-sessions-and-tokens/)).

**Build metadata:** Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.

## Contract description

Delete the application in every environment\. This removes its code, image repository, published assets, custom domain and schedules\. It deletes databases, end\-user realms, application secrets, upstreams, app credentials and tokens, transfer grants, and bound areas and files\. The app's own issue spaces and records are deleted\. The account's issue spaces keep their records\. Deletion removes the app's links to them\. Account secrets and usage records stay\. The label is retired\. Deletion keeps the hostname claimed until the custom domain detaches\. The platform offers no way to undo deletion\. Use `delete_environment` or `clear_development_database` for development alone\. For production data, use app routes or a migration applied by a deploy\.

Use a signed\-in session or a token with `destructive`\. Give the owner `approval_url` for browser approval before deletion starts\. Read `read_approval_status` for a receipt for each kind\. A lock returns `delete_locked` with `delete_lock`\.

## More about this action

Give this deletion a `request_id`\. If the reply is lost and you have the pending action ID, read `read_approval_status` and check the target's current state\. A repeat with the same `request_id` from the same account returns the existing pending action while it is requested, approved, or executing\. Once the action ends, the same `request_id` starts a new request\.

A failed deletion leaves earlier removals in place\. Request fresh browser approval only if you still intend to finish the deletion\. Completed members report zero removals\. Report a repeated failure with its reference\. A deletion holds a five\-minute lease; on `deletion_in_progress`, wait until the instant in its detail before requesting again\. If the estate changes before approval, `description_changed` declines the request: request again for approval of the current description\.

A standing lock refuses with `delete_locked`\. If teardown meets the lock, the pending action fails with that error\. When a lock is set after the request and before approval, the pending action is declined with `description_changed`\. Use `lift_application_delete_lock` and complete browser approval for the lift\. Request a separate approval for deletion\.

## Access and action metadata

```json
{
  "name": "delete_application",
  "resource": "application",
  "tier": "destructive",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "clients": [
    "bearer",
    "browser_session"
  ],
  "summary": "Delete the application and everything provisioned for it. A deletion lock refuses the request with `delete_locked` and gives the lock in `delete_lock`.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": true
  }
}
```

## MCP catalog entry

```json
{
  "name": "delete_application",
  "title": "Delete application",
  "tier": "destructive",
  "scenario": "CHI-L0-10",
  "summary": "Delete the application in every environment. This removes its code, image repository, published assets, custom domain and schedules. It deletes databases, end-user realms, application secrets, upstreams, app credentials and tokens, transfer grants, and bound areas and files. The app's own issue spaces and records are deleted. The account's issue spaces keep their records. Deletion removes the app's links to them. Account secrets and usage records stay. The label is retired. Deletion keeps the hostname claimed until the custom domain detaches. The platform offers no way to undo deletion. Use `delete_environment` or `clear_development_database` for development alone. For production data, use app routes or a migration applied by a deploy.\n\nUse a signed-in session or a token with `destructive`. Give the owner `approval_url` for browser approval before deletion starts. Read `read_approval_status` for a receipt for each kind. A lock returns `delete_locked` with `delete_lock`.",
  "owners": [
    "MAPI-05"
  ]
}
```

## request

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["application"\] |
| /<wbr>properties/<wbr>application | Your account's application `id` from `list_applications`, not its name or label\.<br><br>Type: string |
| /<wbr>properties/<wbr>request\_id | Any string you choose\. A repeat from the same account while that pending action is live returns it again, creating no second one\. Omitted, every call creates a new one\.<br><br>Type: string |

## response

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | The 202 creation envelope: the pending action and its approval link\. Read the terminal outcome on the pending record with read\_approval\_status\. On a failed walk the outcome carries `receipts`, one receipt per kind for the members that ran before the failing member, beside `execution_failed`; a retry of the deletion runs the walk again, and a member already run returns zero removals\.<br><br>Type: object<br>Required fields: \["contract\_version","pending\_action","approval\_url"\] |
| /<wbr>properties/<wbr>contract\_version | Required value: 1 |
| /<wbr>properties/<wbr>reference | The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row\. Quote it when you report the call\.<br><br>Type: string<br>Pattern: ^\[0\-9a\-f\]\{10\}$ |
| /<wbr>properties/<wbr>pending\_action | $ref: \#/shapes/pending\_action |
| /<wbr>properties/<wbr>approval\_url | Type: string |
| /<wbr>properties/<wbr>detail | Type: string |

## Complete payload contract

```json
{
  "request": {
    "type": "object",
    "required": [
      "application"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "Your account's application `id` from `list_applications`, not its name or label."
      },
      "request_id": {
        "type": "string",
        "description": "Any string you choose. A repeat from the same account while that pending action is live returns it again, creating no second one. Omitted, every call creates a new one."
      }
    }
  },
  "response": {
    "type": "object",
    "description": "The 202 creation envelope: the pending action and its approval link. Read the terminal outcome on the pending record with read_approval_status (API-L0-07). On a failed walk the outcome carries `receipts`, one receipt per kind for the members that ran before the failing member, beside `execution_failed`; a retry of the deletion runs the walk again, and a member already run returns zero removals (PLD-L0-66).",
    "required": [
      "contract_version",
      "pending_action",
      "approval_url"
    ],
    "properties": {
      "contract_version": {
        "const": 1
      },
      "reference": {
        "type": "string",
        "pattern": "^[0-9a-f]{10}$",
        "description": "The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row. Quote it when you report the call."
      },
      "pending_action": {
        "$ref": "#/shapes/pending_action"
      },
      "approval_url": {
        "type": "string"
      },
      "detail": {
        "type": "string"
      }
    }
  }
}
```

## Shared contracts

- [Refusals](/cloud/reference/refusals/): every refusal, by surface, with its cause and its remedy
- [schemas/wire\_error\.schema\.json](/cloud/reference/sources/schemas/wire-error-schema/)
- [schemas/wire\_errors\.json](/cloud/reference/sources/schemas/wire-errors/)
- [schemas/action\_payloads\.json](/cloud/reference/sources/schemas/action-payloads/) (includes shared shapes)
- [management\_api\_contract\.md](/cloud/reference/sources/management-api-contract/)
