Workspace API

Funnels

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

3 min readLast updated Jul 26, 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": "opt_in_page",          "name": "string",          "ref": {            "pageId": "string",            "checkoutId": "string",            "formId": "string",            "otoOfferId": "string"          },          "slug": "string",          "status": "ready"        }      ],      "workflowIds": [        "string"      ],      "productIds": [        "string"      ],      "createdAt": 0,      "updatedAt": 0    }  ]}
{  "error": "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"}

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": "opt_in_page",        "name": "string",        "ref": {          "pageId": "string",          "checkoutId": "string",          "formId": "string",          "otoOfferId": "string"        },        "slug": "string",        "status": "ready"      }    ],    "workflowIds": [      "string"    ],    "productIds": [      "string"    ],    "createdAt": 0,    "updatedAt": 0  }}
{  "error": "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"}

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

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"  }'
{  "pageId": "string",  "slug": "string"}
{  "error": "string"}

Was this article helpful?

Related articles

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