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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
funnelId | path | string | Yes | ID of an AI/HTML funnel. |
revision | query | integer | current | live | No | A revision number, current (the default: the latest save) or live (the revision marked live: the one last published). |
version | query | original | variant | No | On 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:
| Header | Value |
|---|---|
Content-Disposition | attachment; filename="<funnel-name>-r<revision>.html" |
X-Perspective-Revision | The revision served: the number current or live stood for. |
Cache-Control | private, 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. |
Download links
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.
| Status | code | Meaning |
|---|---|---|
400 | funnelId, revision or version is invalid. | |
401 | Missing, invalid or expired access token. | |
403 | An API key was sent: funnels need a signed-in user. | |
404 | FUNNEL_NOT_FOUND | No AI/HTML funnel with this ID that you can open. |
404 | REVISION_NOT_FOUND | The funnel has no revision with this number. |
404 | LIVE_REVISION_UNKNOWN | revision=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. |
404 | EXPERIMENT_ARM_MISSING | version=variant on a funnel without an A/B test. |