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

# Delete a Pipeline

> Deletes a non-default pipeline. If it has opportunities or stage triggers, send `destination_pipeline_id` and a `stage_mapping` entry for each open stage that has them; omitted closed stages map by outcome. Pipelines with more than 100 opportunities can't be deleted.

Returns 409 `stages_unmapped` when a mapping is missing; `data.unmapped_stages` lists the stages to map. Requires an admin and multiple pipelines enabled.



## OpenAPI

````yaml https://api.monaco.com/openapi.json post /v1/pipelines/{pipeline_id}/delete
openapi: 3.2.1
info:
  title: Monaco Public API
  description: Public API for Monaco
  version: 1.0.0
servers:
  - url: https://api.monaco.com
security: []
paths:
  /v1/pipelines/{pipeline_id}/delete:
    post:
      tags:
        - Pipelines
      summary: Delete a Pipeline
      description: >-
        Deletes a non-default pipeline. If it has opportunities or stage
        triggers, send `destination_pipeline_id` and a `stage_mapping` entry for
        each open stage that has them; omitted closed stages map by outcome.
        Pipelines with more than 100 opportunities can't be deleted.


        Returns 409 `stages_unmapped` when a mapping is missing;
        `data.unmapped_stages` lists the stages to map. Requires an admin and
        multiple pipelines enabled.
      operationId: delete_pipeline
      parameters:
        - name: pipeline_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Pipeline Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeletePipelineRequest'
      responses:
        '204':
          description: Pipeline deleted
        '409':
          description: '`stages_unmapped`; other 409 codes use the standard error body'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineStagesUnmappedErrorResponse'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
components:
  schemas:
    DeletePipelineRequest:
      properties:
        destination_pipeline_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Destination Pipeline Id
          description: >-
            Pipeline that receives the opportunities and stage triggers.
            Required when the pipeline has either.
        stage_mapping:
          items:
            $ref: '#/components/schemas/PipelineStageMappingInput'
          type: array
          maxItems: 50
          title: Stage Mapping
          description: >-
            Destination stage for each stage with opportunities or stage
            triggers. Closed stages may be omitted; they map to the
            destination's stage with the same outcome.
      additionalProperties: false
      type: object
      title: DeletePipelineRequest
      description: Where the deleted pipeline's opportunities and stage-based triggers go.
    PipelineStagesUnmappedErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/PipelineStagesUnmappedErrorDetail'
      type: object
      required:
        - error
      title: PipelineStagesUnmappedErrorResponse
    PublicErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: PublicErrorResponse
    PipelineStageMappingInput:
      properties:
        source_stage_id:
          type: string
          format: uuid
          title: Source Stage Id
          description: Stage of the pipeline being deleted
        destination_stage_id:
          type: string
          format: uuid
          title: Destination Stage Id
          description: Stage of the destination pipeline
      additionalProperties: false
      type: object
      required:
        - source_stage_id
        - destination_stage_id
      title: PipelineStageMappingInput
    PipelineStagesUnmappedErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: Machine-readable error code
          examples:
            - stages_unmapped
        message:
          type: string
          title: Message
          description: Human-readable error message
        data:
          $ref: '#/components/schemas/PipelineStagesUnmappedData'
      type: object
      required:
        - code
        - message
        - data
      title: PipelineStagesUnmappedErrorDetail
      description: '`stages_unmapped` error body.'
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: Machine-readable error code
          examples:
            - not_found
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
            - Resource not found
        data:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
              type: object
            - type: 'null'
          title: Data
          description: >-
            Details for some codes: `field_too_long` carries `field`, `limit`
            and `actual`, plus `unit` (`items` or `bytes`) when the limit isn't
            in characters; `too_many_custom_fields` carries `entity_type` and
            `limit`
      type: object
      required:
        - code
        - message
      title: ErrorDetail
    PipelineStagesUnmappedData:
      properties:
        missing_destination_pipeline:
          type: boolean
          title: Missing Destination Pipeline
          description: True when `destination_pipeline_id` is required but missing
        unmapped_stages:
          items:
            $ref: '#/components/schemas/UnmappedPipelineStage'
          type: array
          title: Unmapped Stages
          description: Stages that need an entry in `stage_mapping`
      type: object
      required:
        - missing_destination_pipeline
        - unmapped_stages
      title: PipelineStagesUnmappedData
    UnmappedPipelineStage:
      properties:
        stage_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Stage Id
          description: Stage ID; null when triggers name a stage that no longer exists
        stage_key:
          type: string
          title: Stage Key
          description: Stage key
        stage_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Stage Name
          description: Stage display name
        opportunity_count:
          type: integer
          title: Opportunity Count
          description: Opportunities in the stage
        agent_trigger_count:
          type: integer
          title: Agent Trigger Count
          description: Agent triggers on the stage
        webhook_trigger_count:
          type: integer
          title: Webhook Trigger Count
          description: Webhook triggers on the stage
      type: object
      required:
        - stage_id
        - stage_key
        - stage_name
        - opportunity_count
        - agent_trigger_count
        - webhook_trigger_count
      title: UnmappedPipelineStage

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.