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

# Atualizar Lead

> Atualiza um lead existente

## Path Parameters

<ParamField path="id" type="string" required>
  UUID do lead
</ParamField>

## Request Body

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

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

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

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

<Note>
  Envie apenas os campos que deseja atualizar.
</Note>

## Response

<ResponseField name="Lead" type="object">
  O lead atualizado
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT "https://api.leavo.ai/backend/leads/550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer sua_chave_aqui" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "João Silva Atualizado",
      "company": "Nova Empresa"
    }'
  ```

  ```javascript JavaScript theme={null}
  const leadId = '550e8400-e29b-41d4-a716-446655440000';

  const response = await fetch(`https://api.leavo.ai/backend/leads/${leadId}`, {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer sua_chave_aqui',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'João Silva Atualizado',
      company: 'Nova Empresa'
    })
  });

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

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

  lead_id = '550e8400-e29b-41d4-a716-446655440000'

  response = requests.put(
      f'https://api.leavo.ai/backend/leads/{lead_id}',
      headers={
          'Authorization': 'Bearer sua_chave_aqui',
          'Content-Type': 'application/json'
      },
      json={
          'name': 'João Silva Atualizado',
          'company': 'Nova Empresa'
      }
  )

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

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "tenant_id": "660e8400-e29b-41d4-a716-446655440000",
    "name": "João Silva Atualizado",
    "email": "joao@exemplo.com",
    "phone": "+5511999999999",
    "company": "Nova Empresa",
    "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-01T00:00:00Z",
    "updated_at": "2024-01-15T11:00:00Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "error": {
      "code": "NOT_FOUND",
      "message": "Lead not found"
    }
  }
  ```
</ResponseExample>
