# Delete a folder

Delete an existing folder and remove folder references from all templates within it.\
Templates themselves are not deleted, only their association with the folder.

## Sample Request

Here's a sample request to delete a folder:

```js title="ENDPOINT"
DELETE /v1/folder/{id}
```

```js title="REQUEST" "folderId" "API_KEY"
fetch(`https://api.templated.io/v1/folder/${folderId}`, {
  method: 'DELETE',
  headers: {
    'Authorization': Bearer ${API_KEY}
  }
})
```

### Path Parameters

<div class="">
  <span class="font-mono font-bold">id</span> `string` <code class="text-white !bg-red-500">REQUIRED</code>\
  The unique identifier of the folder you want to delete.
</div>

## Response

A successful deletion returns an empty response with a 204 status code. When deleting a folder:

- All templates previously in the folder will have their folder reference removed
- The folder will be permanently deleted
- Templates themselves are not deleted, only their association with the folder

{/* ### Error Responses

| Status | Description |
|--------|-------------|
| 401 | Not authorized - Invalid or missing API key |
| 403 | Forbidden - You don't have permission to delete this folder |
| 404 | Not Found - Folder or user not found |
| 500 | Internal Server Error - An unexpected error occurred | */}