Saved

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
POST
GET
PATCH
DELETE
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:read

Query parameters

  • created_by
    integer
  • limit
    integer
    Default: 100
  • offset
    integer
    Default: 0
  • order
    string
  • search
    string
  • status
    string
  • type
    string

Example request

GET /api/projects/:project_id/saved
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved/

Example response

Status 200
RESPONSE
{
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"url": "http://example.com",
"data_url": "http://example.com",
"target_widths": null,
"type": "screenshot",
"status": "processing",
"has_content": true,
"snapshots": [
{
"width": 0,
"has_content": true
}
],
"deleted": true,
"block_consent_modals": true,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"exception": "string",
"user_access_level": "string"
}
],
"count": 0
}

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:write

Request parameters

  • name
    stringnull
  • url
    string
  • data_url
    stringnull
  • widths
    array
  • type
    Default: screenshot
  • deleted
    boolean
  • block_consent_modals
    boolean

Response


Example request

POST /api/projects/:project_id/saved
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved/\
-d url="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"url": "http://example.com",
"data_url": "http://example.com",
"target_widths": null,
"type": "screenshot",
"status": "processing",
"has_content": true,
"snapshots": [
{
"width": 0,
"has_content": true
}
],
"deleted": true,
"block_consent_modals": true,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"exception": "string",
"user_access_level": "string"
}

Retrieve saved

Get a single saved heatmap by its short_id, including per-width render status.

Required API key scopes

heatmap:read

Path parameters

  • short_id
    string

Response


Example request

GET /api/projects/:project_id/saved/:short_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved/:short_id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"url": "http://example.com",
"data_url": "http://example.com",
"target_widths": null,
"type": "screenshot",
"status": "processing",
"has_content": true,
"snapshots": [
{
"width": 0,
"has_content": true
}
],
"deleted": true,
"block_consent_modals": true,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"exception": "string",
"user_access_level": "string"
}

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:write

Path parameters

  • short_id
    string

Request parameters

  • name
    stringnull
  • url
    string
  • data_url
    stringnull
  • widths
    array
  • type
    Default: screenshot
  • deleted
    boolean
  • block_consent_modals
    boolean

Response


Example request

PATCH /api/projects/:project_id/saved/:short_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved/:short_id/\
-d name=["string","null"]

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"url": "http://example.com",
"data_url": "http://example.com",
"target_widths": null,
"type": "screenshot",
"status": "processing",
"has_content": true,
"snapshots": [
{
"width": 0,
"has_content": true
}
],
"deleted": true,
"block_consent_modals": true,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"exception": "string",
"user_access_level": "string"
}

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:write

Path parameters

  • short_id
    string

Example request

DELETE /api/projects/:project_id/saved/:short_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved/:short_id/

Example 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:write

Path parameters

  • short_id
    string

Response


Example request

POST /api/projects/:project_id/saved/:short_id/regenerate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved/:short_id/regenerate/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"url": "http://example.com",
"data_url": "http://example.com",
"target_widths": null,
"type": "screenshot",
"status": "processing",
"has_content": true,
"snapshots": [
{
"width": 0,
"has_content": true
}
],
"deleted": true,
"block_consent_modals": true,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"exception": "string",
"user_access_level": "string"
}
Status 400 Not a screenshot

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:write

Request parameters

  • url
    string
  • block_consent_modals
    boolean
    Default: false

Response


Example request

POST /api/projects/:project_id/saved/prewarm
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved/prewarm/\
-d url="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"url": "http://example.com",
"data_url": "http://example.com",
"target_widths": null,
"type": "screenshot",
"status": "processing",
"has_content": true,
"snapshots": [
{
"width": 0,
"has_content": true
}
],
"deleted": true,
"block_consent_modals": true,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"exception": "string",
"user_access_level": "string"
}
Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"url": "http://example.com",
"data_url": "http://example.com",
"target_widths": null,
"type": "screenshot",
"status": "processing",
"has_content": true,
"snapshots": [
{
"width": 0,
"has_content": true
}
],
"deleted": true,
"block_consent_modals": true,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"exception": "string",
"user_access_level": "string"
}

Community questions