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

# Criar pipeline

> Cria um novo pipeline com suas etapas.

<Accordion title="Escopo necessário">
`deals:write`
</Accordion>



## OpenAPI

````yaml /pt/api-reference/openapi.json post /v1/pipelines
openapi: 3.1.0
info:
  title: OAuth 2.1
  description: Endpoints para registrar aplicativos e gerenciar tokens OAuth 2.1.
  version: 1.0.0
  contact:
    name: Suporte Vendaze
    email: suporte@vendaze.com
servers:
  - url: https://api.vendaze.com
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: OAuth
  - name: Pessoas
  - name: Empresas
  - name: Negócios
  - name: Pipelines
  - name: Tarefas
  - name: Tipos de Tarefas
  - name: Produtos
  - name: Tags
  - name: Listas
  - name: Campos Adicionais
  - name: Webhooks
paths:
  /v1/pipelines:
    post:
      tags:
        - Pipelines
      summary: Criar pipeline
      description: |-
        Cria um novo pipeline com suas etapas.

        <Accordion title="Escopo necessário">
        `deals:write`
        </Accordion>
      operationId: createPipeline
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePipelineRequest'
            example:
              name: Novos Negócios
              stages:
                - name: Prospecção
                  type: open
                  probability: 10
                - name: Proposta
                  type: open
                  probability: 40
                - name: Negociação
                  type: open
                  probability: 70
                - name: Ganho
                  type: win
                  probability: 100
                - name: Perdido
                  type: lost
                  probability: 0
      responses:
        '201':
          description: Pipeline criado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineResponse'
        '400':
          description: >-
            Body JSON inválido ou não parseável. Código de erro: `bad_request`.
            Mensagem: `"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: Novos Negócios
        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: Prospecção
        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: Novos Negócios
        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: Proposta
        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 ausente, inválido ou expirado. Códigos possíveis: `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 sem o escopo necessário. Código de erro: `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: >-
        Validação de entrada falhou. Código: `validation_error`. O objeto
        `fields` mapeia cada campo inválido para uma descrição do problema.
      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 excedido. Código: `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: 'Erro interno inesperado. Código: `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: Access token OAuth 2.1.

````