Flows
Conversation flows
GET/api/flows
List an agent's flows
Required scope: flows.read
| Parameter | In | Required |
|---|---|---|
aiAgentId | query | yes |
bash
curl "https://api.zapyflow.com.br/api/flows?aiAgentId=..." \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK
POST/api/flows
Create a conversation flow
Required scope: flows.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
aiAgentId | string | yes | min 1 |
name | string | yes | min 1, max 100 |
trigger | object | yes | — |
steps | object[] | yes | ≥ 1 items, ≤ 100 items |
bash
curl -X POST "https://api.zapyflow.com.br/api/flows" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
201— Created400— Malformed request
GET/api/flows/{id}
One flow in detail
Required scope: flows.read
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl "https://api.zapyflow.com.br/api/flows/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK404— Not found — also returned when the resource belongs to another workspace
PATCH/api/flows/{id}
Update a flow
Required scope: flows.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | no | min 1, max 100 |
trigger | object | no | — |
steps | object[] | no | ≥ 1 items, ≤ 100 items |
active | boolean | no | — |
status | "DRAFT" | "ACTIVE" | "ATTENTION" | "ARCHIVED" | no | — |
bash
curl -X PATCH "https://api.zapyflow.com.br/api/flows/{id}" \
-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 workspace412
DELETE/api/flows/{id}
Delete a flow
Required scope: flows.delete
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl -X DELETE "https://api.zapyflow.com.br/api/flows/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK404— Not found — also returned when the resource belongs to another workspace
PATCH/api/flows/{id}/toggle
Turn a flow on or off
Required scope: flows.publish
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl -X PATCH "https://api.zapyflow.com.br/api/flows/{id}/toggle" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK400— Malformed request404— Not found — also returned when the resource belongs to another workspace
GET/api/flows/overview
Flow KPIs (7 days) and runs per agent
Required scope: flows.read
| Parameter | In | Required |
|---|---|---|
aiAgentId | query | yes |
bash
curl "https://api.zapyflow.com.br/api/flows/overview?aiAgentId=..." \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK404— Not found — also returned when the resource belongs to another workspace