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

# Create a pipeline

> Creates a new pipeline with its stages.

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



## OpenAPI

````yaml /en/api-reference/openapi.json post /v1/pipelines
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:
    post:
      tags:
        - Pipelines
      summary: Create a pipeline
      description: |-
        Creates a new pipeline with its stages.

        <Accordion title="Required scope">
        `deals:write`
        </Accordion>
      operationId: createPipeline
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePipelineRequest'
            example:
              name: New Business
              stages:
                - name: Prospecting
                  type: open
                  probability: 10
                - name: Proposal
                  type: open
                  probability: 40
                - name: Negotiation
                  type: open
                  probability: 70
                - name: Closed Won
                  type: win
                  probability: 100
                - name: Closed Lost
                  type: lost
                  probability: 0
      responses:
        '201':
          description: Pipeline created 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."`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: bad_request
                  message: Request body must be valid JSON.
                  request_id: 550e8400-e29b-41d4-a716-446655440000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreatePipelineRequest:
      type: object
      required:
        - name
        - stages
      properties:
        name:
          type: string
          maxLength: 50
          example: New Business
        stages:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/PipelineStageInput'
    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
    PipelineStageInput:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          maxLength: 60
          example: Prospecting
        type:
          type: string
          enum:
            - open
            - win
            - lost
        probability:
          type: integer
          minimum: 0
          maximum: 100
          nullable: true
          example: 10
    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
    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
    RateLimitExceeded:
      description: 'Rate limit exceeded. Error code: `rate_limit_exceeded`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: Rate limit exceeded. Try again in 60 seconds.
              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.

````