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

# Criar Negócio do Pipeline

> Cria um novo negócio no pipeline de CRM da conta autenticada.

## Requisição

`POST https://crm.wavups.com/api/v1/account-crm-pipeline-deal`

<ParamField header="Token" type="string" required>
  Seu token de autenticação.
</ParamField>

### Body

<ParamField body="title" type="string" required>
  Título do negócio.
</ParamField>

<ParamField body="stageId" type="string">
  ID do estágio do pipeline ao qual o negócio pertence.
</ParamField>

<ParamField body="leadId" type="string">
  ID do lead a ser vinculado ao negócio.
</ParamField>

<ParamField body="dealOwner" type="string">
  ID do usuário responsável pelo negócio.
</ParamField>

<ParamField body="value" type="number">
  Valor estimado do negócio.
</ParamField>

<ParamField body="status" type="string">
  Status do negócio (ex: `open`, `won`, `lost`).
</ParamField>

<ParamField body="expectedCloseDate" type="string">
  Data prevista de fechamento no formato ISO 8601 (ex: `2025-08-01T00:00:00.000Z`).
</ParamField>

***

## Resposta

Retorna o objeto do negócio criado.

<ResponseField name="id" type="string">
  Identificador único do negócio criado.
</ResponseField>

<ResponseField name="title" type="string">
  Título do negócio.
</ResponseField>

<ResponseField name="stageId" type="string | null">
  ID do estágio vinculado.
</ResponseField>

<ResponseField name="leadId" type="string | null">
  ID do lead vinculado.
</ResponseField>

<ResponseField name="dealOwner" type="string | null">
  ID do usuário responsável.
</ResponseField>

<ResponseField name="value" type="number | null">
  Valor estimado do negócio.
</ResponseField>

<ResponseField name="status" type="string | null">
  Status do negócio.
</ResponseField>

<ResponseField name="expectedCloseDate" type="string | null">
  Data prevista de fechamento.
</ResponseField>

<ResponseField name="createdAt" type="string">
  Data de criação (ISO 8601).
</ResponseField>

***

## Exemplos

<RequestExample>
  ```bash POST /api/v1/account-crm-pipeline-deal theme={null}
  curl --request POST \
    --url 'https://crm.wavups.com/api/v1/account-crm-pipeline-deal' \
    --header 'Token: SEU_TOKEN_DE_API' \
    --header 'Content-Type: application/json' \
    --data '{
      "title": "Contrato Empresa Y",
      "stageId": "clstg0001",
      "leadId": "cllead002",
      "dealOwner": "cluser001",
      "value": 8000,
      "status": "open",
      "expectedCloseDate": "2025-09-15T00:00:00.000Z"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "cldeal002",
    "title": "Contrato Empresa Y",
    "stageId": "clstg0001",
    "leadId": "cllead002",
    "dealOwner": "cluser001",
    "value": 8000,
    "status": "open",
    "expectedCloseDate": "2025-09-15T00:00:00.000Z",
    "createdAt": "2025-06-20T10:00:00.000Z"
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Title is required"
  }
  ```

  ```json 500 theme={null}
  {
    "error": "Error to create account CRM pipeline deal"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /account-crm-pipeline-deal
openapi: 3.0.3
info:
  title: WavUps CRM API
  description: >-
    API pública da plataforma WavUps CRM — gerencie leads, produtos, categorias,
    atendimentos, agendamentos, conversas e pipelines de CRM.
  version: 1.0.0
servers:
  - url: https://crm.wavups.com/api/v1
    description: Servidor de produção
security:
  - Token: []
paths:
  /account-crm-pipeline-deal:
    post:
      tags:
        - Negócios do Pipeline
      summary: Criar Negócio
      description: Cria um novo negócio no pipeline de CRM da conta autenticada.
      operationId: createCrmPipelineDeal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCrmPipelineDealBody'
      responses:
        '201':
          description: Negócio criado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmPipelineDeal'
        '500':
          $ref: '#/components/responses/Error500'
components:
  schemas:
    CreateCrmPipelineDealBody:
      type: object
      required:
        - title
      properties:
        title:
          type: string
          description: Titulo do negocio.
        stageId:
          type: string
          description: ID do estagio em que o negocio se encontra.
        leadId:
          type: string
          description: ID do lead vinculado ao negocio.
        dealOwner:
          type: string
          description: ID do usuario responsavel pelo negocio.
        value:
          type: number
          description: Valor estimado do negocio.
        status:
          type: string
          description: 'Status do negocio (ex: open, won, lost).'
        expectedCloseDate:
          type: string
          format: date-time
          description: Data prevista de fechamento (ISO 8601).
    CrmPipelineDeal:
      type: object
      properties:
        id:
          type: string
        stageId:
          type: string
          nullable: true
        leadId:
          type: string
          nullable: true
        dealOwner:
          type: string
          nullable: true
        title:
          type: string
        value:
          type: number
          nullable: true
        status:
          type: string
          nullable: true
        expectedCloseDate:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
    ErrorMessage:
      type: object
      properties:
        error:
          type: string
          example: Recurso não encontrado.
  responses:
    Error500:
      description: Erro interno no servidor.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
  securitySchemes:
    Token:
      type: apiKey
      in: header
      name: Token
      description: Token de autenticacao gerado na plataforma WavUps CRM.

````