Pipelines

URL base da API
https://crm.vdgestaobranding.com/api/v1

A documentação fica em developers.vdgestaobranding.com, mas todas as chamadas vão para crm.vdgestaobranding.com/api/v1.

GET/pipelines
pipelines:read

Listar funis e etapas

curl -X GET "https://crm.vdgestaobranding.com/api/v1/pipelines" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "data": [
    {
      "id": "p1…",
      "name": "Vendas",
      "order": 0,
      "stages": [
        {
          "id": "s1…",
          "name": "Novo",
          "type": "open"
        },
        {
          "id": "s9…",
          "name": "Ganho",
          "type": "won"
        }
      ]
    }
  ]
}
GET/deals
pipelines:read

Listar negócios

  • pipeline_id — Funil.
  • stage_id — Etapa.
  • contact_id — Contato.
  • status — aberto | ganho | perdido.
  • limit — Itens por página (1–100, padrão 25).
  • cursor — Valor de next_cursor da página anterior.
curl -X GET "https://crm.vdgestaobranding.com/api/v1/deals" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "data": [
    {
      "id": "d1…",
      "pipeline_id": "p1…",
      "stage_id": "s1…",
      "contact_id": "c1d2…",
      "title": "Plano anual",
      "value": 4800,
      "owner_id": null,
      "expected_close": "2026-12-01",
      "tags": [],
      "notes": null,
      "status": "aberto",
      "created_at": "2026-11-03T15:00:00Z"
    }
  ],
  "next_cursor": null
}
POST/deals
pipelines:write
Idempotency-Key

Criar negócio

Sem stage_id, entra na primeira etapa do funil. contact_id vincula ao contato.

curl -X POST "https://crm.vdgestaobranding.com/api/v1/deals" \
  -H "Authorization: Bearer $VDCRM_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "pipeline_id": "p1…",
  "title": "Plano anual",
  "value": 4800,
  "contact_id": "c1d2…"
}'
Resposta 201
{
  "id": "d1…",
  "pipeline_id": "p1…",
  "stage_id": "s1…",
  "contact_id": "c1d2…",
  "title": "Plano anual",
  "value": 4800,
  "owner_id": null,
  "expected_close": "2026-12-01",
  "tags": [],
  "notes": null,
  "status": "aberto",
  "created_at": "2026-11-03T15:00:00Z"
}
GET/deals/{id}
pipelines:read

Obter negócio

curl -X GET "https://crm.vdgestaobranding.com/api/v1/deals/{id}" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "d1…",
  "pipeline_id": "p1…",
  "stage_id": "s1…",
  "contact_id": "c1d2…",
  "title": "Plano anual",
  "value": 4800,
  "owner_id": null,
  "expected_close": "2026-12-01",
  "tags": [],
  "notes": null,
  "status": "aberto",
  "created_at": "2026-11-03T15:00:00Z"
}
PATCH/deals/{id}
pipelines:write

Atualizar / vincular contato

curl -X PATCH "https://crm.vdgestaobranding.com/api/v1/deals/{id}" \
  -H "Authorization: Bearer $VDCRM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "value": 5200,
  "contact_id": "c1d2…"
}'
Resposta 200
{
  "id": "d1…",
  "pipeline_id": "p1…",
  "stage_id": "s1…",
  "contact_id": "c1d2…",
  "title": "Plano anual",
  "value": 4800,
  "owner_id": null,
  "expected_close": "2026-12-01",
  "tags": [],
  "notes": null,
  "status": "aberto",
  "created_at": "2026-11-03T15:00:00Z"
}
POST/deals/{id}/move
pipelines:write

Mover de etapa

Dispara o webhook deal.stage_changed.

curl -X POST "https://crm.vdgestaobranding.com/api/v1/deals/{id}/move" \
  -H "Authorization: Bearer $VDCRM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "stage_id": "s2…"
}'
Resposta 200
{
  "id": "d1…",
  "pipeline_id": "p1…",
  "stage_id": "s1…",
  "contact_id": "c1d2…",
  "title": "Plano anual",
  "value": 4800,
  "owner_id": null,
  "expected_close": "2026-12-01",
  "tags": [],
  "notes": null,
  "status": "aberto",
  "created_at": "2026-11-03T15:00:00Z"
}
POST/deals/{id}/win
pipelines:write

Marcar como ganho

curl -X POST "https://crm.vdgestaobranding.com/api/v1/deals/{id}/win" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "d1…",
  "pipeline_id": "p1…",
  "stage_id": "s1…",
  "contact_id": "c1d2…",
  "title": "Plano anual",
  "value": 4800,
  "owner_id": null,
  "expected_close": "2026-12-01",
  "tags": [],
  "notes": null,
  "status": "ganho",
  "created_at": "2026-11-03T15:00:00Z"
}
POST/deals/{id}/lose
pipelines:write

Marcar como perdido

curl -X POST "https://crm.vdgestaobranding.com/api/v1/deals/{id}/lose" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "d1…",
  "pipeline_id": "p1…",
  "stage_id": "s1…",
  "contact_id": "c1d2…",
  "title": "Plano anual",
  "value": 4800,
  "owner_id": null,
  "expected_close": "2026-12-01",
  "tags": [],
  "notes": null,
  "status": "perdido",
  "created_at": "2026-11-03T15:00:00Z"
}
DELETE/deals/{id}
pipelines:write

Excluir negócio

curl -X DELETE "https://crm.vdgestaobranding.com/api/v1/deals/{id}" \
  -H "Authorization: Bearer $VDCRM_API_KEY"