Skip to content
CognizyCognizyHelp
Sign in
In this area

Marketing Funnels

List lead-capture funnels

get/v1/public/marketing-funnels

Parameters

No parameters.

Responses

  • 200

Examples

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/marketing-funnels" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Create a lead-capture funnel

post/v1/public/marketing-funnels

Accepts Idempotency-Key

Parameters

Idempotency-Keystringoptional· header

Body (JSON)required

namestringrequired
descriptionstringoptional
stagesobject[]optional
stages[].idstringoptional
stages[].namestringrequired
stages[].ordernumberrequired
stages[].colorstringoptional
stages[].isInitialbooleanoptional
stages[].isGoalbooleanoptional
staleDaysnumberoptional
Auto-lose cards idle for this many days (null/omitted = disabled).
autoCreateDealbooleanoptional
Ganhar um card cria um negócio no funil de vendas.
dealStageIdstringoptional
Estágio do pipeline onde o negócio nasce (null = primeiro da organização).

Responses

  • 201

Examples

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/marketing-funnels" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Maria Souza",
  "description": "texto",
  "stages": [
    {
      "id": "id_123",
      "name": "Maria Souza",
      "order": 0,
      "color": "texto",
      "isInitial": true,
      "isGoal": true
    }
  ],
  "staleDays": 1,
  "autoCreateDeal": true,
  "dealStageId": "dealStage_123"
}'

Get a funnel lead timeline

get/v1/public/marketing-funnels/leads/{cardId}/timeline

Parameters

cardIdstringrequired· path
Funnel lead/card ID

Responses

  • 200

Examples

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/marketing-funnels/leads/<cardId>/timeline" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Move a funnel lead to another stage

patch/v1/public/marketing-funnels/leads/{cardId}/move

Accepts Idempotency-Key

Parameters

cardIdstringrequired· path
Idempotency-Keystringoptional· header

Body (JSON)required

stageIdstringrequired
positionnumberoptional

Responses

  • 200

Examples

bash
curl -X PATCH "https://api.cognizy.ai/api/v1/public/marketing-funnels/leads/<cardId>/move" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "stageId": "stage_123",
  "position": 0
}'

Update a funnel lead status or value

patch/v1/public/marketing-funnels/leads/{cardId}

Accepts Idempotency-Key

Parameters

cardIdstringrequired· path
Idempotency-Keystringoptional· header

Body (JSON)required

statusstringoptional
ACTIVEWONLOST
lostReasonstringoptional
Why the card was lost (stored when status becomes LOST).
estimatedValuenumberoptional
Valor estimado do lead; vira o valor inicial do negócio ao ganhar o card.

Responses

  • 200

Examples

bash
curl -X PATCH "https://api.cognizy.ai/api/v1/public/marketing-funnels/leads/<cardId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "status": "ACTIVE",
  "lostReason": "texto",
  "estimatedValue": 0
}'

Delete a funnel lead

delete/v1/public/marketing-funnels/leads/{cardId}

Parameters

cardIdstringrequired· path
Idempotency-Keystringoptional· header

Responses

  • 204

Examples

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/marketing-funnels/leads/<cardId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Update a funnel transition rule

patch/v1/public/marketing-funnels/rules/{ruleId}

Accepts Idempotency-Key

Parameters

ruleIdstringrequired· path
Idempotency-Keystringoptional· header

Body (JSON)required

namestringoptional
triggerobjectoptional
fromStageIdstringoptional
toStageIdstringoptional
conditionsobject[]optional
conditions[].fieldstringrequired
messageBodychanneltagNameemailTypeidleDays
conditions[].operatorstringrequired
existsequalsnot_equalscontainsgtelte
conditions[].valueobjectoptional
actionsobject[]optional
actions[].typestringrequired
add_tagsend_webhookmark_lostnotify
actions[].paramsobjectoptional
isActivebooleanoptional
ordernumberoptional

Responses

  • 200

Examples

bash
curl -X PATCH "https://api.cognizy.ai/api/v1/public/marketing-funnels/rules/<ruleId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Maria Souza",
  "trigger": {},
  "fromStageId": "fromStage_123",
  "toStageId": "toStage_123",
  "conditions": [
    {
      "field": "messageBody",
      "operator": "exists",
      "value": {}
    }
  ],
  "actions": [
    {
      "type": "add_tag",
      "params": {}
    }
  ],
  "isActive": true,
  "order": 1
}'

Delete a funnel transition rule

delete/v1/public/marketing-funnels/rules/{ruleId}

Parameters

ruleIdstringrequired· path
Idempotency-Keystringoptional· header

Responses

  • 204

Examples

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/marketing-funnels/rules/<ruleId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Get a funnel stage cadence

get/v1/public/marketing-funnels/stages/{stageId}/cadence

Parameters

stageIdstringrequired· path

Responses

  • 200

Examples

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/marketing-funnels/stages/<stageId>/cadence" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Create or replace a funnel stage cadence

put/v1/public/marketing-funnels/stages/{stageId}/cadence

Parameters

stageIdstringrequired· path
Idempotency-Keystringoptional· header

Body (JSON)required

