> ## 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.

# Unlink Template or Stack

> Moves a private template, or a stack, from a workspace back to your account. Owner only. Doesn't delete it.

Moves the template back to your account. The same applies to a stack on `DELETE https://api.vertracloud.app/v1/workspaces/{id}/stacks/{stack_id}`. Same rules as [Unlink Application](https://docs.vertracloud.app/api-reference/endpoint/workspaces/links/remove-app.md): owner only, and an API key needs the `workspaces:write` scope. Nothing is deleted.

### Path

**id** `string` *required*

Workspace ID.

**template\_id** `string` *required*

Template ID. For a stack, use `/stacks/{stack_id}` with the stack ID instead.

### Response

Empty response on success.

### Errors

| Status | Code | When |
| - | - | - |
| 403 | `WORKSPACE_OWNER_ONLY` | Caller isn't the workspace owner. |
| 404 | `WORKSPACE_NOT_FOUND` | Workspace doesn't exist or you're not a member. |
| 404 | `TEMPLATE_NOT_FOUND` | The template isn't linked to this workspace. |
| 404 | `STACK_NOT_FOUND` | The stack isn't linked to this workspace. |


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