ZapyFlow/API documentationopenapi.json

CRM

Pipeline, cards and stages

POST/api/crm/cards

Create a card by hand

Required scope: crm.cards.write

Request body

FieldTypeRequiredConstraints
pipelineIdstringyes—
stageIdstringyes—
titlestringyesmin 1, max 200
valuenumber | nullno—
contactPhonestringnomax 30
contactNamestring | nullno—
conversationIdstringnullno—
leadIdstringnullno—
bash
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 — Created
  • 403 — Forbidden, or the key lacks this scope
  • 404 — Not found — also returned when the resource belongs to another workspace
  • 422 — Understood, but rejected by a rule

PATCH/api/crm/cards/{id}

Edit a card

Required scope: crm.cards.write

ParameterInRequired
idpathyes

Request body

FieldTypeRequiredConstraints
titlestringnomin 1, max 200
valuenumber | nullno—
contactNamestring | nullno—
bash
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 — OK
  • 400 — Malformed request
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
idpathyes
bash
curl -X DELETE "https://api.zapyflow.com.br/api/crm/cards/{id}" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 204 — No content
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
idpathyes

Request body

FieldTypeRequiredConstraints
bodystringyesmin 1, max 1000
bash
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 — Created
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
idpathyes

Request body

FieldTypeRequiredConstraints
toStageIdstringyes—
beforeCardIdstringnullno—
afterCardIdstringnullno—
bash
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 — OK
  • 400 — Malformed request
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
pipelineIdqueryyes
filterqueryno
pagequeryno
limitqueryno
bash
curl "https://api.zapyflow.com.br/api/crm/events?pipelineId=..." \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

bash
curl "https://api.zapyflow.com.br/api/crm/pipelines" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 403 — Forbidden, or the key lacks this scope

POST/api/crm/pipelines

Create a pipeline

Required scope: crm.structure.write

Request body

FieldTypeRequiredConstraints
namestringyesmin 1, max 100
bash
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 — Created
  • 403 — Forbidden, or the key lacks this scope
  • 422 — Understood, but rejected by a rule

PATCH/api/crm/pipelines/{id}

Rename a pipeline

Required scope: crm.structure.write

ParameterInRequired
idpathyes

Request body

FieldTypeRequiredConstraints
namestringyesmin 1, max 100
bash
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 — OK
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
idpathyes
bash
curl -X DELETE "https://api.zapyflow.com.br/api/crm/pipelines/{id}" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 204 — No content
  • 400 — Malformed request
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
idpathyes
bash
curl "https://api.zapyflow.com.br/api/crm/pipelines/{id}/board" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
pipelineIdqueryyes
fromqueryno
toqueryno
bash
curl "https://api.zapyflow.com.br/api/crm/reports?pipelineId=..." \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

FieldTypeRequiredConstraints
pipelineIdstringyes—
namestringyesmin 1, max 60
colorstringyes—
bash
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 — Created
  • 403 — Forbidden, or the key lacks this scope
  • 404 — Not found — also returned when the resource belongs to another workspace
  • 422 — Understood, but rejected by a rule

PATCH/api/crm/stages/{id}

Edit a stage

Required scope: crm.structure.write

ParameterInRequired
idpathyes

Request body

FieldTypeRequiredConstraints
namestringnomin 1, max 60
colorstringno—
bash
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 — OK
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
moveCardsToqueryno
idpathyes
bash
curl -X DELETE "https://api.zapyflow.com.br/api/crm/stages/{id}" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 204 — No content
  • 400 — Malformed request
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

ParameterInRequired
offsetqueryno
limitqueryno
idpathyes
bash
curl "https://api.zapyflow.com.br/api/crm/stages/{id}/cards" \
  -H "Authorization: Bearer $ZAPYFLOW_API_KEY"
Responses
  • 200 — OK
  • 403 — Forbidden, or the key lacks this scope
  • 404 — 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

FieldTypeRequiredConstraints
pipelineIdstringyes—
stageIdsstring[]yes≥ 1 items
bash
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 content
  • 400 — Malformed request
  • 403 — Forbidden, or the key lacks this scope
  • 404 — Not found — also returned when the resource belongs to another workspace