ZapyFlow/API documentationopenapi.json

Leads

Lead capture

GET/api/leads

List the team's leads

Required scope: leads.read

ParameterInRequired
pagequeryno
limitqueryno
aiAgentIdqueryno
phonequeryno
searchqueryno
dateFromqueryno
dateToqueryno
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

FieldTypeRequiredConstraints
namestringnomax 100
emailstringno—
addressstringnomax 200
tagsstring[]no—
dataobjectno—
aiAgentIdstringyes—
phonestringyesmin 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 — OK
  • 400 — Malformed request
  • 404 — Not found — also returned when the resource belongs to another workspace
  • 409 — Conflict with the current state

GET/api/leads/{id}

One lead in detail

Required scope: leads.read

ParameterInRequired
idpathyes
bash
curl "https://api.zapyflow.com.br/api/leads/{id}" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 404 — Not found — also returned when the resource belongs to another workspace

PATCH/api/leads/{id}

Update a lead

Required scope: leads.write

ParameterInRequired
idpathyes

Request body

FieldTypeRequiredConstraints
namestringnomax 100
emailstringno—
addressstringnomax 200
tagsstring[]no—
dataobjectno—
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 — OK
  • 404 — Not found — also returned when the resource belongs to another workspace

DELETE/api/leads/{id}

Delete a lead

Required scope: leads.write

ParameterInRequired
idpathyes
bash
curl -X DELETE "https://api.zapyflow.com.br/api/leads/{id}" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 404 — Not found — also returned when the resource belongs to another workspace

GET/api/leads/export

Export leads to CSV

Required scope: leads.export

ParameterInRequired
aiAgentIdqueryno
fromqueryno
toqueryno
acknowledgedqueryno
bash
curl "https://api.zapyflow.com.br/api/leads/export" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 400 — Malformed request
  • 428 — Requires an explicit acknowledgement