isActivebooleanoptional
onExhaustobjectrequired
onExhaustStageIdstringoptional
stepsobject[]required
steps[].idstringoptional
steps[].ordernumberrequired
steps[].delayMinutesnumberrequired
Delay from the previous step (or stage entry for the first step), in minutes.
steps[].channelobjectrequired
steps[].subjectstringoptional
steps[].bodystringrequired
steps[].templateIdstringoptional
steps[].isBreakupbooleanoptional

Responses

  • 200

Examples

bash
curl -X PUT "https://api.cognizy.ai/api/v1/public/marketing-funnels/stages/<stageId>/cadence" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "isActive": true,
  "onExhaust": {},
  "onExhaustStageId": "onExhaustStage_123",
  "steps": [
    {
      "id": "id_123",
      "order": 0,
      "delayMinutes": 0,
      "channel": {},
      "subject": "texto",
      "body": "texto",
      "templateId": "template_123",
      "isBreakup": true
    }
  ]
}'

Delete a funnel stage cadence

delete/v1/public/marketing-funnels/stages/{stageId}/cadence

Parameters

stageIdstringrequired· path
Idempotency-Keystringoptional· header

Responses

  • 204

Examples

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/marketing-funnels/stages/<stageId>/cadence" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

List and filter funnel leads

get/v1/public/marketing-funnels/{id}/leads

Parameters

idstringrequired· path
limitnumberoptional· query
pagenumberoptional· query
inactiveDaysnumberoptional· query
campaignIdstringoptional· query
minLeadScorenumberoptional· query
statusACTIVE | WON | LOST | STALLEDoptional· query
stageIdstringoptional· query

Responses

  • 200

Examples

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>/leads" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Create a lead in a funnel

post/v1/public/marketing-funnels/{id}/leads

Accepts Idempotency-Key

Parameters

idstringrequired· path
Idempotency-Keystringoptional· header

Body (JSON)required

contactIdstringrequired
stageIdstringoptional
campaignIdstringoptional
estimatedValuenumberoptional
Valor estimado do lead; vira o valor inicial do negócio ao ganhar o card.

Responses

  • 201

Examples

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>/leads" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "contactId": "contact_123",
  "stageId": "stage_123",
  "campaignId": "campaign_123",
  "estimatedValue": 0
}'

Get deterministic funnel insights

get/v1/public/marketing-funnels/{id}/insights

Parameters

idstringrequired· path

Responses

  • 200

Examples

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>/insights" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

List funnel transition rules

get/v1/public/marketing-funnels/{id}/rules

Parameters

idstringrequired· path

Responses

  • 200

Examples

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>/rules" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Create a funnel transition rule

post/v1/public/marketing-funnels/{id}/rules

Accepts Idempotency-Key

Parameters

idstringrequired· path
Idempotency-Keystringoptional· header

Body (JSON)required

namestringrequired
triggerobjectrequired
fromStageIdstringoptional
toStageIdstringrequired
conditionsobject[]optional
conditions[].fieldstringrequired
messageBodychanneltagNameemailTypeidleDays
conditions[].operatorstringrequired
existsequalsnot_equalscontainsgtelte
conditions[].valueobjectoptional
actionsobject[]optional
actions[].typestringrequired
add_tagsend_webhookmark_lostnotify
actions[].paramsobjectoptional
ordernumberoptional

Responses

  • 201

Examples

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>/rules" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Maria Souza",
  "trigger": {},
  "fromStageId": "fromStage_123",
  "toStageId": "toStage_123",
  "conditions": [
    {
      "field": "messageBody",
      "operator": "exists",
      "value": {}
    }
  ],
  "actions": [
    {
      "type": "add_tag",
      "params": {}
    }
  ],
  "order": 1
}'

Get a lead-capture funnel

get/v1/public/marketing-funnels/{id}

Parameters

idstringrequired· path

Responses

  • 200

Examples

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Update a lead-capture funnel

patch/v1/public/marketing-funnels/{id}

Accepts Idempotency-Key

Parameters

idstringrequired· path
Idempotency-Keystringoptional· header

Body (JSON)required

namestringoptional
descriptionstringoptional
isActivebooleanoptional
staleDaysnumberoptional
Auto-lose cards idle for this many days; null disables the behavior.
autoCreateDealbooleanoptional
Ganhar um card cria um negócio no funil de vendas.
dealStageIdstringoptional
Estágio do pipeline onde o negócio nasce (null = primeiro da organização).
stagesobject[]optional
Full replace of the stage set (creates/updates/removes to match).
stages[].idstringoptional
stages[].namestringrequired
stages[].ordernumberrequired
stages[].colorstringoptional
stages[].isInitialbooleanoptional
stages[].isGoalbooleanoptional

Responses

  • 200

Examples

bash
curl -X PATCH "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Maria Souza",
  "description": "texto",
  "isActive": true,
  "staleDays": 1,
  "autoCreateDeal": true,
  "dealStageId": "dealStage_123",
  "stages": [
    {
      "id": "id_123",
      "name": "Maria Souza",
      "order": 0,
      "color": "texto",
      "isInitial": true,
      "isGoal": true
    }
  ]
}'

Delete a lead-capture funnel

delete/v1/public/marketing-funnels/{id}

Parameters

idstringrequired· path
Idempotency-Keystringoptional· header

Responses

  • 204

Examples

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/marketing-funnels/<id>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Full reference