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

> Cria um novo lead para a conta autenticada.

## Requisição

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

### Body

<ParamField body="name" type="string" required>
  Nome do lead.
</ParamField>

<ParamField body="email" type="string">
  E-mail do lead.
</ParamField>

<ParamField body="phone" type="string">
  Telefone do lead.

  <Warning>
    O número deve estar no formato **`5547999999999`** (código do país + DDD + número, sem espaços, traços ou parênteses). Qualquer outro formato — como `47 999999999` ou `(47) 99999-9999` — causará erros nos disparos via WhatsApp.
  </Warning>
</ParamField>

<ParamField body="taxId" type="string">
  CPF/CNPJ do lead.
</ParamField>

<ParamField body="source" type="string">
  Origem do lead (ex: `site`, `instagram`, `indicacao`).
</ParamField>

<ParamField body="leadOwner" type="string">
  ID do usuário responsável pelo lead.
</ParamField>

<ParamField body="profileImage" type="string">
  URL da imagem de perfil do lead.
</ParamField>

<ParamField body="zipCode" type="string">
  CEP do endereço do lead.
</ParamField>

<ParamField body="state" type="string">
  Estado do lead.
</ParamField>

<ParamField body="city" type="string">
  Cidade do lead.
</ParamField>

<ParamField body="neighborhood" type="string">
  Bairro do lead.
</ParamField>

<ParamField body="streetAddress" type="string">
  Logradouro do lead.
</ParamField>

<ParamField body="number" type="string">
  Número do endereço.
</ParamField>

<ParamField body="complement" type="string">
  Complemento do endereço.
</ParamField>

<ParamField body="description" type="string">
  Descrição ou observações sobre o lead.
</ParamField>

<ParamField body="leadType" type="string">
  Tipo do lead (ex: `PF`, `PJ`).
</ParamField>

<ParamField body="leadTemperature" type="number">
  Temperatura do lead como valor numérico.
</ParamField>

<ParamField body="metadata" type="object">
  Metadados adicionais do lead em formato JSON.
</ParamField>

<ParamField body="utms" type="object">
  Parâmetros UTM associados ao lead em formato JSON. O objeto enviado deve conter as seguintes propriedades:

  * **`utm_source`** (string): Origem do tráfego (ex: `fb`, `google`, `instagram`).
  * **`utm_medium`** (string): Meio do tráfego (ex: `paid`, `cpc`, `organic`, `story`).
  * **`utm_campaign`** (string): Identificador ou nome da campanha (ex: `120243645529690704`).
  * **`utm_term`** (string): Termo de pesquisa ou identificador de público/anúncio (ex: `120243645529720704`).
  * **`utm_content`** (string): Conteúdo do anúncio ou identificador do criativo (ex: `120247590343130704`).

  **Exemplo:**

  ```json theme={null}
  {
    "utm_source": "fb",
    "utm_medium": "paid",
    "utm_campaign": "120243645529690704",
    "utm_term": "120243645529720704",
    "utm_content": "120247590343130704"
  }
  ```
</ParamField>

<ParamField body="status" type="string">
  Status inicial do lead. Padrão: `Lead`.
</ParamField>

***

## Resposta

Retorna o objeto do lead criado com todos os campos, incluindo o `accountId`.

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

<ResponseField name="accountId" type="string">
  ID da conta à qual o lead pertence.
</ResponseField>

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

<ResponseField name="name" type="string">
  Nome do lead.
</ResponseField>

<ResponseField name="email" type="string | null">
  E-mail do lead.
</ResponseField>

<ResponseField name="phone" type="string | null">
  Telefone do lead.
</ResponseField>

<ResponseField name="taxId" type="string | null">
  CPF/CNPJ do lead.
</ResponseField>

<ResponseField name="source" type="string | null">
  Origem do lead.
</ResponseField>

<ResponseField name="profileImage" type="string | null">
  URL da imagem de perfil.
</ResponseField>

<ResponseField name="zipCode" type="string | null">
  CEP.
</ResponseField>

<ResponseField name="state" type="string | null">
  Estado.
</ResponseField>

<ResponseField name="city" type="string | null">
  Cidade.
</ResponseField>

<ResponseField name="neighborhood" type="string | null">
  Bairro.
</ResponseField>

<ResponseField name="streetAddress" type="string | null">
  Logradouro.
</ResponseField>

<ResponseField name="number" type="string | null">
  Número do endereço.
</ResponseField>

<ResponseField name="complement" type="string | null">
  Complemento.
</ResponseField>

<ResponseField name="description" type="string | null">
  Descrição ou observações.
</ResponseField>

<ResponseField name="leadType" type="string | null">
  Tipo do lead.
</ResponseField>

<ResponseField name="leadTemperature" type="number | null">
  Temperatura do lead: `1` (Frio), `2` (Morno) ou `3` (Quente).
</ResponseField>

<ResponseField name="metadata" type="object | null">
  Metadados adicionais do lead em formato JSON.
</ResponseField>

<ResponseField name="utms" type="object | null">
  Parâmetros UTM associados ao lead em formato JSON.
</ResponseField>

<ResponseField name="status" type="string">
  Status do lead.
</ResponseField>

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

<ResponseField name="updatedAt" type="string">
  Data da última atualização (ISO 8601).
</ResponseField>

***

## Exemplos

