Simulators
Dashboards and insights
Use dashboards and insights to test code that builds or tidies a PostHog project’s saved analysis: insights, the dashboards they sit on, text notes, annotations and actions. The posthog_signup_funnel scenario starts you with a dashboard of three tiles in project 3101. Load it, then read the dashboard:
KEY=phx_rysticexamplepersonalkey000000000000000
curl -s -X POST "$RYSTIC_URL/_rystic/scenario" -o /dev/null -w '%{http_code}\n' -d '{"name":"posthog_signup_funnel"}'
# -> 204
P="$RYSTIC_URL/api/projects/3101"
curl -s "$P/dashboards/4401/" -H "Authorization: Bearer $KEY" | jq -c '{name, tiles: [.tiles[] | {id, insight: .insight.name, text: .text.body}]}'
# -> {"name":"Signup health","tiles":[{"id":4501,"insight":"Signup funnel","text":null},{"id":4502,"insight":"Daily pageviews","text":null},{"id":4503,"insight":null,"text":"Signup conversion is measured from the first landing pageview."}]}
Each tile shows either an insight or a text note. The blocks below build on this state, so run them in order.
Create an insight and pin it to a dashboard
To put a new insight on a dashboard, list the dashboard’s id in dashboards when you create it. The simulator adds a tile for it, with empty layouts until you arrange the dashboard:
curl -s -X POST "$P/insights/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"name":"Weekly signups","query":{"kind":"InsightVizNode","source":{"kind":"TrendsQuery","series":[{"kind":"EventsNode","event":"signup_completed"}],"interval":"week"}},"dashboards":[4401]}' | jq -c '{id, short_id, dashboards, tile: .dashboard_tiles[0].id}'
# -> {"id":4303,"short_id":"0000017P","dashboards":[4401],"tile":4504}
curl -s "$P/dashboards/4401/" -H "Authorization: Bearer $KEY" | jq -c '[.tiles[] | {id, insight: .insight.id, layouts}] | last'
# -> {"id":4504,"insight":4303,"layouts":{}}
A saved insight is found again by its short_id, the identifier in an insight’s share link. Running the query behind an insight is covered on the Queries page.
curl -s "$P/insights/?short_id=fnL8kQ2x" -H "Authorization: Bearer $KEY" | jq -c '[.results[] | {id, name}]'
# -> [{"id":4301,"name":"Signup funnel"}]
Read an insight’s history
Each insight has an activity log at /insights/{id}/activity/, and /insights/activity/ lists the activity of every insight in the project. The new insight’s log starts with its created entry:
curl -s "$P/insights/4303/activity/" -H "Authorization: Bearer $KEY" | jq -c '{total_count, next, results: [.results[] | {activity, scope, item_id}]}'
# -> {"total_count":1,"next":null,"results":[{"activity":"created","scope":"Insight","item_id":"4303"}]}
curl -s "$P/insights/activity/?limit=10" -H "Authorization: Bearer $KEY" | jq -c '{total_count, rows: (.results | length), next}'
# -> {"total_count":1,"rows":1,"next":"http://.../api/projects/3101/insights/activity/?limit=10&page=2"}
Stop paging the project-wide log once you have read total_count rows; Limitations explains why.
Add a text tile
A text tile puts a note beside the charts, such as what shipped that week. Create it with create_text_tile, then change its wording with update_text_tile, naming the tile in tile_id:
curl -s -X POST "$P/dashboards/4401/create_text_tile/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"body":"Release 2.3 shipped on Monday."}' | jq -c '{id, insight, text: .text.body}'
# -> {"id":4505,"insight":null,"text":"Release 2.3 shipped on Monday."}
curl -s -X POST "$P/dashboards/4401/update_text_tile/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"tile_id":4505,"body":"Release 2.3 shipped on Tuesday."}' | jq -c '{id, text: .text.body}'
# -> {"id":4505,"text":"Release 2.3 shipped on Tuesday."}
curl -s -X POST "$P/dashboards/4401/update_text_tile/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"body":"No tile named"}' -w '%{http_code}\n'
# -> {"attr":"tile_id","code":"invalid_input","detail":"This field is required.","type":"validation_error"}
# -> 400
Copy, move and reorder tiles
To build a second dashboard from the first, create it, then copy or move tiles onto it. Copying with copy_tile leaves the original tile in place. Moving with move_tile takes the tile off its source dashboard. Then reorder_tiles lays the tiles out in the order you list:
curl -s -X POST "$P/dashboards/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"name":"Release review"}' | jq -c '{id, name, pinned, tiles: (.tiles | length)}'
# -> {"id":4402,"name":"Release review","pinned":false,"tiles":0}
curl -s -X POST "$P/dashboards/4402/copy_tile/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"fromDashboardId":4401,"tileId":4501}' -o /dev/null -w '%{http_code}\n'
# -> 200
curl -s -X PATCH "$P/dashboards/4401/move_tile/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"tile":{"id":4505},"to_dashboard":4402}' -o /dev/null -w '%{http_code}\n'
# -> 200
curl -s -X POST "$P/dashboards/4402/reorder_tiles/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"tile_order":[4505,4506]}' -o /dev/null -w '%{http_code}\n'
# -> 200
curl -s "$P/dashboards/4402/" -H "Authorization: Bearer $KEY" | jq -c '.tiles[] | {id, insight: .insight.id, text: .text.body, sm: .layouts.sm}'
# -> {"id":4505,"insight":null,"text":"Release 2.3 shipped on Tuesday.","sm":{"h":5,"w":6,"x":0,"y":0}}
# -> {"id":4506,"insight":4301,"text":null,"sm":{"h":5,"w":6,"x":6,"y":0}}
curl -s "$P/dashboards/4401/" -H "Authorization: Bearer $KEY" | jq -c '[.tiles[].id]'
# -> [4501,4502,4503,4504]
The copy is a new tile, 4506, on the same insight. The reorder placed two half-width tiles side by side on the first row. Read last_accessed_at from the dashboard itself rather than from the reorder_tiles response (Limitations).
Remove tiles and dashboards
To take one tile off a dashboard, send its id to delete_tile, which returns 204. To delete whole dashboards, list their ids for bulk_delete. The response names the ones deleted and the ones skipped:
curl -s -X POST "$P/dashboards/4402/delete_tile/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"tile_id":4505}' -w '%{http_code}\n'
# -> 204
curl -s "$P/dashboards/4402/" -H "Authorization: Bearer $KEY" | jq -c '[.tiles[].id]'
# -> [4506]
curl -s -X POST "$P/dashboards/bulk_delete/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"ids":[4402]}' | jq -c .
# -> {"deleted":[4402],"skipped":[]}
curl -s "$P/dashboards/4402/" -H "Authorization: Bearer $KEY" -o /dev/null -w '%{http_code}\n'
# -> 404
curl -s "$P/dashboards/" -H "Authorization: Bearer $KEY" | jq -c '[.results[] | {id, name}]'
# -> [{"id":4401,"name":"Signup health"}]
Mark a release with an annotation
An annotation pins a note to a point in time, so a chart shows when something changed. With scope set to project it applies to every chart in the project. With scope set to dashboard_item it applies to the one insight named in dashboard_item, and the response adds that insight’s insight_short_id:
curl -s -X POST "$P/annotations/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"content":"Release 2.3","date_marker":"2026-02-28T17:00:00Z","scope":"project"}' | jq -c '{id, scope, dashboard_item, creation_type}'
# -> {"id":4603,"scope":"project","dashboard_item":null,"creation_type":"USR"}
curl -s -X POST "$P/annotations/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"content":"Funnel dip","date_marker":"2026-02-27T09:00:00Z","scope":"dashboard_item","dashboard_item":4301}' | jq -c '{id, scope, dashboard_item, insight_short_id}'
# -> {"id":4604,"scope":"dashboard_item","dashboard_item":4301,"insight_short_id":"fnL8kQ2x"}
curl -s "$P/annotations/" -H "Authorization: Bearer $KEY" | jq -c '[.results[] | {id, scope, content}]'
# -> [{"id":4601,"scope":"project","content":"Launched the redesigned signup form"},{"id":4602,"scope":"dashboard_item","content":"First completed signup on the new form"},{"id":4603,"scope":"project","content":"Release 2.3"},{"id":4604,"scope":"dashboard_item","content":"Funnel dip"}]
Define an action
An action names a set of events, such as a pageview on one URL, so insights can count them under one name. The scenario’s action matches signup_completed on any URL containing /signup. Create another, then export the list with format=csv:
curl -s "$P/actions/4101/" -H "Authorization: Bearer $KEY" | jq -c '{name, steps: [.steps[] | {event, url, url_matching}]}'
# -> {"name":"Completed signup","steps":[{"event":"signup_completed","url":"/signup","url_matching":"contains"}]}
curl -s -X POST "$P/actions/" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"name":"Opened checkout","steps":[{"event":"$pageview","url":"/checkout","url_matching":"contains"}]}' | jq -c '{id, name, is_action}'
# -> {"id":4102,"name":"Opened checkout","is_action":true}
CSV=$(mktemp)
curl -s "$P/actions/?format=csv" -H "Authorization: Bearer $KEY" -D - -o "$CSV" | grep -i '^content-type' | tr -d '\r'
# -> Content-Type: text/csv; charset=utf-8
cut -d, -f15,19 "$CSV"
# -> id,name
# -> 4101,Completed signup
# -> 4102,Opened checkout
Seed dashboard templates
The simulator starts with no dashboard templates, PostHog’s official ones included (Limitations). The template routes only read, so seed each template your test needs as a state_dashboard_template record with scope set to global:
curl -s "$P/dashboard_templates/" -H "Authorization: Bearer $KEY" | jq -c '{count}'
# -> {"count":0}
curl -s -X POST "$RYSTIC_URL/_rystic/seed" -o /dev/null -w '%{http_code}\n' -d '{"seed":{"state_dashboard_template":{"5e9c1f40-0000-4000-8000-000000000001":{"id":"5e9c1f40-0000-4000-8000-000000000001","template_name":"Product analytics","dashboard_description":"Signups, retention and active users.","scope":"global","is_featured":true,"tags":[],"tiles":[]}}}}'
# -> 204
curl -s "$P/dashboard_templates/?is_featured=true" -H "Authorization: Bearer $KEY" | jq -c '[.results[] | {template_name, scope, is_featured}]'
# -> [{"template_name":"Product analytics","scope":"global","is_featured":true}]
Seeding state covers the seed route and how each register keys its records.
What the scenario starts with
posthog_signup_funnel seeds these records in project 3101:
| Record | Ids | Notes |
|---|---|---|
| Dashboard | 4401 | “Signup health”, pinned |
| Tiles | 4501, 4502, 4503 | two insight tiles and one text tile, all on 4401 |
| Insights | 4301, 4302 | “Signup funnel” (short_id fnL8kQ2x), a funnel; “Daily pageviews”, a trend |
| Annotations | 4601, 4602 | one for the project, one on insight 4301 |
| Action | 4101 | “Completed signup” |
New records take the next id in each sequence, so the ids on this page repeat on every run from a fresh load.