visual_review

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; quarantined snapshots are skipped, but a quarantined snapshot approved by identifier is still committed. With commit_to_github=false the server returns the signed baseline YAML instead of committing it.

post/api/projects/{project_id}/visual_review/runs/{id}/finalize/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/visual_review/runs/{id}/finalize/
  • Auth: HTTP bearer

Path parameters

idstring required
project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

approve_allboolean

Approve every still-pending changed and new snapshot before finalizing (tolerated snapshots are left untouched). Leave false to finalize a run you've already reviewed — finalizing fails if any changed/new snapshot is still unreviewed.

commit_to_githubboolean

Whether the server commits the approved baseline to the PR branch and greens the gate (the normal path — leave true). Set false only for tooling that commits the baseline itself: the server skips the commit and returns the signed YAML in baseline_content instead. With false, the gate is NOT greened, metadata.baseline_commit_sha is absent, and no post-approval PR comment is posted.

add_images_to_comment_on_prboolean

Whether to embed the before/after snapshot images in the post-approval PR comment. The comment itself is posted when the repo has PR comments enabled and commit_to_github is true: it updates the run's review prompt when the run has one, and posts a new comment when it does not. This flag only controls the images. Defaults false — the comment stays a text summary unless the reviewer opts in to attach the snapshots.

Response

baseline_contentstring required

Changes

No recorded changes to this operation across all 1 revision of this API.