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

> Permanently delete a workflow the API key user can edit

Permanently deletes a workflow, including its draft and published versions. There is no confirmation query parameter. Holding `WORKFLOW_DELETE_API` is the confirmation.

This endpoint requires editor access. That is broader than the builder, which still requires owner access.

## Base URL

```
https://api.langdock.com/workflows/v1/delete
```

<Warning>
  **Dedicated deployments**

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

## Required scopes

This endpoint requires the `WORKFLOW_DELETE_API` scope (**Workflow Deletion API**). This scope cannot be granted on a personal API key.

## Parameters

| Parameter    | Type   | Required | Description                                        |
| ------------ | ------ | -------- | -------------------------------------------------- |
| `workflowId` | string | Yes      | UUID of the workflow. Passed as a query parameter. |

## Example

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

async function deleteWorkflow(workflowId) {
  const response = await axios.delete(
    "https://api.langdock.com/workflows/v1/delete",
    {
      params: { workflowId },
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

  console.log(response.data.message);
}

deleteWorkflow("550e8400-e29b-41d4-a716-446655440000");
```

## Response format

### Success response (200 OK)

```typescript theme={null}
{
  status: "success";
  message: "Workflow permanently deleted.";
}
```

## Error handling

| Status code | Description                                        |
| ----------- | -------------------------------------------------- |
| 400         | Invalid workflow ID                                |
| 401         | Invalid or missing API key                         |
| 403         | Missing `WORKFLOW_DELETE_API` scope                |
| 404         | Workflow not found, or the key user cannot edit it |
| 429         | Rate limit exceeded                                |
| 500         | Internal server error                              |

<Warning>
  Deleting a workflow is permanent.
</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 /workflows/v1/delete
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /workflows/v1/delete:
    delete:
      tags:
        - Workflows
      summary: Delete a workflow
      description: >-
        Permanently deletes a workflow, including its draft and published
        versions.
      operationId: deleteWorkflow
      parameters:
        - name: workflowId
          in: query
          required: true
          schema:
            type: string
            format: uuid
          description: UUID of the workflow.
      responses:
        '200':
          description: Workflow permanently deleted
        '400':
          description: Invalid workflow ID
        '401':
          description: Invalid or missing API key
        '403':
          description: Missing WORKFLOW_DELETE_API scope
        '404':
          description: Workflow not found, or the key user cannot edit it
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````