Wizard
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
POST | |
GET | |
PATCH | |
GET | |
GET | |
GET | |
GET | |
GET | |
POST | |
GET | |
GET | |
GET |
List all wizard registry
List Wizard programs available for this project.
Required API key scopes
wizard_session:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /wizard /registryExample response
Status 200
List all wizard runs
List Wizard runs for this project, ordered from newest to oldest.
Required API key scopes
wizard_session:readQuery parameters
- created_afterstring
- limitinteger
- offsetinteger
- statusarray
Response
Example request
GET /api /projects /:project_id /wizard /runsExample response
Status 200
Create wizard runs
Create a local or cloud Wizard run for a project workspace.
Required API key scopes
wizard_session:writeRequest parameters
- program_idstring
- environment
- workspace
- idempotency_keystring
- wizard_versionstring
Response
Example request
POST /api /projects /:project_id /wizard /runsExample response
Status 201
Status 400
Status 403
Status 404
Status 429
Retrieve wizard runs
Retrieve a Wizard run in this project.
Required API key scopes
wizard_session:readPath parameters
- run_idstring
Response
Example request
GET /api /projects /:project_id /wizard /runs /:run_idExample response
Status 200
Status 404
Update wizard runs
Change the terminal status of a local Wizard run.
Required API key scopes
wizard_session:writePath parameters
- run_idstring
Request parameters
- status
- error_codestring | null
Response
Example request
PATCH /api /projects /:project_id /wizard /runs /:run_idExample response
Status 200
Status 400
Status 403
Status 404
Status 409
List all wizard runs artifacts
List metadata for artifacts produced by a Wizard run.
Required API key scopes
wizard_session:readPath parameters
- run_idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /wizard /runs /:run_id /artifactsExample response
Status 200
Status 404
Retrieve wizard runs artifacts content
Get the unified git diff stored for a Wizard run artifact.
Required API key scopes
wizard_session:readPath parameters
- idstring
- run_idstring
Example request
GET /api /projects /:project_id /wizard /runs /:run_id /artifacts /:id /contentExample response
Status 200
Status 404
Status 413
Retrieve wizard runs stream
Stream the current run state and subsequent updates. Use EventSource to consume this endpoint.
Required API key scopes
wizard_session:readPath parameters
- run_idstring
Example request
GET /api /projects /:project_id /wizard /runs /:run_id /streamExample response
Status 200
Status 204 No response body
Retrieve wizard runs tasks
API endpoints for managing Wizard run tasks. Access is scoped to the Wizard only.
The Wizard should be the only client that can update the tasks of a run.
Required API key scopes
wizard_run:readPath parameters
- run_idstring
Response
Example request
GET /api /projects /:project_id /wizard /runs /:run_id /tasksExample response
Status 200
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
- limitintegerDefault:
50 - offsetintegerDefault:
0 - 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
- pending_input
- handoff_textstring | null
- session_idstring
- workflow_idstring
- skill_idstring
- started_atstring
- run_phase
- tasksarray
- event_planobject | null
- errorobject | null
Response
Example request
POST /api /projects /:project_id /wizard /sessionsExample response
Status 200
Status 201
Status 403 The session belongs to a different user.
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