CRM
Pipeline, cards and stages
POST/api/crm/cards
Create a card by hand
Required scope: crm.cards.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
pipelineId | string | yes | — |
stageId | string | yes | — |
title | string | yes | min 1, max 200 |
value | number | null | no | — |
contactPhone | string | no | max 30 |
contactName | string | null | no | — |
conversationId | stringnull | no | — |
leadId | stringnull | no | — |
curl -X POST "https://api.zapyflow.com.br/api/crm/cards" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
201— Created403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace422— Understood, but rejected by a rule
PATCH/api/crm/cards/{id}
Edit a card
Required scope: crm.cards.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
title | string | no | min 1, max 200 |
value | number | null | no | — |
contactName | string | null | no | — |
curl -X PATCH "https://api.zapyflow.com.br/api/crm/cards/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK400— Malformed request403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
DELETE/api/crm/cards/{id}
Delete a card (the timeline keeps the history)
Required scope: crm.cards.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
curl -X DELETE "https://api.zapyflow.com.br/api/crm/cards/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
204— No content403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
POST/api/crm/cards/{id}/comments
Comment on a card (it lands in the event timeline)
Required scope: crm.cards.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
body | string | yes | min 1, max 1000 |
curl -X POST "https://api.zapyflow.com.br/api/crm/cards/{id}/comments" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
201— Created403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
POST/api/crm/cards/{id}/move
Move a card between stages, or reorder it within one
Required scope: crm.cards.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
toStageId | string | yes | — |
beforeCardId | stringnull | no | — |
afterCardId | stringnull | no | — |
curl -X POST "https://api.zapyflow.com.br/api/crm/cards/{id}/move" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK400— Malformed request403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
GET/api/crm/events
Pipeline event timeline (the client groups it by day)
Required scope: crm.read
| Parameter | In | Required |
|---|---|---|
pipelineId | query | yes |
filter | query | no |
page | query | no |
limit | query | no |
curl "https://api.zapyflow.com.br/api/crm/events?pipelineId=..." \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
GET/api/crm/pipelines
List CRM pipelines (creates the default pipeline on first call)
Required scope: crm.read
curl "https://api.zapyflow.com.br/api/crm/pipelines" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK403— Forbidden, or the key lacks this scope
POST/api/crm/pipelines
Create a pipeline
Required scope: crm.structure.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | yes | min 1, max 100 |
curl -X POST "https://api.zapyflow.com.br/api/crm/pipelines" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
201— Created403— Forbidden, or the key lacks this scope422— Understood, but rejected by a rule
PATCH/api/crm/pipelines/{id}
Rename a pipeline
Required scope: crm.structure.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | yes | min 1, max 100 |
curl -X PATCH "https://api.zapyflow.com.br/api/crm/pipelines/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
DELETE/api/crm/pipelines/{id}
Delete a pipeline (the default one cannot be deleted)
Required scope: crm.structure.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
curl -X DELETE "https://api.zapyflow.com.br/api/crm/pipelines/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
204— No content400— Malformed request403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
GET/api/crm/pipelines/{id}/board
The pipeline board: ordered stages with cards, count and total
Required scope: crm.read
| Parameter | In | Required |
|---|---|---|
id | path | yes |
curl "https://api.zapyflow.com.br/api/crm/pipelines/{id}/board" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
GET/api/crm/reports
Pipeline reports: KPIs, funnel, weekly sales, source, cycle
Required scope: analytics.read
| Parameter | In | Required |
|---|---|---|
pipelineId | query | yes |
from | query | no |
to | query | no |
curl "https://api.zapyflow.com.br/api/crm/reports?pipelineId=..." \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
POST/api/crm/stages
Create a stage in the pipeline
Required scope: crm.structure.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
pipelineId | string | yes | — |
name | string | yes | min 1, max 60 |
color | string | yes | — |
curl -X POST "https://api.zapyflow.com.br/api/crm/stages" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
201— Created403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace422— Understood, but rejected by a rule
PATCH/api/crm/stages/{id}
Edit a stage
Required scope: crm.structure.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | no | min 1, max 60 |
color | string | no | — |
curl -X PATCH "https://api.zapyflow.com.br/api/crm/stages/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
DELETE/api/crm/stages/{id}
Delete a stage (empty, or moving its cards to moveCardsTo)
Required scope: crm.structure.write
| Parameter | In | Required |
|---|---|---|
moveCardsTo | query | no |
id | path | yes |
curl -X DELETE "https://api.zapyflow.com.br/api/crm/stages/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
204— No content400— Malformed request403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
GET/api/crm/stages/{id}/cards
A page of cards from one stage (the board's infinite scroll)
Required scope: crm.read
| Parameter | In | Required |
|---|---|---|
offset | query | no |
limit | query | no |
id | path | yes |
curl "https://api.zapyflow.com.br/api/crm/stages/{id}/cards" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
POST/api/crm/stages/reorder
Reorder the pipeline's stages
Required scope: crm.structure.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
pipelineId | string | yes | — |
stageIds | string[] | yes | ≥ 1 items |
curl -X POST "https://api.zapyflow.com.br/api/crm/stages/reorder" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
204— No content400— Malformed request403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace