Vision
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
GET | |
POST | |
GET | |
GET | |
POST | |
POST | |
DELETE | |
POST | |
GET | |
GET | |
POST | |
POST | |
POST | |
GET | |
POST | |
GET | |
POST | |
GET |
Create vision scanners affected cohort
Save the users this scanner matched as a static cohort, for surveys, funnels, and retention analysis.
Required API key scopes
replay_scanner:readsession_recording:readcohort:writePath parameters
- idstring
Request parameters
- window_daysintegerDefault:
30 - tagstringnull
- min_scorenumbernull
- max_scorenumbernull
Response
Example request
POST /api /projects /:project_id /vision /scanners /:id /affected_cohortExample response
Status 201
Create vision scanners bulk observe
Apply this scanner to many sessions on demand. Starts as many as fit under the in-flight caps and monthly credit quota, reporting the rest as skipped rather than failing the batch.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
Request parameters
- session_idsarray
Response
Example request
POST /api /projects /:project_id /vision /scanners /:id /bulk_observeExample response
Status 202
Retrieve vision scanners impact
Affected sessions and users for this scanner over the trailing window.
Required API key scopes
replay_scanner:readsession_recording:readPath parameters
- idstring
Query parameters
- max_scorenumbernull
- min_scorenumbernull
- tagstringnull
- window_daysintegerDefault:
30
Response
Example request
GET /api /projects /:project_id /vision /scanners /:id /impactExample response
Status 200
Create vision scanners observe
Apply this scanner to one specific session, on demand. Returns 202 with the workflow handle.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
Request parameters
- session_idstring
Response
Example request
POST /api /projects /:project_id /vision /scanners /:id /observeExample response
Status 202
List all vision scanners observations
Read-only access to observations produced by a scanner.
Required API key scopes
replay_scanner:readsession_recording:readPath parameters
- scanner_idstring
Query parameters
- date_fromstring
- date_tostring
- labeledboolean
- limitinteger
- offsetinteger
- order_bystringOne of:
"-completed_at""-created_at""-label""-recording_subject_email""-result_confidence""-result_score""-result_verdict""-scanner_version""-started_at""-status""completed_at""created_at""label""recording_subject_email""result_confidence""result_score""result_verdict""scanner_version""started_at""status" - recording_subjectstring
- session_idstring
- statusstring
- tagsstring
- triggered_bystring
- verdictstring
Response
Example request
GET /api /projects /:project_id /vision /scanners /:scanner_id /observationsExample response
Status 200
Retrieve vision scanners observations
Retrieve one observation. Any list filters passed along (status, tags, order_by, …) scope the previous_observation_id/next_observation_id navigation to the matching, identically-ordered set — so prev/next from a filtered table stays within that filtered list.
Required API key scopes
replay_scanner:readsession_recording:readPath parameters
- idstring
- scanner_idstring
Query parameters
- date_fromstring
- date_tostring
- labeledstring
- order_bystringOne of:
"-completed_at""-created_at""-label""-recording_subject_email""-result_confidence""-result_score""-result_verdict""-scanner_version""-started_at""-status""completed_at""created_at""label""recording_subject_email""result_confidence""result_score""result_verdict""scanner_version""started_at""status" - recording_subjectstring
- session_idstring
- statusstring
- tagsstring
- triggered_bystring
- verdictstring
Response
Example request
GET /api /projects /:project_id /vision /scanners /:scanner_id /observations /:idExample response
Status 200
Create vision scanners observations create task
Create a PostHog Task from this observation's finding so it can be triaged and fixed. Title and description are derived from the scanner and its result. Record-only: this does not start the coding agent. Idempotent per observation: once a task exists, repeat calls return its id with a 200 instead of creating a duplicate.
Required API key scopes
replay_scanner:writesession_recording:readtask:writePath parameters
- idstring
- scanner_idstring
Response
Example request
POST /api /projects /:project_id /vision /scanners /:scanner_id /observations /:id /create_taskExample response
Status 200
Status 201
Create vision scanners observations label
Set or update the observation's shared label: whether the scanner scored the session correctly, plus optional feedback on what it got wrong. One label per observation, shared across the team; these labels feed prompt improvement. Requires editor access to the scanner.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
- scanner_idstring
Request parameters
- is_correctboolean
- feedbackstringDefault:
Response
Example request
POST /api /projects /:project_id /vision /scanners /:scanner_id /observations /:id /labelExample response
Status 200
Delete vision scanners observations label
Remove the observation's shared label. Requires editor access to the scanner.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
- scanner_idstring
Example request
DELETE /api /projects /:project_id /vision /scanners /:scanner_id /observations /:id /labelExample response
Status 204 No response body
Create vision scanners observations retry
Delete a failed observation and re-run its scanner on the same recording. Returns 202 with the workflow handle.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
- scanner_idstring
Response
Example request
POST /api /projects /:project_id /vision /scanners /:scanner_id /observations /:id /retryExample response
Status 202
Retrieve vision scanners observations stats
Aggregate counts and per-scanner-type distributions over the filtered observation set. Same filters as the list endpoint apply.
Required API key scopes
replay_scanner:readsession_recording:readPath parameters
- scanner_idstring
Query parameters
- date_fromstring
- date_tostring
- labeledstring
- recent_daysinteger
- recording_subjectstring
- session_idstring
- statusstring
- tagsstring
- triggered_bystring
- verdictstring
Response
Example request
GET /api /projects /:project_id /vision /scanners /:scanner_id /observations /statsExample response
Status 200
List all vision scanners prompt suggestions
AI prompt-rewrite suggestions for a scanner, generated from the team's thumbs up/down ratings.
Required API key scopes
replay_scanner:readsession_recording:readPath parameters
- scanner_idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /vision /scanners /:scanner_id /prompt_suggestionsExample response
Status 200
Create vision scanners prompt suggestions apply
Apply this suggestion: write a config to the scanner (the prompt plus any type-specific config such as classifier tags or the monitor allow_inconclusive flag), bumping the scanner version, and mark the suggestion applied. Pass config to apply an edited subset of the recommendation; omit it to apply the full suggested config. Only the current pending suggestion can be applied. Requires session recording edit access.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
- scanner_idstring
Request parameters
- config
Response
Example request
POST /api /projects /:project_id /vision /scanners /:scanner_id /prompt_suggestions /:id /applyExample response
Status 200
Create vision scanners prompt suggestions dismiss
Dismiss this suggestion without applying it. Only the current pending suggestion can be dismissed. Requires editor access to the scanner.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
- scanner_idstring
Response
Example request
POST /api /projects /:project_id /vision /scanners /:scanner_id /prompt_suggestions /:id /dismissExample response
Status 200
Create vision scanners prompt suggestions evaluate
Test this suggestion before applying it: re-run the scanner with the suggested prompt against already-rated sessions in the background and compare each fresh output with the stored one. Results land on the suggestion's evaluation field. Poll current while status is running. session_limit controls how many rated sessions are re-run (thumbs-down prioritized, up to evaluation_session_cap). Each successful re-run charges credits like a normal observation of the same model. The request is refused with 402 when the planned credits exceed what is left of the monthly limit. Monitor and classifier scanners get a kept/fixed/regressed classification, while scorer and summarizer scanners show the raw before and after output. Requires session recording edit access.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- idstring
- scanner_idstring
Request parameters
- session_limitintegerDefault:
10 - config
Response
Example request
POST /api /projects /:project_id /vision /scanners /:scanner_id /prompt_suggestions /:id /evaluateExample response
Status 200
Retrieve vision scanners prompt suggestions current
The scanner's newest prompt suggestion plus whether it is stale (the ratings changed since it was generated) and how many rated observations are available.
Required API key scopes
replay_scanner:readsession_recording:readPath parameters
- scanner_idstring
Response
Example request
GET /api /projects /:project_id /vision /scanners /:scanner_id /prompt_suggestions /currentExample response
Status 200
Create vision scanners prompt suggestions generate
Generate a fresh prompt suggestion from the team's current ratings. The previous pending suggestion becomes history (superseded). Requires at least one rated observation and editor access to the scanner.
Required API key scopes
replay_scanner:writesession_recording:readPath parameters
- scanner_idstring
Response
Example request
POST /api /projects /:project_id /vision /scanners /:scanner_id /prompt_suggestions /generateExample response
Status 200
Retrieve vision scanners creators
Distinct creators across the team's scanners — feeds the Created by filter dropdown.
Required API key scopes
replay_scanner:readResponse
Example request
GET /api /projects /:project_id /vision /scanners /creatorsExample response
Status 200
Create vision scanners estimate
Estimate the observation volume a proposed scanner would generate, for the pre-save cost preview.
Required API key scopes
replay_scanner:readsession_recording:readRequest parameters
- query
- sampling_ratenumberDefault:
1 - sampling_modeDefault:
comprehensive - scanner_idstringnull
- modelDefault:
gemini-3-flash-preview
Response
Example request
POST /api /projects /:project_id /vision /scanners /estimateExample response
Status 200
Retrieve vision scanners stats
Team-wide scanner counts — independent of list filters, so the overview stays stable.
Required API key scopes
replay_scanner:readResponse
Example request
GET /api /projects /:project_id /vision /scanners /stats