Funnels
Funnels endpoints of the Zanfia Workspace API, with schemas and code samples.
Marketing funnels: named step chains that reference existing checkouts, pages, and workflows — a funnel never owns the artifacts its steps point to, and deleting one leaves them untouched. Create is recipe-first over a product's existing artifacts (lead_magnet / tripwire need a free checkout, sell_product / low_ticket a paid one, webinar any product: three empty page steps you generate next with the event date) and also drops the recipe's email sequence in as a draft workflow. from-template creates the funnel and generates its pages in one go. Statuses draft / live / archived are all reversible via PATCH. All routes require a Authorization: Bearer header — see Authentication.
List funnels
/funnelsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/funnels"{ "funnels": [ { "id": "string", "name": "string", "recipe": "lead_magnet", "status": "draft", "steps": [ { "stepId": "string", "type": "lead-magnet", "name": "string", "ref": { "pageId": "string", "checkoutId": "string", "formId": "string", "otoOfferId": "string" }, "slug": "string", "status": "ready" } ], "workflowIds": [ "string" ], "productIds": [ "string" ], "challenge": { "startAt": 0, "timezone": "string", "days": 0, "courseProductId": "string", "courseId": "string", "registrationCheckoutId": "string", "pitchProductId": "string", "pitchCheckoutId": "string", "cartClosesAt": 0, "deadlineApplied": true, "missions": [ { "day": 0, "moduleId": "string", "lessonId": "string", "unlockAt": 0 } ], "campaigns": [ { "campaignId": "string", "kind": "kickoff", "day": 0, "sendAt": 0 } ] }, "createdAt": 0, "updatedAt": 0 } ]}{ "error": "string", "message": "string"}Create a funnel from a recipe
/funnelsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Create a funnel from a recipe — resolves the product's existing artifacts (free/paid checkouts, OTO chain) into the step list and generates the recipe's email sequence as a DRAFT workflow. See FunnelDocument.
Response Body
application/json
application/json
curl -X POST "https://example.com/funnels" \ -H "Content-Type: application/json" \ -d '{ "recipe": "lead_magnet", "productId": "string", "lang": "en" }'{ "funnelId": "string", "note": "string"}{ "error": "string", "message": "string"}List funnel templates
/funnel-templatesAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/funnel-templates"{ "templates": [ { "id": "squeeze", "recipe": "lead_magnet", "name": "string", "namePl": "string", "description": "string", "descriptionPl": "string", "requirement": "free_checkout", "available": true, "steps": [ { "type": "lead-magnet", "name": "string", "namePl": "string" } ] } ]}{ "error": "string", "message": "string"}Create a funnel from existing pages
/funnels/from-pagesAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A funnel record over existing hosted pages (visitor order; the first is the entry).
Response Body
application/json
application/json
curl -X POST "https://example.com/funnels/from-pages" \ -H "Content-Type: application/json" \ -d '{ "pageIds": [ "string" ] }'{ "funnelId": "string"}{ "error": "string", "message": "string"}Create a funnel from a template
/funnels/from-templateAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
POST /funnels/from-template — the server-side "Use funnel template" flow: creates the funnel from the template's recipe over the product's existing checkouts, drops the recipe's email sequence in as a draft workflow, and enqueues an AI page generation for every page step.
Response Body
application/json
application/json
curl -X POST "https://example.com/funnels/from-template" \ -H "Content-Type: application/json" \ -d '{ "templateId": "squeeze", "lang": "en" }'{ "funnel": { "id": "string", "name": "string", "recipe": "lead_magnet", "status": "draft", "steps": [ { "stepId": "string", "type": "lead-magnet", "name": "string", "ref": { "pageId": "string", "checkoutId": "string", "formId": "string", "otoOfferId": "string" }, "slug": "string", "status": "ready" } ], "workflowIds": [ "string" ], "productIds": [ "string" ], "challenge": { "startAt": 0, "timezone": "string", "days": 0, "courseProductId": "string", "courseId": "string", "registrationCheckoutId": "string", "pitchProductId": "string", "pitchCheckoutId": "string", "cartClosesAt": 0, "deadlineApplied": true, "missions": [ { "day": 0, "moduleId": "string", "lessonId": "string", "unlockAt": 0 } ], "campaigns": [ { "campaignId": "string", "kind": "kickoff", "day": 0, "sendAt": 0 } ] }, "createdAt": 0, "updatedAt": 0 }, "generations": [ { "stepId": "string", "stepName": "string", "runId": "string" } ], "skippedSteps": [ { "stepId": "string", "reason": "already_has_page" } ]}{ "error": "string", "message": "string"}Get a funnel
/funnels/{funnelId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Funnel id
Response Body
application/json
application/json
curl -X GET "https://example.com/funnels/string"{ "funnel": { "id": "string", "name": "string", "recipe": "lead_magnet", "status": "draft", "steps": [ { "stepId": "string", "type": "lead-magnet", "name": "string", "ref": { "pageId": "string", "checkoutId": "string", "formId": "string", "otoOfferId": "string" }, "slug": "string", "status": "ready" } ], "workflowIds": [ "string" ], "productIds": [ "string" ], "challenge": { "startAt": 0, "timezone": "string", "days": 0, "courseProductId": "string", "courseId": "string", "registrationCheckoutId": "string", "pitchProductId": "string", "pitchCheckoutId": "string", "cartClosesAt": 0, "deadlineApplied": true, "missions": [ { "day": 0, "moduleId": "string", "lessonId": "string", "unlockAt": 0 } ], "campaigns": [ { "campaignId": "string", "kind": "kickoff", "day": 0, "sendAt": 0 } ] }, "createdAt": 0, "updatedAt": 0 }, "event": { "pageId": "string", "mode": "live", "startAt": "string", "timezone": "string", "durationMinutes": 0, "joinUrl": "string", "replayUrl": "string", "liveRoomId": "string", "rungs": [ { "kind": "day_before", "broadcastId": "string", "sendAt": "string", "status": "draft" } ] }}{ "error": "string", "message": "string"}Update a funnel
/funnels/{funnelId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Funnel id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Partial funnel update — rename, status transition, step re-wiring.
Response Body
application/json
application/json
curl -X PATCH "https://example.com/funnels/string" \ -H "Content-Type: application/json" \ -d '{}'{ "updated": true}{ "error": "string", "message": "string"}Delete a funnel
/funnels/{funnelId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Funnel id
Response Body
application/json
application/json
curl -X DELETE "https://example.com/funnels/string"{ "deleted": true}{ "error": "string", "message": "string"}Funnel stats
/funnels/{funnelId}/statsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Funnel id
Response Body
application/json
application/json
curl -X GET "https://example.com/funnels/string/stats"{ "funnelId": "string", "since": "string", "steps": [ { "stepId": "string", "views": 0, "entries": 0, "signups": 0, "sessions": 0, "completed": 0, "otoViewed": 0, "otoAccepted": 0 } ], "totals": { "entryViews": 0, "signups": 0, "purchases": 0 }, "challenge": { "participants": 0, "missions": [ { "day": 0, "lessonId": "string", "completed": 0 } ] }}{ "error": "string", "message": "string"}Generate a page for a funnel step
/funnels/{funnelId}/generate-step-pageAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Funnel id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Generate a hosted page for one page-type funnel step (opt-in / sales / thank-you) via the unified page-generation pipeline, grounded in the funnel's product + the step's checkout, then wire the step to the draft (ref.pageId + slug). One step per call — generation takes minutes.
Response Body
application/json
application/json
curl -X POST "https://example.com/funnels/string/generate-step-page" \ -H "Content-Type: application/json" \ -d '{ "stepId": "string", "lang": "en" }'{ "runId": "string", "publicAccessToken": "string"}{ "error": "string", "message": "string"}Add a one-time-offer page after a signup step
This route needs two scopes, products:write and pages:write, because it creates a page and rewrites the signup page. A scoped key with products:write only answers 403 insufficient-scope; keys created before scopes existed keep their reach.
/funnels/{funnelId}/offer-pageAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Funnel id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
POST /funnels/:funnelId/offer-page: a designed one-time-offer page right after a signup step (the panel's „Oferta” step, the assistant's add-funnel-offer-page, the Workspace API / MCP / CLI). The page is built from the Glass tripwire template in the signup page's colors, its offer block wired to the koszyk (accept, pays on the page) and the next step (decline, 30-minute timer); created as a DRAFT the creator edits and publishes. No AI, no credits.
Response Body
application/json
application/json
curl -X POST "https://example.com/funnels/string/offer-page" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": "string", "layout": "digital" }'{ "pageId": "string", "slug": "string", "stepId": "string", "title": "string", "afterStepId": "string"}{ "error": "string", "message": "string"}Was this article helpful?

