Leads
✅ Validado (off-chain / infra)
Suite plataforma — create (público) + list/stats/get/update/delete (admin) validados.
Gerada automaticamente do spec OpenAPI da API (fonte de verdade). 7 endpoint(s).
List leads
GET /v1/leads
Admin: list all studio leads (requires x-admin-secret)
Auth: pública / api-key
Query params:
| Param | Tipo | Obrigatório |
|---|---|---|
limit | number | não |
offset | number | não |
sort | string | não |
order | asc | desc | não |
status | string | não |
search | string | não |
Respostas: 200, 403
Create studio lead
POST /v1/leads
Public endpoint — captures a lead from the studio quiz. Requires explicit consent: true (LGPD).
Auth: pública / api-key
Request body:
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
consent | boolean | sim | |
name | string | sim | |
email | string (email) | sim | |
phone | string | não | |
company | string | não | |
preferred_contact | email | whatsapp | phone | não | |
quiz_answers | object | não | |
diagnosis | object | não | |
source | string | não |
Respostas: 201, 400
Get lead
GET /v1/leads/{id}
Admin: get a single lead detail (requires x-admin-secret)
Auth: pública / api-key
Path params: id
Respostas: 200, 404
Update lead
POST /v1/leads/{id}
Admin: update lead status or notes (requires x-admin-secret)
Auth: pública / api-key
Path params: id
Request body:
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
status | new | contacted | qualified | converted | lost | não | |
notes | string | não |
Respostas: 200, 201, 404
Update lead (PATCH legacy)
PATCH /v1/leads/{id}
Auth: pública / api-key
Path params: id
Request body:
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
status | new | contacted | qualified | converted | lost | não | |
notes | string | não |
Respostas: 200
Delete lead
DELETE /v1/leads/{id}
Admin: permanently delete a lead (requires x-admin-secret)
Auth: pública / api-key
Path params: id
Respostas: 204, 404
Lead stats
GET /v1/leads/stats
Admin: lead count by status (requires x-admin-secret)
Auth: pública / api-key
Respostas: 200