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

# Delete Prompt Folder

> Delete a prompt folder from your workspace

Permanently deletes a prompt folder from your workspace. Prompts in the folder are deleted as well. This action cannot be undone.

## Base URL

```
https://api.langdock.com/prompts/v1/folders/{folderId}
```

<Warning>
  **Dedicated deployments**

  Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.
</Warning>

## Required Scopes

This endpoint requires the `PROMPT_API` scope.

<Info>
  Private folders require creator access. Workspace-shared folders require workspace editor access. Group-shared folders require group editor access or workspace editor access.
</Info>

## Parameters

| Parameter  | Type   | Required | Description                   |
| ---------- | ------ | -------- | ----------------------------- |
| `folderId` | string | Yes      | UUID of the folder to delete. |

## Example

```javascript theme={null}
const axios = require("axios");

async function deletePromptFolder(folderId) {
  const response = await axios.delete(
    `https://api.langdock.com/prompts/v1/folders/${folderId}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

  console.log("Deleted:", response.data.success);
}

deletePromptFolder("7c9e6679-7425-40de-944b-e07fc1f90ae7");
```

## Response Format

### Success Response (200 OK)

```typescript theme={null}
{
  success: true;
}
```

## Error Handling

| Status Code | Description                                 |
| ----------- | ------------------------------------------- |
| 400         | Invalid folder ID format                    |
| 401         | Invalid or missing API key                  |
| 403         | Missing `PROMPT_API` scope or manage access |
| 404         | Prompt folder not found                     |
| 429         | Rate limit exceeded                         |
| 500         | Internal server error                       |

<Warning>
  Deleting a folder also deletes every prompt in that folder. This cannot be undone.
</Warning>

<Info>
  Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on [API Key Best Practices](/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices).
</Info>


## OpenAPI

````yaml DELETE /prompts/v1/folders/{folderId}
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /prompts/v1/folders/{folderId}:
    delete:
      tags:
        - Prompts
      summary: Delete a prompt folder
      description: Permanently deletes a prompt folder and the prompts in it.
      operationId: deletePromptFolder
      parameters:
        - $ref: '#/components/parameters/PromptFolderId'
      responses:
        '200':
          description: Prompt folder deleted successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          description: Invalid folder ID
        '401':
          description: Invalid or missing API key
        '403':
          description: Missing required scope or manage access
        '404':
          description: Prompt folder not found
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  parameters:
    PromptFolderId:
      name: folderId
      in: path
      required: true
      description: UUID of the prompt folder.
      schema:
        type: string
        format: uuid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````