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

# deal.created

> Disparado quando um novo negócio é criado em qualquer funil de venda.

## Quando ocorre

Este evento é disparado sempre que um negócio é criado — pelo painel, por outro membro da equipe ou via API.

## Casos de uso comuns

* Criar uma oportunidade correspondente no seu CRM externo
* Notificar o responsável de vendas via Slack ou e-mail
* Registrar o lead em uma ferramenta de analytics de pipeline
* Iniciar um fluxo de follow-up automatizado

## Payload completo

```json theme={null}
{
  "id": "evt_01jxa2b3c4d5e6f7g8h9i0j1k",
  "event": "deal.created",
  "organization_id": "664a1b2c3d4e5f6789012345",
  "created_at": "2026-06-10T17:00:00.000Z",
  "data": {
    "id": "664g2h3i4j5k6l7m8n9o0p1q",
    "title": "Proposta Empresa XYZ",
    "value": 500000,
    "currency": "BRL",
    "status": "open",
    "pipeline": {
      "id": "664a1b2c3d4e5f6789012345",
      "name": "Funil Principal"
    },
    "stage": {
      "id": "664e1a2b3c4d5e6f78901230",
      "name": "Novo Lead",
      "order": 0
    },
    "contact": {
      "id": "664f1a2b3c4d5e6f78901234",
      "name": "João Silva",
      "email": "joao@empresa.com.br",
      "phone": "+5511999999999"
    },
    "company": {
      "id": "664b1c2d3e4f5a6789012346",
      "name": "Empresa XYZ"
    },
    "assigned_to": {
      "id": "664a1b2c3d4e5f6789012345",
      "name": "Maria Santos"
    },
    "tags": ["enterprise", "inbound"],
    "custom_fields": {},
    "notes_count": 0,
    "close_date": "2026-07-31T00:00:00.000Z",
    "created_at": "2026-06-10T17:00:00.000Z",
    "updated_at": "2026-06-10T17:00:00.000Z"
  }
}
```

## Referência de campos

| Campo              | Tipo          | Descrição                                     |
| ------------------ | ------------- | --------------------------------------------- |
| `data.id`          | string        | ID do negócio                                 |
| `data.title`       | string        | Título do negócio                             |
| `data.value`       | integer\|null | Valor em centavos                             |
| `data.currency`    | string        | Moeda (`BRL`)                                 |
| `data.status`      | string        | `open` no momento da criação                  |
| `data.pipeline`    | object        | Funil: `{id, name}`                           |
| `data.stage`       | object        | Etapa inicial: `{id, name, order}`            |
| `data.contact`     | object\|null  | Contato vinculado: `{id, name, email, phone}` |
| `data.company`     | object\|null  | Empresa vinculada: `{id, name}`               |
| `data.assigned_to` | object\|null  | Responsável: `{id, name}`                     |
| `data.tags`        | string\[]     | Tags do negócio                               |
| `data.close_date`  | string\|null  | Data de fechamento prevista                   |

## Exemplo de handler

```javascript theme={null}
if (event === 'deal.created') {
  // Criar oportunidade no CRM externo
  await salesforce.opportunities.create({
    name: data.title,
    amount: data.value / 100, // converter centavos para reais
    stage: 'Prospecting',
    closeDate: data.close_date,
    contactId: await salesforce.contacts.findByEmail(data.contact?.email),
    externalId: data.id,
  });

  // Notificar responsável
  if (data.assigned_to) {
    await slack.notify(data.assigned_to.id, {
      text: `Novo negócio criado: "${data.title}" — R$ ${(data.value / 100).toFixed(2)}`
    });
  }
}
```
