Negócios (Deals)
Gerenciar pipeline comercial via API.
Negócios (Deals)
Gerencie o pipeline comercial da sua agência. Negócios representam oportunidades de venda — desde o primeiro contato até o fechamento.
GET /v1/deals
Lista todos os negócios do time.
Query Parameters
| Parâmetro | Tipo | Padrão | Descrição |
|---|---|---|---|
page | number | 1 | Página atual |
limit | number | 20 | Itens por página (máx: 100) |
status | string | — | Filtrar: ativo, arquivado |
phase | string | — | Filtrar por fase do pipeline |
client_id | string | — | Filtrar por cliente |
responsible_id | string | — | Filtrar por responsável |
source | string | — | Filtrar por origem |
min_value | number | — | Valor mínimo |
max_value | number | — | Valor máximo |
from | string | — | Data criação inicial (YYYY-MM-DD) |
to | string | — | Data criação final (YYYY-MM-DD) |
search | string | — | Buscar por título ou descrição |
sort | string | -created_at | Campos: title, value, phase, created_at, updated_at, expected_close_date |
Request
curl -X GET "https://app.sonar.marketing/api/v1/deals?status=ativo&min_value=5000" \
-H "Authorization: Bearer snr_live_sua_chave_aqui"Response
{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Gestão de Redes Sociais - TechStore",
"description": "Proposta para gestão completa de redes sociais",
"value": 8000.00,
"currency": "BRL",
"phase": "proposta",
"priority": "alta",
"status": "ativo",
"probability": 70,
"expected_close_date": "2026-03-15",
"source": "indicacao",
"tags": ["social-media"],
"is_starred": false,
"client_id": "cli-uuid",
"client": {
"id": "cli-uuid",
"name": "TechStore Brasil Ltda"
},
"responsible_id": "user-uuid",
"ai_summary": null,
"ai_win_probability": null,
"created_at": "2026-02-15T10:30:00Z",
"updated_at": "2026-03-04T14:20:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"pages": 3
}
}POST /v1/deals
Cria um novo negócio. Dispara workflows automáticos configurados no time.
Request Body
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
title | string | Sim | Título do negócio |
description | string | Não | Descrição |
value | number | Não | Valor em BRL |
phase | string | Não | Fase do pipeline (padrão: lead) |
priority | string | Não | alta, media, baixa (padrão: media) |
expected_close_date | string | Não | Data prevista YYYY-MM-DD |
probability | number | Não | Probabilidade de ganho (0-100) |
responsible_id | string | Não | UUID do responsável |
source | string | Não | Origem do lead |
client_id | string | Não | UUID do cliente |
tags | array | Não | Tags |
Request
curl -X POST https://app.sonar.marketing/api/v1/deals \
-H "Authorization: Bearer snr_live_sua_chave_aqui" \
-H "Content-Type: application/json" \
-d '{
"title": "Gestão de Redes Sociais - TechStore",
"value": 8000,
"priority": "alta",
"probability": 70,
"client_id": "cli-uuid",
"source": "indicacao"
}'Response (201)
Retorna o objeto do negócio com client nested.
A criação de um deal dispara automaticamente os workflows configurados para o evento deal_created.
GET /v1/deals/:id
Busca um negócio por UUID.
PUT /v1/deals/:id
Atualiza campos de um negócio. Campos aceitos: title, description, value, phase, priority, status, probability, expected_close_date, responsible_id, source, client_id, loss_reason, tags, is_starred.
Alterar a phase dispara automaticamente o workflow deal_stage_changed.
DELETE /v1/deals/:id
Arquiva o negócio (seta status = arquivado).
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "arquivado",
"archived_at": "2026-03-04T15:30:00Z"
}
}