Wizard
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
GET | |
GET |
List all wizard sessions
List wizard sessions for the project, ordered by started_at desc. This should only be called by the PostHog Wizard. Optional filters: ?workflow_id=<id> and ?skill_id=<id>.
Required API key scopes
wizard_session:readQuery parameters
- limitinteger
- offsetinteger
- skill_idstring
- workflow_idstring
Response
Example request
GET /api /projects /:project_id /wizard /sessionsExample response
Status 200
Create wizard sessions
Upsert a wizard session. The session_id key is the idempotency anchor — reposting the same session_id replaces the existing row. Returns 201 on create, 200 on update.
Required API key scopes
wizard_session:writeRequest parameters
- session_idstring
- workflow_idstring
- skill_idstring
- started_atstring
- run_phase
- tasksarray
- event_planobjectnull
- errorobjectnull
Response
Example request
POST /api /projects /:project_id /wizard /sessionsExample response
Status 200
Status 201
Retrieve wizard sessions
Retrieve a single wizard session by its session_id.
Required API key scopes
wizard_session:readPath parameters
- session_idstring
Response
Example request
GET /api /projects /:project_id /wizard /sessions /:session_idExample response
Status 200
Status 404 No session with that id for this project.
Retrieve wizard sessions latest
Return the single most-recent wizard session for a workflow (and optional skill), or 204 if none exists. Unlike list, this is a point lookup the app shell uses to decide whether to open the live SSE stream — it never returns a collection, and 'no run' is a 204 rather than a 404 so clients don't conflate it with a missing endpoint.
Required API key scopes
wizard_session:readQuery parameters
- skill_idstring
- workflow_idstring
Response
Example request
GET /api /projects /:project_id /wizard /sessions /latestExample response
Status 200
Status 204 No session for this workflow/skill in this project.
Retrieve wizard sessions stream
Server-Sent Events stream of wizard session updates for a (workflow_id, skill_id) pair. On connect, the current latest session (if any) is emitted as the first event; subsequent upserts are streamed in real time. The server closes the connection after 900 seconds with an event: end line so the client (EventSource) can reconnect.
SDK consumers: do not call the generated fetch wrapper for this path — it will buffer the entire infinite stream. Use the URL builder (getWizardSessionsStreamRetrieveUrl) with the browser's EventSource API instead.
Required API key scopes
wizard_session:readQuery parameters
- skill_idstring
- workflow_idstring
Example request
GET /api /projects /:project_id /wizard /sessions /stream