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

# Update a pipeline

> Updates a pipeline. Only the fields sent are modified.

<Accordion title="Required scope">
`deals:write`
</Accordion>



## OpenAPI

````yaml /en/api-reference/openapi.json patch /v1/pipelines/{id}
openapi: 3.1.0
info:
  title: OAuth 2.1
  description: Endpoints for registering applications and managing OAuth 2.1 tokens.
  version: 1.0.0
  contact:
    name: Vendaze Support
    email: suporte@vendaze.com
servers:
  - url: https://api.vendaze.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: OAuth
  - name: People
  - name: Companies
  - name: Deals
  - name: Pipelines
  - name: Tasks
  - name: Task Types
  - name: Products
  - name: Tags
  - name: Lists
  - name: Custom Fields
  - name: Webhooks
paths:
  /v1/pipelines/{id}:
    patch:
      tags:
        - Pipelines
      summary: Update a pipeline
      description: |-
        Updates a pipeline. Only the fields sent are modified.

        <Accordion title="Required scope">
        `deals:write`
        </Accordion>
      operationId: updatePipeline
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePipelineRequest'
            example:
              name: Renamed Pipeline
              stages:
                - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  name: Prospecting
                  type: open
                  probability: 15
                - id: b2c3d4e5-f6a7-8901-bcde-f12345678901
                  name: Proposal Sent
                  type: open
                  probability: 50
                - name: 'New: Pilot'
                  type: open
                  probability: 75
                - id: c3d4e5f6-a7b8-9012-cdef-123456789012
                  name: Closed Won
                  type: win
                  probability: 100
                - id: d4e5f6a7-b8c9-0123-defa-234567890123
                  name: Closed Lost
                  type: lost
                  probability: 0
      responses:
        '200':
          description: Pipeline updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineResponse'
        '400':
          description: >-
            Invalid or unparseable JSON body. Error code: `bad_request`.
            Message: `"Request body must be valid JSON."` For PATCH with no
            fields: code `bad_request`, message `"No fields provided for
            update."`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: bad_request
                  message: No fields provided for update.
                  request_id: 550e8400-e29b-41d4-a716-446655440000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    id:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: UUID of the resource.
  schemas:
    UpdatePipelineRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 50
          example: Renamed Pipeline
        stages:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/PipelineStageUpdateInput'
    PipelineResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Pipeline'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
              format: uuid
    PipelineStageUpdateInput:
      type: object
      required:
        - name
        - type
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 60
          example: Proposal Sent
        type:
          type: string
          enum:
            - open
            - win
            - lost
        probability:
          type: integer
          minimum: 0
          maximum: 100
          nullable: true
          example: 50
    Pipeline:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: New Business
        created_at:
          type: string
          format: date-time
        stages:
          type: array
          items:
            $ref: '#/components/schemas/PipelineStage'
    ValidationErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: validation_error
            message:
              type: string
              example: Validation failed.
            fields:
              type: object
              additionalProperties:
                type: string
            request_id:
              type: string
              format: uuid
    PipelineStage:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Proposal
        type:
          type: string
          enum:
            - open
            - win
            - lost
        probability:
          type: integer
          minimum: 0
          maximum: 100
          nullable: true
          example: 40
        created_at:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: >-
        Token missing, invalid, or expired. Possible error codes:
        `unauthorized`, `token_expired`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthorized
              message: Missing or invalid Authorization header.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    InsufficientScope:
      description: 'Token lacks the required scope. Error code: `insufficient_scope`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: insufficient_scope
              message: This endpoint requires the 'webhooks:read' scope.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    NotFound:
      description: >-
        Webhook not found or belongs to another integration. Error code:
        `not_found`. Message: `"Webhook not found."`
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: not_found
              message: Webhook not found.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    ValidationError:
      description: >-
        Input validation failed. Error code: `validation_error`. The `fields`
        object maps each invalid field to a description of the problem.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
          example:
            error:
              code: validation_error
              message: Validation failed.
              fields:
                url: url must use HTTPS.
                events: At least one event is required.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    InternalError:
      description: 'Unexpected server error. Error code: `internal_error`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: internal_error
              message: An unexpected error occurred.
              request_id: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.1 access token.

````