<RequestExample>
  ```bash POST /api/v1/lead theme={null}
  curl --request POST \
    --url 'https://crm.wavups.com/api/v1/lead' \
    --header 'Token: SEU_TOKEN_DE_API' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "Maria Souza",
      "email": "maria@email.com",
      "phone": "5511988887777",
      "taxId": "12345678909",
      "source": "site",
      "leadType": "PF",
      "leadTemperature": 3,
      "utms": {
        "utm_source": "fb",
        "utm_medium": "paid",
        "utm_campaign": "120243645529690704",
        "utm_term": "120243645529720704",
        "utm_content": "120247590343130704"
      },
      "status": "Lead"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "clxyz5678",
    "leadOwner": null,
    "name": "Maria Souza",
    "email": "maria@email.com",
    "phone": "5511988887777",
    "taxId": "12345678909",
    "source": "site",
    "profileImage": null,
    "zipCode": null,
    "state": null,
    "city": null,
    "neighborhood": null,
    "streetAddress": null,
    "number": null,
    "complement": null,
    "description": null,
    "leadType": "PF",
    "leadTemperature": 3,
    "metadata": null,
    "utms": {
      "utm_source": "fb",
      "utm_medium": "paid",
      "utm_campaign": "120243645529690704",
      "utm_term": "120243645529720704",
      "utm_content": "120247590343130704"
    },
    "status": "Lead",
    "createdAt": "2025-06-15T14:30:00.000Z",
    "updatedAt": "2025-06-15T14:30:00.000Z"
  }
  ```

  ```json 500 theme={null}
  {
    "error": "Error to create lead"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /lead
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:
  /lead:
    post:
      tags:
        - Leads
      summary: Criar Lead
      description: Cria um novo lead para a conta autenticada.
      operationId: createLead
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLeadBody'
      responses:
        '201':
          description: Lead criado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
        '500':
          $ref: '#/components/responses/Error500'
components:
  schemas:
    CreateLeadBody:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Nome do lead.
        email:
          type: string
          description: E-mail do lead.
        phone:
          type: string
          description: >-
            Telefone no formato internacional sem simbolos: 5547999999999 (pais
            + DDD + numero). Outros formatos causarao erros nos disparos via
            WhatsApp.
          example: '5547999999999'
        taxId:
          type: string
          description: CPF ou CNPJ do lead.
          example: '12345678909'
        source:
          type: string
          description: 'Origem do lead (ex: site, instagram, indicacao).'
        leadOwner:
          type: string
          description: ID do usuario responsavel pelo lead.
        profileImage:
          type: string
          description: URL da imagem de perfil do lead.
        zipCode:
          type: string
          description: CEP do endereco.
        state:
          type: string
          description: Estado.
        city:
          type: string
          description: Cidade.
        neighborhood:
          type: string
          description: Bairro.
        streetAddress:
          type: string
          description: Logradouro.
        number:
          type: string
          description: Numero do endereco.
        complement:
          type: string
          description: Complemento do endereco.
        description:
          type: string
          description: Descricao ou observacoes sobre o lead.
        leadType:
          type: string
          description: 'Tipo do lead (ex: PF, PJ).'
        leadTemperature:
          type: integer
          enum:
            - 1
            - 2
            - 3
          description: 'Temperatura do lead: 1 (Frio), 2 (Morno), 3 (Quente).'
        status:
          type: string
          description: 'Status inicial do lead. Padrao: Lead.'
        metadata:
          type: object
          description: Metadados adicionais do lead em formato JSON.
          nullable: true
        utms:
          type: object
          description: Parâmetros UTM associados ao lead em formato JSON.
          nullable: true
          properties:
            utm_source:
              type: string
              description: 'Origem do tráfego (ex: fb, google, instagram).'
              example: fb
            utm_medium:
              type: string
              description: 'Meio do tráfego (ex: paid, cpc, organic, story).'
              example: paid
            utm_campaign:
              type: string
              description: Identificador ou nome da campanha.
              example: '120243645529690704'
            utm_term:
              type: string
              description: Termo de pesquisa ou identificador de público/anúncio.
              example: '120243645529720704'
            utm_content:
              type: string
              description: Conteúdo do anúncio ou identificador do criativo.
              example: '120247590343130704'
    Lead:
      type: object
      properties:
        id:
          type: string
        leadOwner:
          type: string
          nullable: true
        name:
          type: string
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
          description: >-
            Telefone no formato 5547999999999 (pais + DDD + numero, sem espacos
            ou simbolos).
          example: '5547999999999'
        taxId:
          type: string
          nullable: true
          description: CPF ou CNPJ do lead.
          example: '12345678909'
        source:
          type: string
          nullable: true
        profileImage:
          type: string
          nullable: true
        zipCode:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        neighborhood:
          type: string
          nullable: true
        streetAddress:
          type: string
          nullable: true
        number:
          type: string
          nullable: true
        complement:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        leadType:
          type: string
          nullable: true
        leadTemperature:
          type: number
          nullable: true
          description: 'Temperatura do lead: 1 (Frio), 2 (Morno), 3 (Quente).'
        status:
          type: string
        metadata:
          type: object
          description: Metadados adicionais do lead em formato JSON.
          nullable: true
        utms:
          type: object
          description: Parâmetros UTM associados ao lead em formato JSON.
          nullable: true
          properties:
            utm_source:
              type: string
              description: 'Origem do tráfego (ex: fb, google, instagram).'
              example: fb
            utm_medium:
              type: string
              description: 'Meio do tráfego (ex: paid, cpc, organic, story).'
              example: paid
            utm_campaign:
              type: string
              description: Identificador ou nome da campanha.
              example: '120243645529690704'
            utm_term:
              type: string
              description: Termo de pesquisa ou identificador de público/anúncio.
              example: '120243645529720704'
            utm_content:
              type: string
              description: Conteúdo do anúncio ou identificador do criativo.
              example: '120247590343130704'
        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.

````