Leads
Lead capture
GET/api/leads
List the team's leads
Required scope: leads.read
| Parameter | In | Required |
|---|---|---|
page | query | no |
limit | query | no |
aiAgentId | query | no |
phone | query | no |
search | query | no |
dateFrom | query | no |
dateTo | query | no |
bash
curl "https://api.zapyflow.com.br/api/leads" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK
POST/api/leads
Create a lead by hand
Required scope: leads.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | no | max 100 |
email | string | no | — |
address | string | no | max 200 |
tags | string[] | no | — |
data | object | no | — |
aiAgentId | string | yes | — |
phone | string | yes | min 8, max 30 |
bash
curl -X POST "https://api.zapyflow.com.br/api/leads" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK400— Malformed request404— Not found — also returned when the resource belongs to another workspace409— Conflict with the current state
GET/api/leads/{id}
One lead in detail
Required scope: leads.read
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl "https://api.zapyflow.com.br/api/leads/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK404— Not found — also returned when the resource belongs to another workspace
PATCH/api/leads/{id}
Update a lead
Required scope: leads.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | no | max 100 |
email | string | no | — |
address | string | no | max 200 |
tags | string[] | no | — |
data | object | no | — |
bash
curl -X PATCH "https://api.zapyflow.com.br/api/leads/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK404— Not found — also returned when the resource belongs to another workspace
DELETE/api/leads/{id}
Delete a lead
Required scope: leads.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl -X DELETE "https://api.zapyflow.com.br/api/leads/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK404— Not found — also returned when the resource belongs to another workspace
GET/api/leads/export
Export leads to CSV
Required scope: leads.export
| Parameter | In | Required |
|---|---|---|
aiAgentId | query | no |
from | query | no |
to | query | no |
acknowledged | query | no |
bash
curl "https://api.zapyflow.com.br/api/leads/export" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK400— Malformed request428— Requires an explicit acknowledgement