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

# Delete a pipeline

> Hard-deletes the pipeline and its stages. If the pipeline still has assigned records, provide a targetPipelineId in the body so the records are migrated to the first active stage of that pipeline before deletion. The default pipeline cannot be deleted.



## OpenAPI

````yaml /api-reference/openapi.yaml delete /api/pipelines/{pipelineId}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/pipelines/{pipelineId}:
    delete:
      tags:
        - Pipelines
      summary: Delete a pipeline
      description: >-
        Hard-deletes the pipeline and its stages. If the pipeline still has
        assigned records, provide a targetPipelineId in the body so the records
        are migrated to the first active stage of that pipeline before deletion.
        The default pipeline cannot be deleted.
      operationId: delete_pipeline
      parameters:
        - in: path
          name: pipelineId
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeletePipelineRequest'
      responses:
        '200':
          description: Pipeline deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletePipelineResponse'
        '400':
          description: Validation error or undeletable pipeline
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineErrorResponse'
        '404':
          description: Pipeline not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    DeletePipelineRequest:
      type: object
      properties:
        targetPipelineId:
          type: string
          description: >-
            Required when the pipeline still has assigned contacts or
            applications. Records are migrated to the first active stage of this
            destination pipeline before deletion.
      additionalProperties: true
      example:
        targetPipelineId: 66f0a0b0c0d0e0f0a0b0c0d1
    DeletePipelineResponse:
      type: object
      properties:
        message:
          type: string
        pipelineId:
          type: string
        recordsTransferred:
          type: number
        movedToPipeline:
          nullable: true
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          additionalProperties: true
        movedToStage:
          nullable: true
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          additionalProperties: true
      additionalProperties: true
      example:
        message: Pipeline deleted
        pipelineId: 66f0a0b0c0d0e0f0a0b0c0d0
        recordsTransferred: 22
        movedToPipeline:
          id: 66f0a0b0c0d0e0f0a0b0c0d1
          name: EMEA sales pipeline
        movedToStage:
          id: 67f0a0b0c0d0e0f0a0b0c0e0
          name: New
    PipelineErrorResponse:
      type: object
      properties:
        error:
          type: string
      additionalProperties: true
      example:
        error: Pipeline not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````