Workspace API

Funnels

Funnels endpoints of the Zanfia Workspace API, with schemas and code samples.

5 min readLast updated Sep 10, 2026

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 needs a paid one; webinar is not creatable yet) and also drops the recipe's email sequence in as a draft workflow. Statuses draft / live / archived are all reversible via PATCH. All routes require a Authorization: Bearer header — see Authentication.

List funnels

GET/funnels

Authorization

bearerAuth
AuthorizationBearer <token>

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

POST/funnels

Authorization

bearerAuth
AuthorizationBearer <token>

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"}
{  "error": "string",  "message": "string"}

List funnel templates

GET/funnel-templates

Authorization

bearerAuth
AuthorizationBearer <token>

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

POST/funnels/from-pages

Authorization

bearerAuth
AuthorizationBearer <token>

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

POST/funnels/from-template

Authorization

bearerAuth
AuthorizationBearer <token>

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",    "productId": "string",    "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

GET/funnels/{funnelId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

funnelId*string

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  }}
{  "error": "string",  "message": "string"}

Update a funnel

PATCH/funnels/{funnelId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

funnelId*string

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

DELETE/funnels/{funnelId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

funnelId*string

Funnel id

Response Body

application/json

application/json

curl -X DELETE "https://example.com/funnels/string"
{  "deleted": true}
{  "error": "string",  "message": "string"}

Funnel stats

GET/funnels/{funnelId}/stats

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

funnelId*string

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

POST/funnels/{funnelId}/generate-step-page

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

funnelId*string

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"}

Was this article helpful?

Related articles

Spotted something off? Tell us at support@zanfia.com.