> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vertracloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Stack

> Dissolves a stack and keeps its members, or deletes the stack together with every member and, optionally, its Blob files.

Choose between two modes. **`dissolve`** removes only the stack: the applications and databases stay as loose resources, without the managed variables and certificates, and the Blob files are kept. **`delete_all`** deletes every member too, each by its own deletion rule (with the safety snapshot where there is one). Either way, the API key the platform created for the stack's Blob folder is revoked.

> [!WARNING]
>
> `delete_all` cannot be undone and deletes applications and databases. Confirm the name and check the members first with [Get Stack](https://docs.vertracloud.app/api-reference/endpoint/stacks/get.md).

Needs the `stacks:delete` scope when called with an API key. With `delete_all`, the key also needs `apps:delete` and `databases:delete`, and `blob:write` when you delete the Blob files (`blob: "delete"`). Without them the call fails with `API_KEY_SCOPE_DENIED`.

**stack\_id** `string` *required*

The stack ID.

**workspace\_id** `string`

The workspace the stack belongs to, when you act on it as the workspace owner.

**mode** `string` *required*

`dissolve` or `delete_all`.

**confirm\_name** `string` *required*

Must be equal to the stack name.

**blob** `string` (default: keep)

What to do with the files of the stack's Blob folder when `mode` is `delete_all`: `keep` leaves them where they are, `delete` removes them. `dissolve` always keeps them.

### Response

**response** `object`

**Toggle object**

**deleted\_apps** `string[]`

IDs of the applications deleted. Empty with `dissolve`.

**deleted\_databases** `string[]`

IDs of the databases deleted. Empty with `dissolve`.

**deleted\_blob** `boolean`

`true` when the files of the Blob folder were deleted.

```json Response theme={null}
{
  "response": {
    "deleted_apps": ["app-abc123def456"],
    "deleted_databases": ["db-abc123def456"],
    "deleted_blob": false
  }
}
```

```bash cURL theme={null}
curl -X DELETE https://api.vertracloud.app/v1/stacks/stk-abc123def456 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "delete_all", "confirm_name": "shop", "blob": "keep" }'
```

### Errors

| Status | Code | When |
| - | - | - |
| 400 | `STACK_NAME_MISMATCH` | `confirm_name` is not the stack name. |
| 403 | `API_KEY_SCOPE_DENIED` | The key lacks `stacks:delete`, or with `delete_all` lacks `apps:delete`, `databases:delete` or `blob:write`; `details.required` names the scope. |
| 403 | `WORKSPACE_OWNER_ONLY` | You are a workspace member, not the owner. |
| 403 | `STACK_SERVICE_LOCKED` | `dissolve` on a stack with an application of a closed template, which cannot leave the stack. Use `delete_all`. |
| 404 | `STACK_NOT_FOUND` | The stack does not exist or belongs to another account. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.