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

# Criar negócio

> Abre um negócio num funil, ligado ou não a um contato

Sem `pipeline_id` e sem `stage_id`, o negócio entra na primeira etapa aberta do funil padrão. Veja os ids em [Listar funis](https://docs.useintegra.com.br/api-reference/endpoint/crm-list-pipelines.md).

`value_cents` é o valor em centavos: R\$ 1.500,00 é `150000`.

`custom_fields` preenche as colunas personalizadas de **negócio**, com as mesmas regras das de contato: a chave tem que ser de uma coluna ativa e o valor do tipo dela.

```bash Requisição theme={null}
curl -X POST https://api.useintegra.com.br/api/v1/crm/deals \
  -H "Authorization: Bearer ik_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Plano anual Clínica Sol",
    "contact_id": "4ef00407-020c-4cc0-b41c-af8109e9c406",
    "value_cents": 150000,
    "expected_close_date": "2026-12-15"
  }'
```


## OpenAPI

````yaml POST /api/v1/crm/deals
openapi: 3.1.0
info:
  title: Integra BFI API
  version: 1.0.0
  description: >
    <img src="/public/logo_dark.webp" alt="Integra" height="36"
    style="margin-bottom:16px" />


    A API da Integra para integrações externas.


    > [!tip]

    > **Copie a documentação completa para sua IA favorita:**

    > [Abrir página de cópia](/docs/markdown) ou baixe o [llm.txt](/llm.txt)


    ---


    ## Como começar


    ### 1. Gerar sua API Key


    Acesse o painel da Integra em **Settings > API Keys** e clique em **Nova API
    Key**.


    > [!important]

    > Copie a key gerada (`ik_live_...`) imediatamente: ela **só será exibida
    uma vez**.


    ### 2. Autenticar requests


    Envie o header `Authorization` em todas as chamadas:


    ```

    Authorization: Bearer ik_live_sua_key_aqui

    ```


    ### 3. Fazer sua primeira chamada


    ```bash

    curl -H "Authorization: Bearer ik_live_xxx" \
      https://api.useintegra.com.br/api/v1/campaigns
    ```


    > [!success]

    > Se a resposta for `200 OK` com JSON, sua integração está funcionando!


    ---


    ## Rate Limiting


    | Header | Descrição |

    |--------|-----------|

    | `X-RateLimit-Limit` | Limite total (60/min) |

    | `X-RateLimit-Remaining` | Requests restantes |

    | `X-RateLimit-Reset` | Timestamp de reset (epoch) |


    > [!warning]

    > Ao exceder **60 requests/minuto** por API Key, a API retorna status `429
    Too Many Requests`.


    ---


    ## Erros comuns


    | Status | Erro | Causa |

    |--------|------|-------|

    | `401` | Invalid API key | Key inválida ou revogada |

    | `403` | Forbidden | Key sem permissão para o recurso |

    | `429` | Rate limit exceeded | Excedeu 60 req/min |

    | `500` | Internal server error | Erro interno, contate o suporte |
servers:
  - url: https://api.useintegra.com.br
    description: Production
security:
  - ApiKey: []
tags:
  - name: Campaigns
    description: Gerenciamento de campanhas de voz e WhatsApp
  - name: Calls
    description: Histórico de chamadas
  - name: CRM
    description: 'CRM Integra da organização: funis, contatos, negócios e atividades'
  - name: Automations
    description: Dispara as automações com o gatilho Chamada pela nossa API
  - name: Meetings
    description: Reuniões que os agentes marcaram na agenda da organização
  - name: Webhooks
    description: Gerenciamento de webhooks para notificações em tempo real
paths:
  /api/v1/crm/deals:
    post:
      tags:
        - CRM
      summary: Criar um negócio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrmDealCreate'
      responses:
        '201':
          description: O negócio criado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmDeal'
        '400':
          description: >-
            Campo inválido; contato, funil ou etapa que não é da organização;
            etapa de outro funil; funil arquivado ou sem padrão; motivo de perda
            fora da etapa de perdido
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          description: Não autenticado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '403':
          description: A chave não tem o escopo crm:write
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '409':
          description: >-
            O CRM está desligado na organização (ligue no painel, em CRM >
            Configurações)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - ApiKey: []
components:
  schemas:
    CrmDealCreate:
      type: object
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 160
        pipeline_id:
          type: string
          format: uuid
          description: >-
            O funil (GET /api/v1/crm/pipelines). Sem ele e sem stage_id: o funil
            padrão
        stage_id:
          type: string
          format: uuid
          description: >-
            A etapa; com pipeline_id, tem de ser desse funil. Sem ela: a
            primeira etapa aberta do funil
        contact_id:
          type:
            - string
            - 'null'
          format: uuid
          description: O contato (POST /api/v1/crm/contacts devolve o id)
        value_cents:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 100000000000000
          description: Valor em centavos (R$ 1.500,00 = 150000)
          example: 150000
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: 'Default: BRL'
          example: BRL
        expected_close_date:
          type:
            - string
            - 'null'
          example: '2026-12-15'
        tags:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 40
          maxItems: 30
          description: >-
            Até 30 tags, cada uma com até 40 caracteres; a repetida sai.
            Substitui a lista inteira
          example:
            - vip
        custom_fields:
          type: object
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
              - type: number
              - type: boolean
              - type: 'null'
              - type: 'null'
          description: >-
            Campos personalizados (os criados no painel, em CRM >
            Configurações), pela chave: texto (até 500), número, data
            (AAAA-MM-DD), uma das opções da seleção ou true/false. null tira o
            valor. As chaves que não vierem ficam como estão
          example:
            convenio: Unimed
        lost_reason:
          type: string
          minLength: 1
          maxLength: 300
          description: Só com a etapa de perdido
      required:
        - title
      additionalProperties: false
    CrmDeal:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        pipeline_id:
          type: string
        stage:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            kind:
              type: string
              enum:
                - open
                - won
                - lost
          required:
            - id
            - name
            - kind
        status:
          type: string
          enum:
            - open
            - won
            - lost
          description: open, won ou lost (o tipo da etapa)
        lost_reason:
          type:
            - string
            - 'null'
        value_cents:
          type:
            - number
            - 'null'
        currency:
          type: string
        expected_close_date:
          type:
            - string
            - 'null'
          description: Previsão de fechamento (AAAA-MM-DD)
        contact:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            name:
              type:
                - string
                - 'null'
            phone:
              type:
                - string
                - 'null'
          required:
            - id
            - name
            - phone
        company:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            name:
              type: string
          required:
            - id
            - name
        tags:
          type: array
          items:
            type: string
        custom_fields:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
        stage_entered_at:
          type: string
          description: Quando entrou na etapa atual
          example: '2026-11-02T14:00:00.000Z'
        closed_at:
          type:
            - string
            - 'null'
          description: Quando foi ganho ou perdido; null no aberto
          example: '2026-11-02T14:00:00.000Z'
        created_at:
          type: string
          description: Criação (UTC)
          example: '2026-11-02T14:00:00.000Z'
        updated_at:
          type: string
          description: Última mudança (UTC)
          example: '2026-11-02T14:00:00.000Z'
      required:
        - id
        - title
        - pipeline_id
        - stage
        - status
        - lost_reason
        - value_cents
        - currency
        - expected_close_date
        - contact
        - company
        - tags
        - custom_fields
        - stage_entered_at
        - closed_at
        - created_at
        - updated_at
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API Key da organização (Authorization: Bearer ik_live_xxx)'

````

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