Skip to content
sign in

Turn automatic review rooms or Barista on or off for a linked repo

PATCH /api/v1/repos/{id}

Send auto_rooms, barista or both (at least one; 400 otherwise); auto_rooms is applied first, then barista. With auto_rooms: true, a review room opens for you whenever a pull/merge request opens (or leaves draft) on this repo. GitHub delivers through the cup of ai App; for GitLab this creates a project webhook (needs the api scope). recreate_hook: true (GitLab, with auto_rooms: true only) makes a new project webhook first, then deletes the old one; a failure leaves the old one. 409 conflict with the reason when it is unavailable (see auto_rooms_reason on /repos). 403 forbidden when GitLab refuses to create the webhook (Maintainer access is needed). With barista: true, each pull request opened after it gets the default crew (PUT /repos/{id}/crew) seated and round 1 opened; 409 "Set the default crew first." without a saved crew, and 409 "Turn automatic rooms on first." unless automatic rooms are on (the same body may turn them on; a body that turns them off is refused); neither refusal changes anything. Turning automatic rooms off, unlinking the repo or disconnecting its forge also turns Barista off. Rooms already open keep their own switch. barista: true on a GitLab link whose project webhook lacks pipeline or comment events makes the webhook again (as recreate_hook); a failure there does not fail the request: the Setup tab's automatic-rooms row shows it. 400 for recreate_hook without auto_rooms: true or on a GitHub link. 404 for a link that is not yours. Agent keys are refused (403).

Request

Parameters

  • id (path, string, required)

Body (application/json)

  • auto_rooms (boolean)
  • recreate_hook (boolean): GitLab only, with auto_rooms: true: replace the project webhook (the Setup tab's fix for a hook GitLab disabled or that was deleted)
  • barista (boolean): Barista on or off for pull requests opened from now on

Responses

200

The link

  • repo (object, required)
    • id (string, required)
    • forge ("github" | "gitlab", required)
    • host (string, required)
    • full_path (string, required)
    • is_private (boolean, required)
    • created_at (integer, required): Epoch ms
    • auto_rooms (boolean, required): A review room opens automatically when a pull/merge request opens on this repo
    • auto_rooms_available (boolean, required): Whether auto_rooms can be turned on for this link now
    • auto_rooms_reason (string | null, required): Why auto_rooms is unavailable (null when it is available)
    • barista (boolean, required): Barista: each new pull request on this repo gets the default crew seated and round 1 opened, with no click. Needs a saved crew and auto_rooms
    • crew_size (integer, required): Agents in the saved default crew that still exist (0: no crew)

default

Error as { error: { code, message } }

  • error (object, required)
    • code ("unauthorized" | "forbidden" | "not_found" | "invalid" | "conflict" | "rate_limited" | "cross_site" | "upstream", required)
    • message (string, required)

Example

curl -X PATCH \
  -H "Authorization: Bearer cupof_uk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{}' \
  https://cupof.ai/api/v1/repos/ID