review_hog

Start a review of a pull request

Start a PostHog Review run on any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. run_mode picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.

post/api/projects/{project_id}/review_hog/reviews/trigger/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/review_hog/reviews/trigger/
  • Auth: HTTP bearer

Path parameters

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

pr_urlstring required

GitHub pull request URL to review, e.g. 'https://github.com/PostHog/posthog.com/pull/123'. The repository must be accessible to the project's GitHub App installation.

run_mode'review' | 'review_only' | 'resolve_only' | 'flash'
  • review - Review
  • review_only - Review only
  • resolve_only - Resolve only
  • flash - Standard

Response

No new run needed: the PR's current commit already has a published review.

workflow_idstring required

Temporal workflow id for the started review run; empty when no run was started.

statusstring required

Run lifecycle marker: 'started' when the review was queued, 'already_reviewed' when the pull request's current commit already has a published review in the requested mode, 'joined_running_review' when a review was already running and the request was queued on that pull request's run, to start after the running turn. A requested Deep review waits for an active Standard review.

repositorystring required

The pull request's repository as 'owner/repo'.

pr_numberinteger required

The pull request number.

head_shastring nullable required

The pull request's head commit when the request was accepted.

report_idstring uuid nullable required

Id of the pull request's existing review, for review-hog-reviews-get. Null on the pull request's first run, which creates the review later.

requested_atstring date-time required

Server time when the request was accepted.

resolve_will_runboolean required

Whether this request plans to run the resolution stage, which can push fix commits to the pull request. It is the plan at request time: a request queued behind a running turn on the same head can be skipped as already published. review-hog-reviews-pr-status reports what actually ran.

Changes

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