Skip to main content
PATCH
Create, replace or delete default reviewer triggers
Creates, replaces, and deletes Devin Review auto-review rules and exclusions in one atomic batch. To see existing triggers, use List Review triggers; to find the repositories you can target, use List Review trigger scopes.

Permissions

Requires a service user or personal access token with the ManageReview permission in the organization. A personal access token acts as its user. Account-wide ManageReview lets the caller manage every scope; organization-level ManageReview covers only the repositories that organization can access.

Behavior

  • An entry in upserts without entity_id creates a trigger. With entity_id it replaces that trigger and must include expected_version_id, the version_id last read. Fields you omit keep their stored values.
  • kind is rule (run Review automatically) or exclusion (skip matching pull requests).
  • scope is account (every repository Review can see), repository (with repository as owner/repo on github.com or host/path elsewhere), or user (with user_id, for that member’s own pull requests).
  • For rules, start is pr_open or pr_ready (default), cadence is once or every_push (default), and effort is default, normal, or ultra.
  • conditions narrows a trigger to matching pull requests; on create, leave it out to match every pull request in the scope. On replace, leaving it out keeps the stored conditions; send null to clear them.
  • Entries in deletes name a trigger by entity_id and expected_version_id.
  • The batch is all or nothing. It returns 400 when empty, 403 when any entry targets a scope the caller can’t manage, and 409 when an expected_version_id is stale. Read the triggers again and retry in the last case.
  • Returns 404 when Review triggers are not enabled for the organization.

Example

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Path Parameters

org_id
string
required

Organization ID (prefix: org-)

Example:

"org-abc123def456"

Body

application/json
deletes
ReviewTriggerDeleteRequest · object[]
Maximum array length: 100
upserts
ReviewTriggerUpsertRequest · object[]
Maximum array length: 100

Response

Successful Response

deleted_entity_ids
string[]
required
upserted
ReviewTriggerResponse · object[]
required