provider visual_review POST /api/projects/{project_id}/visual_review/runs/{id}/finalize/
@utdk/posthog /api/projects/{project_id}/visual_review/runs/{id}/finalize/
visual_review_runs_finalize_create
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.
id path required
string
project_id path required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
string

Try it

Authentication
Configure credentials for PostHog API
visualReviewRunsFinalizeCreate
POST/api/projects/{project_id}/visual_review/runs/{id}/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.

Parameters

required
required

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

Input

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.

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 and `metadata.baseline_commit_sha` is absent.

Whether to embed the before/after snapshot images in the post-approval PR comment. The comment itself is always posted (when the run was initiated from a GitHub review prompt and the repo has PR comments enabled); this flag only controls the images. Defaults false — the comment stays a text summary unless the reviewer opts in to attach the snapshots.

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.visualReviewRunsFinalizeCreate({
  "approve_all": false,
  "commit_to_github": true,
  "add_images_to_comment_on_pr": false
})