Skip to main content

Get Funnel HTML

Downloads one revision of an AI/HTML funnel as an HTML file: the current draft, the one last published, or any earlier one from List Funnel Revisions. It is the same document the editor and the MCP tool get_funnel_html read, so you can edit it and write it back with the MCP's request_html_upload in mode exact.

GET /v1/funnels/{funnelId}/html

:::note Rolling out Revision history is being enabled workspace by workspace. Until it is enabled for yours, this route answers 404. :::

Authentication​

A signed-in user only, as for List Funnel Revisions: Authorization: Bearer <access token>. An API key is refused with 403.

Parameters​

NameInTypeRequiredDescription
funnelIdpathstringYesID of an AI/HTML funnel.
revisionqueryinteger | current | liveNoA revision number, current (the default: the latest save) or live (the revision marked live: the one last published).
versionqueryoriginal | variantNoOn a funnel with an A/B test, which version (default original). A variant's revisions carry the funnel's shared identity (title, sharing tags, cookie consent) as it is now, as the editor shows them.

Example request​

curl -OJ "https://api.perspective.co/v1/funnels/$FUNNEL_ID/html?revision=live" \
-H "Authorization: Bearer $ACCESS_TOKEN"

Response​

200 with the document as text/html; charset=utf-8, and:

HeaderValue
Content-Dispositionattachment; filename="<funnel-name>-r<revision>.html"
X-Perspective-RevisionThe revision served: the number current or live stood for.
Cache-Controlprivate, no-cache, with an ETag of the document: keep a copy, but revalidate it on each use (If-None-Match gets 304 while the document is unchanged). current and live move with saves and publishes, a number names another document once an A/B test ends with the variant kept, and a variant's revisions carry the funnel's shared identity as it is now.

An MCP client gets a revision's file without handing its token to a shell: get_funnel_html with download: true answers with a downloadUrl, a 5-minute signed link to the revision's stored file. It needs no other credential and serves only that revision; after 5 minutes the storage answers 403, so ask for a new one. Treat it like a password while it lasts.

The file is served gzip-encoded, so decode it on the way:

curl --compressed -o funnel.html "$DOWNLOAD_URL"

It is the revision as it was saved. This route, by contrast, returns the document the editor and get_funnel_html read: for the variant, that adds the funnel's shared title, meta, share image, favicon and cookie banner, which belong to the original (a write re-applies them).

Errors​

Errors carry a code beside error and status. See Errors.

StatuscodeMeaning
400funnelId, revision or version is invalid.
401Missing, invalid or expired access token.
403An API key was sent: funnels need a signed-in user.
404FUNNEL_NOT_FOUNDNo AI/HTML funnel with this ID that you can open.
404REVISION_NOT_FOUNDThe funnel has no revision with this number.
404LIVE_REVISION_UNKNOWNrevision=live, but no revision is marked live: the funnel is not published, or it was published before revisions were recorded. Ask for current or a number.
404EXPERIMENT_ARM_MISSINGversion=variant on a funnel without an A/B test.