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

# set\_application\_delete\_lock

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

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

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

Lock your application against deletion\. Give a short reason\. The call needs no browser approval\. An existing lock keeps its reason and set time\.

## More about this action

Pass `application`, the ID of an application on your account\. A token scoped to one application can lock only that application\. Give `reason` as one nonblank line of 1 to 200 characters with no control or Unicode format characters\. Leave personal details out of it\. Call `read_status` or `list_applications` to read the current lock\. Applications on synthetic accounts cannot take a lock\.

While the application is locked, `delete_application` refuses with `delete_locked`\. Use `lift_application_delete_lock` to request removal of the lock and give the account owner the browser approval link\. A `delete_application` request takes a separate approval\.

The lock also blocks an account deletion or a development purge that would delete this application\. Deploys, setting changes and moves continue\. The lock moves with the application\.

The call returns HTTP 200 with `application`, `delete_lock`, `changed` and `detail`\. A new lock returns `changed: true`\. If the application is already locked, the call returns the existing lock with `changed: false` and leaves its reason and set time as they were\.

## Access and action metadata

```json
{
  "name": "set_application_delete_lock",
  "resource": "application",
  "tier": "reversible",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "clients": [
    "bearer",
    "browser_session"
  ],
  "summary": "Lock the application against deletion and record a reason. No browser approval is needed. A repeat returns the existing lock without changing it.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "openWorldHint": false,
    "idempotentHint": true
  }
}
```

## MCP catalog entry

```json
{
  "name": "set_application_delete_lock",
  "title": "Add application deletion lock",
  "tier": "reversible",
  "scenario": "CHI-L0-04",
  "summary": "Lock your application against deletion. Give a short reason. The call needs no browser approval. An existing lock keeps its reason and set time.",
  "owners": [
    "ACB-L0-110"
  ]
}
```

## request

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["application","reason"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>application | The application ID from `list_applications`\.<br><br>Type: string |
| /<wbr>properties/<wbr>reason | Give the reason for locking the application in one nonblank line of 1 to 200 characters\. Leave out control characters, Unicode format characters such as zero\-width characters, and personal details\. The reason is visible in application reads and on the lift approval page\.<br><br>Type: string<br>Minimum length: 1<br>Maximum length: 200 |

## response

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | The application's deletion lock after this call\.<br><br>Type: object<br>Required fields: \["contract\_version","application","delete\_lock","changed","detail"\] |
| /<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>application | The ID of the application whose lock this call sets or returns\.<br><br>Type: string |
| /<wbr>properties/<wbr>delete\_lock | The lock set by this call or the existing lock if the application was already locked\.<br><br>Type: object<br>Required fields: \["reason","set\_at"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>delete\_lock/<wbr>properties/<wbr>reason | The reason given when the lock was set\.<br><br>Type: string |
| /<wbr>properties/<wbr>delete\_lock/<wbr>properties/<wbr>set\_at | When the lock was set, in ISO 8601 format in UTC to the millisecond\.<br><br>Type: string |
| /<wbr>properties/<wbr>changed | True if this call set the lock\. False if the existing lock was returned unchanged\.<br><br>Type: boolean |
| /<wbr>properties/<wbr>detail | Whether this call set the lock or returned an existing lock\.<br><br>Type: string |

## Complete payload contract

```json
{
  "request": {
    "type": "object",
    "required": [
      "application",
      "reason"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "The application ID from `list_applications`."
      },
      "reason": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "description": "Give the reason for locking the application in one nonblank line of 1 to 200 characters. Leave out control characters, Unicode format characters such as zero-width characters, and personal details. The reason is visible in application reads and on the lift approval page."
      }
    },
    "additionalProperties": false
  },
  "response": {
    "type": "object",
    "description": "The application's deletion lock after this call.",
    "required": [
      "contract_version",
      "application",
      "delete_lock",
      "changed",
      "detail"
    ],
    "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."
      },
      "application": {
        "type": "string",
        "description": "The ID of the application whose lock this call sets or returns."
      },
      "delete_lock": {
        "type": "object",
        "description": "The lock set by this call or the existing lock if the application was already locked.",
        "required": [
          "reason",
          "set_at"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "description": "The reason given when the lock was set."
          },
          "set_at": {
            "type": "string",
            "description": "When the lock was set, in ISO 8601 format in UTC to the millisecond."
          }
        },
        "additionalProperties": false
      },
      "changed": {
        "type": "boolean",
        "description": "True if this call set the lock. False if the existing lock was returned unchanged."
      },
      "detail": {
        "type": "string",
        "description": "Whether this call set the lock or returned an existing lock."
      }
    }
  }
}
```

## 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/)
