Visual
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
GET | |
GET | |
POST | |
POST | |
GET | |
GET | |
GET | |
GET | |
GET | |
POST | |
GET | |
POST | |
POST | |
POST | |
POST | |
POST |
List all visual review repos
Also available via the PostHog MCP server:
visual-review-repos-list— List visual review repos
List all projects for the team.
Required API key scopes
visual_review:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /visual_review /reposExample response
Status 200
Create visual review repos
Create a new repo.
Required API key scopes
visual_review:writeRequest parameters
- repo_full_namestring
- repo_external_idintegernull
Response
Example request
POST /api /projects /:project_id /visual_review /reposExample response
Status 201
Retrieve visual review repos
Also available via the PostHog MCP server:
visual-review-repos-retrieve— Get visual review repo
Get a repo by ID.
Required API key scopes
visual_review:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /visual_review /repos /:idExample response
Status 200
Update visual review repos
Update a repo's settings.
Required API key scopes
visual_review:writePath parameters
- idstring
Request parameters
- baseline_file_pathsobjectnull
- enable_pr_commentsbooleannull
Response
Example request
PATCH /api /projects /:project_id /visual_review /repos /:idExample response
Status 200
Retrieve visual review repos baselines
Snapshots overview for a repo: every identifier with a current baseline (latest non-superseded master/main run per run_type), plus tolerate counts, active quarantine state, and a 30-day stability sparkline. Capped at 5000 entries — sets truncated and returns the most recently active when exceeded. Filtering / faceting / search are all done client-side; this endpoint takes no filter query params.
Required API key scopes
visual_review:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /visual_review /repos /:id /baselinesExample response
Status 200
List all visual review repos quarantine
List quarantined identifiers. Without filter: active only. With identifier: full history.
Required API key scopes
visual_review:readPath parameters
- idstring
Query parameters
- identifierstring
- limitinteger
- offsetinteger
- run_typestring
Response
Example request
GET /api /projects /:project_id /visual_review /repos /:id /quarantineExample response
Status 200
Create visual review repos quarantine
Quarantine a snapshot identifier for a specific run type.
Required API key scopes
visual_review:writePath parameters
- idstring
- run_typestring
Request parameters
- identifierstring
- reasonstring
- source_run_idstringnull
- expires_atstringnull
Response
Example request
POST /api /projects /:project_id /visual_review /repos /:id /quarantine /:run_typeExample response
Status 201
Create visual review repos quarantine expire
Expire all active quarantine entries for an identifier.
Required API key scopes
visual_review:writePath parameters
- idstring
- run_typestring
Request parameters
- identifierstring
- reasonstring
- source_run_idstringnull
- expires_atstringnull
Example request
POST /api /projects /:project_id /visual_review /repos /:id /quarantine /:run_type /expireExample response
Status 204 No response body
Retrieve visual review repos thumbnails
Serve a snapshot thumbnail by identifier. Returns WebP with ETag caching.
Required API key scopes
visual_review:readPath parameters
- idstring
- identifierstring
Example request
GET /api /projects /:project_id /visual_review /repos /:id /thumbnails /:identifierExample response
Status 200 WebP thumbnail image
List all visual review repos runs
List runs in this repo, optionally filtered by review state and free-text search.
Required API key scopes
visual_review:readPath parameters
- repo_idstring
Query parameters
- limitinteger
- offsetinteger
- review_statestring
- searchstring
Response
Example request
GET /api /projects /:project_id /visual_review /repos /:repo_id /runsExample response
Status 200
Retrieve visual review repos runs counts
Review state counts for runs in this repo.
Required API key scopes
visual_review:readPath parameters
- repo_idstring
Response
Example request
GET /api /projects /:project_id /visual_review /repos /:repo_id /runs /countsExample response
Status 200
List all visual review repos snapshots
Deduped baseline timeline for a snapshot identity. Newest first.
Required API key scopes
visual_review:readPath parameters
- identifierstring
- repo_idstring
- run_typestring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /visual_review /repos /:repo_id /snapshots /:run_type /:identifierExample response
Status 200
List all visual review runs
Also available via the PostHog MCP server:
visual-review-runs-list— List visual review runs
List runs for the team, optionally filtered by review state, PR number, commit SHA, branch, or free-text search.
Required API key scopes
visual_review:readQuery parameters
- branchstring
- commit_shastring
- limitinteger
- offsetinteger
- pr_numberinteger
- review_statestring
- searchstring
Response
Example request
GET /api /projects /:project_id /visual_review /runsExample response
Status 200
Create visual review runs
Create a new run from a CI manifest.
Required API key scopes
visual_review:writeRequest parameters
- repo_idstring
- run_typestring
- commit_shastring
- branchstring
- snapshotsarray
- pr_numberintegernull
- baseline_hashesobject
- unchanged_countinteger
- removed_identifiersarray
- purposestring
- metadataobject
- is_partialboolean
Response
Example request
POST /api /projects /:project_id /visual_review /runsExample response
Status 201
Retrieve visual review runs
Also available via the PostHog MCP server:
visual-review-runs-retrieve— Get visual review run
Get run status and summary.
Required API key scopes
visual_review:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /visual_review /runs /:idExample response
Status 200
Create visual review runs add snapshots
Add a batch of snapshots to a pending run (shard-based flow).
Required API key scopes
visual_review:writePath parameters
- idstring
Request parameters
- snapshotsarray
- baseline_hashesobject
Response
Example request
POST /api /projects /:project_id /visual_review /runs /:id /add-snapshotsExample response
Status 200
Create visual review runs approve
Mark snapshots reviewed (DB only).
Records the per-snapshot "Accept change" decision. Does not commit the baseline or change the GitHub gate — call finalize to ship the run.
Required API key scopes
visual_review:writePath parameters
- idstring
Request parameters
- snapshotsarray
Response
Example request
POST /api /projects /:project_id /visual_review /runs /:id /approveExample response
Status 200
Create visual review runs complete
Complete a run: detect removals, verify uploads, trigger diff processing.
Required API key scopes
visual_review:writePath parameters
- idstring
Response
Example request
POST /api /projects /:project_id /visual_review /runs /:id /completeExample response
Status 200
Create visual review runs finalize
Finalize a fully-reviewed run: commit the approved baseline and green the gate.
Commits exactly the snapshots approved in the DB (tolerated ones keep their baseline) and only succeeds once every changed/new snapshot is resolved. With approve_all=true, any still-pending changed/new snapshot is approved first. With commit_to_github=false the server returns the signed baseline YAML instead of committing it.
Required API key scopes
visual_review:writePath parameters
- idstring
Request parameters
- approve_allbooleanDefault:
false - commit_to_githubbooleanDefault:
true - add_images_to_comment_on_prbooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /visual_review /runs /:id /finalizeExample response
Status 200
Create visual review runs recompute
Re-evaluate quarantine and counts, update commit status, and optionally rerun the CI job.
Required API key scopes
visual_review:writePath parameters
- idstring
Response
Example request
POST /api /projects /:project_id /visual_review /runs /:id /recompute