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

# Create a deal



## OpenAPI

````yaml post /v1/deals
openapi: 3.0.0
info:
  title: Kinbox API
  description: Kinbox public API
  version: '2.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/deals:
    post:
      tags:
        - v1Deals
      summary: Create a deal
      operationId: createDeal
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDealPublicDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealPublicDto'
components:
  schemas:
    CreateDealPublicDto:
      type: object
      properties:
        name:
          type: string
          description: Nome do negócio
        value:
          type: number
          description: Valor em dinheiro do negócio
        lostReason:
          description: Motivos de perda
          type: array
          items:
            type: string
        productsLostReason:
          description: Motivos de perda por produto
          type: array
          items:
            type: object
        products:
          type: array
          items:
            $ref: '#/components/schemas/DealProduct'
        lostReasonObs:
          type: string
          description: Observação de perda
        wonLostDate:
          format: date-time
          type: string
          description: Data de perda ou ganho
        dueDate:
          format: date-time
          type: string
          description: Data de vencimento
        status:
          type: string
          enum:
            - open
            - won
            - lost
          description: Status do negócio
        conversation:
          description: Conversa associada ao negócio
          allOf:
            - $ref: '#/components/schemas/DealConversation'
        operatorId:
          type: number
          description: ID do usuário responsável pelo negócio
        groupId:
          type: number
          description: ID do grupo associado ao negócio
        pipelineId:
          type: string
          description: ID do pipeline associado ao negócio
        stageId:
          type: string
        origin:
          type: string
        campaign:
          type: string
        authorType:
          type: string
          enum:
            - user
            - bot
            - automation
            - workflow
            - unknown
            - cadence
            - api
        authorId:
          type: object
        tagIds:
          type: array
          items:
            type: number
        position:
          type: number
        focusedCounts:
          type: number
        tasks:
          type: object
          additionalProperties: 20956432-4072-4b60-91d7-c9f971313fd8
        timeInStage:
          type: object
        lastStageChanged:
          format: date-time
          type: string
        comments:
          type: number
        context:
          $ref: '#/components/schemas/DealContext'
        customFields:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CustomFieldPlaceholder'
          properties: {}
          default: {}
        contactId:
          type: number
          description: ID do contato associado ao negócio.
      required:
        - name
        - value
        - status
        - pipelineId
        - stageId
        - customFields
        - contactId
    DealPublicDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: Nome do negócio
        value:
          type: number
          description: Valor em dinheiro do negócio
        lostReason:
          description: Motivos de perda
          type: array
          items:
            type: string
        productsLostReason:
          description: Motivos de perda por produto
          type: array
          items:
            type: object
        products:
          type: array
          items:
            $ref: '#/components/schemas/DealProduct'
        lostReasonObs:
          type: string
          description: Observação de perda
        wonLostDate:
          format: date-time
          type: string
          description: Data de perda ou ganho
        dueDate:
          format: date-time
          type: string
          description: Data de vencimento
        status:
          type: string
          enum:
            - open
            - won
            - lost
          description: Status do negócio
        contact:
          description: Contato associado ao negócio
          allOf:
            - $ref: '#/components/schemas/DealContact'
        conversation:
          description: Conversa associada ao negócio
          allOf:
            - $ref: '#/components/schemas/DealConversation'
        operatorId:
          type: number
          description: ID do usuário responsável pelo negócio
        groupId:
          type: number
          description: ID do grupo associado ao negócio
        pipelineId:
          type: string
          description: ID do pipeline associado ao negócio
        stageId:
          type: string
        origin:
          type: string
        campaign:
          type: string
        authorType:
          type: string
          enum:
            - user
            - bot
            - automation
            - workflow
            - unknown
            - cadence
            - api
        authorId:
          type: object
        tagIds:
          type: array
          items:
            type: number
        position:
          type: number
        focusedCounts:
          type: number
        tasks:
          type: object
          additionalProperties: 20956432-4072-4b60-91d7-c9f971313fd8
        timeInStage:
          type: object
        lastStageChanged:
          format: date-time
          type: string
        comments:
          type: number
        context:
          $ref: '#/components/schemas/DealContext'
        customFields:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CustomFieldPlaceholder'
          properties: {}
          default: {}
      required:
        - id
        - name
        - value
        - status
        - pipelineId
        - stageId
        - customFields
    DealProduct:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        price:
          type: number
        quantity:
          type: number
        discount:
          type: number
        discountType:
          type: string
          enum:
            - percentage
            - value
        total:
          type: number
      required:
        - id
        - name
        - price
        - quantity
        - discount
        - discountType
        - total
    DealConversation:
      type: object
      properties:
        id:
          type: number
        platformId:
          type: number
        lastMessageAt:
          format: date-time
          type: string
        showPending:
          type: boolean
        pendingAt:
          format: date-time
          type: string
      required:
        - id
        - platformId
        - showPending
    DealContext:
      type: object
      properties:
        automationId:
          type: string
        importId:
          type: string
    CustomFieldPlaceholder:
      type: object
      properties:
        value:
          type: string
        type:
          type: string
      required:
        - value
        - type
    DealContact:
      type: object
      properties:
        id:
          type: number
        name:
          type: string
        avatar:
          type: string
        phone:
          type: string
        email:
          type: string
        createdAt:
          format: date-time
          type: string
        isPrivate:
          type: boolean
      required:
        - id
        - name
        - avatar
        - phone
        - email

````