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

# Criar Lead

> Cria um novo lead

## Request Body

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

<ParamField body="email" type="string">
  Email do lead
</ParamField>

<ParamField body="phone" type="string" required>
  Telefone do lead (formato internacional recomendado)
</ParamField>

<ParamField body="company" type="string">
  Empresa do lead
</ParamField>

<ParamField body="status_id" type="string">
  ID do status inicial (usa o status padrão se não informado)
</ParamField>

## Response

<ResponseField name="Lead" type="object">
  O lead criado com todos os campos preenchidos
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.leavo.ai/backend/leads" \
    -H "Authorization: Bearer sua_chave_aqui" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Maria Santos",
      "email": "maria@exemplo.com",
      "phone": "+5511988888888",
      "company": "Tech Corp"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.leavo.ai/backend/leads', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer sua_chave_aqui',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Maria Santos',
      email: 'maria@exemplo.com',
      phone: '+5511988888888',
      company: 'Tech Corp'
    })
  });

  const lead = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.leavo.ai/backend/leads',
      headers={
          'Authorization': 'Bearer sua_chave_aqui',
          'Content-Type': 'application/json'
      },
      json={
          'name': 'Maria Santos',
          'email': 'maria@exemplo.com',
          'phone': '+5511988888888',
          'company': 'Tech Corp'
      }
  )

  lead = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "tenant_id": "660e8400-e29b-41d4-a716-446655440000",
    "name": "Maria Santos",
    "email": "maria@exemplo.com",
    "phone": "+5511988888888",
    "company": "Tech Corp",
    "status_id": "770e8400-e29b-41d4-a716-446655440000",
    "status": {
      "id": "770e8400-e29b-41d4-a716-446655440000",
      "name": "Novo",
      "description": "Lead novo",
      "color": "#007bff",
      "default": true
    },
    "tags": [],
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "success": false,
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Phone number is required"
    }
  }
  ```
</ResponseExample>
