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

# Delete a workflow

> Delete a workflow with revision and confirmation handling.

Deleting a sending workflow stops sending it. Additionally, if the workflow has queued contacts, they are removed.

Successful deletion returns `204 No Content`. If the workflow is currently sending or has queued contacts, Loops returns `409 Conflict` with a `message` instead of deleting. Retry the request with the same `expectedRevisionId` and `confirmDelete: true` to delete the workflow.

Once deleted, workflows are not returned in other API endpoints.


## OpenAPI

````yaml https://app.loops.so/openapi.json delete /v1/workflows/{workflowId}
openapi: 3.1.0
info:
  title: Loops OpenAPI Spec
  description: This is the OpenAPI Spec for the [Loops API](https://loops.so/docs/api).
  version: 1.21.9
servers:
  - url: https://app.loops.so/api
security: []
tags:
  - name: API key
  - name: Audience segments
    description: View audience segments
  - name: Campaigns
    description: Create and manage email campaigns
  - name: Campaign groups
    description: Organize campaigns into groups
  - name: Configuration
    description: View configuration settings
  - name: Contacts
    description: Manage contacts in your audience
  - name: Contact properties
    description: Manage contact properties
  - name: Components
    description: View email components
  - name: Email messages
    description: Manage email message content for campaigns
  - name: Events
    description: Trigger workflows with events
  - name: Event patterns
    description: View workflow event patterns
  - name: Mailing lists
    description: View mailing lists
  - name: Themes
    description: View email themes
  - name: Transactional emails
    description: Create, manage, and send transactional emails
  - name: Transactional groups
    description: Organize transactional emails into groups
  - name: Uploads
    description: Upload image assets
  - name: Workflows
    description: View and mutate workflow graphs
  - name: Workflow nodes
    description: View and mutate workflow nodes
  - name: Webhooks
    description: >-
      Events Loops sends to your configured webhook endpoint when certain events
      happen in your account. Configure an endpoint in Settings → Webhooks. Each
      account supports one webhook endpoint. Events are signed with
      `webhook-id`, `webhook-timestamp`, and `webhook-signature` headers and
      delivered at a maximum rate of 10 per second. See
      https://loops.so/docs/webhooks for setup, verification, and payload
      details.
paths:
  /v1/workflows/{workflowId}:
    parameters:
      - name: workflowId
        in: path
        required: true
        description: The ID of the workflow.
        schema:
          type: string
          examples:
            - clw1a3b5c7d9e1f3g5h7i9j1
    delete:
      tags:
        - Workflows
      summary: Delete a workflow
      description: >-
        Delete a workflow. Successful deletion returns `204 No Content`. If the
        workflow is currently sending or has queued contacts, Loops returns `409
        Conflict` with a message instead of deleting. Retry with `confirmDelete:
        true` to delete the workflow, stop sending, and cancel queued contacts.
      operationId: deleteWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteWorkflowRequest'
      responses:
        '204':
          description: Workflow deleted. No response body.
        '400':
          description: Invalid `workflowId`, request body, or delete target.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowFailureResponse'
        '401':
          description: Invalid API key.
        '404':
          description: Workflow not found. Deleted workflows are returned as not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowFailureResponse'
        '405':
          description: Wrong HTTP request method.
        '409':
          description: >-
            `expectedRevisionId` is stale, or workflow deletion requires
            confirmation because the workflow is currently sending or has queued
            contacts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowFailureResponse'
      security:
        - apiKey: []
components:
  schemas:
    DeleteWorkflowRequest:
      type: object
      properties:
        expectedRevisionId:
          $ref: '#/components/schemas/WorkflowExpectedRevisionId'
        confirmDelete:
          type: boolean
          description: >-
            Set to `true` after a confirmation-required `409 Conflict` response
            to confirm deleting a sending workflow or a workflow with queued
            contacts.
      required:
        - expectedRevisionId
      additionalProperties: false
    WorkflowFailureResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      examples:
        - message: Workflow not found.
    WorkflowExpectedRevisionId:
      type:
        - string
        - 'null'
      description: >-
        The workflow revision token returned by the latest workflow read or
        mutation. Older workflows may return `null` before their first
        revision-aware mutation; pass `null` back as `expectedRevisionId` in
        that case. If the token is stale, the API returns a `409 Conflict`
        error.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

## Related topics

- [Delete a workflow node](/docs/api-reference/delete-workflow-node.md)
- [Workflows](/docs/cli/workflows.md)
- [Delete workflow nodes recursively](/docs/api-reference/delete-workflow-nodes.md)
- [API Introduction](/docs/api-reference/intro.md)
- [Branching workflows](/docs/workflows/branching.md)
