Saved
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
POST | |
GET | |
GET | |
POST | |
GET | |
POST | |
POST | |
POST |
List all saved
List saved heatmaps for the project. A saved heatmap pins a page URL and a set of viewport widths, and (for type 'screenshot') renders the page so heatmap data can be overlaid on it.
Required API key scopes
heatmap:readQuery parameters
- created_byinteger
- limitintegerDefault:
100 - offsetintegerDefault:
0 - orderstring
- searchstring
- statusstring
- typestring
Example request
GET /api /projects /:project_id /savedExample response
Status 200
Create saved
Create a saved heatmap for a page URL. For type 'screenshot' (the default) this enqueues a headless render of the page at each target width; poll the saved heatmap or its content endpoint until status is 'completed'. Provide 'widths' to control which viewport widths are rendered.
Required API key scopes
heatmap:writeRequest parameters
- namestring | null
- urlstring
- data_url
- widthsarray
- typeDefault:
screenshot - deletedboolean
- block_consent_modalsboolean
Response
Example request
POST /api /projects /:project_id /savedExample response
Status 201
Retrieve saved
Get a single saved heatmap by its short_id, including per-width render status.
Required API key scopes
heatmap:readPath parameters
- short_idstring
Response
Example request
GET /api /projects /:project_id /saved /:short_idExample response
Status 200
Update saved
Update a saved heatmap (e.g. rename, change widths, or soft-delete via 'deleted'). Changing the URL of a 'screenshot' heatmap triggers a re-render.
Required API key scopes
heatmap:writePath parameters
- short_idstring
Request parameters
- namestring | null
- urlstring
- data_url
- widthsarray
- typeDefault:
screenshot - deletedboolean
- block_consent_modalsboolean
Response
Example request
PATCH /api /projects /:project_id /saved /:short_idExample response
Status 200
Delete saved
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
heatmap:writePath parameters
- short_idstring
Example request
DELETE /api /projects /:project_id /saved /:short_idExample response
Status 405 No response body
Create saved regenerate
Re-run screenshot generation for a saved heatmap of type 'screenshot'. Clears existing renders and re-renders at every target width; status returns to 'processing'.
Required API key scopes
heatmap:writePath parameters
- short_idstring
Response
Example request
POST /api /projects /:project_id /saved /:short_id /regenerateExample response
Status 200
Status 400 Not a screenshot
Retrieve saved screenshot history
List the daily screenshot captures kept for a saved heatmap, newest first. Each capture is a render of the page on that day at one viewport width, so the clicks of a day or a range can be viewed over the background that matches it. Captures older than the retention window are deleted.
Required API key scopes
heatmap:readPath parameters
- short_idstring
Response
Example request
GET /api /projects /:project_id /saved /:short_id /screenshot_historyExample response
Status 200
Status 404 Page history is not enabled for this project
Retrieve saved screenshot history content
Fetch the JPEG for one daily capture, or its thumbnail. The list endpoint hands out versioned URLs, so the response carries a private day-long cache lifetime and an ETag that changes when the day is captured again.
Required API key scopes
heatmap:readPath parameters
- history_idstring
- short_idstring
Query parameters
- vstring
- variantstringDefault:
fullOne of:"full""thumbnail"
Example request
GET /api /projects /:project_id /saved /:short_id /screenshot_history /:history_id /contentExample response
Status 200
Status 304 Not modified
Status 404 No such capture, or page history is not enabled for this project
Create saved screenshot history capture
Render and keep a capture of the page now, instead of waiting for the daily run, for example right after a deploy. The render runs in the background; poll the history list for the new capture. A capture requested on a day that already has one replaces that day's image.
Required API key scopes
heatmap:writePath parameters
- short_idstring
Response
Example request
POST /api /projects /:project_id /saved /:short_id /screenshot_history /captureExample response
Status 202
Status 400 Not a server-rendered screenshot heatmap
Status 404 Page history is not enabled for this project
Status 429 A capture was requested for this heatmap in the last 10 minutes
Retrieve saved screenshot history requests
Read the outcome of a capture request.
Required API key scopes
heatmap:readPath parameters
- request_idstring
- short_idstring
Response
Example request
GET /api /projects /:project_id /saved /:short_id /screenshot_history /requests /:request_idExample response
Status 200
Create saved capture
Persist screenshots captured client-side by the on-page toolbar as a completed screenshot heatmap. No headless render is enqueued: the toolbar runs in the user's authenticated browser, so this is the path for pages behind a login that Browserless cannot reach. Send one 'image'+'width', or 'images'+'widths' parallel arrays to store several viewport widths on one heatmap (the toolbar re-lays out the page at each width and captures it, matching the widths the server renders). The image bytes are stored and served only through the authenticated content endpoint. The optional data URL selects which pages supply the overlay data and defaults to the captured URL.
Required API key scopes
heatmap:writeResponse
Example request
Example response
Status 201
Create saved preflight
Fetch a page URL server-side and report whether it allows being embedded in the live preview iframe, plus the HTTP status it returned. The live preview loads the customer's site directly in their browser, so a site that sends X-Frame-Options or a restrictive frame-ancestors will never render, and a 4xx or 5xx from the site's own host or CDN leaves an empty frame with no explanation. This endpoint makes both cases explainable. The fetch comes from PostHog's own network rather than from the screenshot renderer, so a host that varies its response by IP or user agent can answer this differently than it answers a screenshot render. Settled verdicts are cached briefly, so repeat checks for the same URL do not refetch it.
Required API key scopes
heatmap:readRequest parameters
- urlstring
Response
Example request
POST /api /projects /:project_id /saved /preflightExample response
Status 200
Create saved prewarm
Speculatively render a screenshot for a page URL ahead of heatmap creation, so it's ready (or closer to ready) by the time the user reaches the generation screen. Renders a single preview width. Idempotent within a short window: returns the existing in-flight or completed prewarm render for the same URL and consent setting if one exists (200), otherwise starts a new one (201). The result is reused when a heatmap is later created for the same URL.
Required API key scopes
heatmap:writeRequest parameters
- urlstring
- block_consent_modalsbooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /saved /prewarm




