# Set a team's review assignment

> Choose what happens when a team is asked to review a pull request.

<div class="g1t-endpoint"><span class="g1t-method" data-method="put">PUT</span><code>/workspaces/{workspace}/teams/{team}/review_assignment</code></div>

Off, everyone in it is asked. On (`enabled`), g1t picks `count` people from it (1 to 10, never the pull request's author) and asks them, and the team stays shown as asked beside them: `round_robin` picks whoever this team asked least recently, `load_balance` whoever has the fewest pull requests waiting on their review. `skip_busy` leaves out anyone with `busy_at` or more waiting; `include_child_teams` also picks from its child teams' people; `excluded` lists usernames never picked; `notify_team` also tells the rest of the team. Fields left out keep their current value. Owners of the workspace and the team's maintainers. People only. Returns the team.

| Field | |
| --- | --- |
| `enabled` | Off, everyone in the team is asked. On, `count` people are picked and asked, and the team stays shown as asked beside them. |
| `algorithm` | `round_robin`: whoever this team asked least recently. `load_balance`: whoever has the fewest pull requests waiting on their review. |
| `count` | How many to pick, 1 to 10. People from the team already asked count towards it. |
| `skip_busy`, `busy_at` | Leave out anyone with `busy_at` (1 to 100) or more pull requests waiting on their review. |
| `include_child_teams` | Also pick from its child teams' people. |
| `excluded` | Usernames never picked. Replaces the whole list. |
| `notify_team` | Also tell the rest of the team when people are picked. |

Fields left out keep their value. The pull request's author is never picked. See [Teams](/guides/teams/).

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`team`](/reference/mcp/#team) with `action` `set_review_assignment`, and the same inputs
- **Scope:** An access token needs [`workspace:admin`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace` | string | Yes | The workspace's slug, e.g. "flagon-io". |
| `team` | string | Yes | The team's slug, as in its mention @workspace/slug, e.g. "backend". |

## Body parameters

Send a JSON object. Names are `snake_case`, as in responses; the `camelCase` spelling is accepted too.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean | No | On: g1t picks count people from the team to ask. Off: everyone in it is asked. |
| `algorithm` | string | No | round_robin: whoever this team asked least recently. load_balance: whoever has the fewest pull requests waiting on their review. One of `round_robin`, `load_balance`. |
| `count` | integer | No | How many people to pick, 1 to 10. People from the team already asked count towards it. |
| `skip_busy` | boolean | No | Leave out anyone with busy_at or more pull requests waiting on their review. |
| `busy_at` | integer | No | With skip_busy: how many waiting reviews make someone busy, 1 to 100. |
| `include_child_teams` | boolean | No | Also the people of its child teams: listed with [`list_members`](/reference/api/members/list-members/), picked from with review assignment. |
| `excluded` | array of strings | No | Usernames never picked. Replaces the whole list. |
| `notify_team` | boolean | No | Also tell the rest of the team when people are picked. |

## Example request

```sh
curl -X PUT https://api.g1t.sh/workspaces/flagon-io/teams/backend/review_assignment \
  -H "Authorization: Bearer $G1T_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "algorithm": "load_balance",
    "count": 2,
    "skip_busy": true,
    "busy_at": 5,
    "excluded": [
      "syntaqx"
    ]
  }'
```

## Example response

A successful request answers `200` with:

```json
{
  "id": "team_01m52k8d3f7h1k5n9r3v7z1c5g",
  "workspace": "flagon-io",
  "slug": "backend",
  "name": "Backend",
  "description": "The API and the services behind it.",
  "visibility": "visible",
  "parent": {
    "slug": "engineering",
    "name": "Engineering"
  },
  "notify": true,
  "review_assignment": {
    "enabled": true,
    "algorithm": "load_balance",
    "count": 2,
    "skip_busy": true,
    "busy_at": 5,
    "include_child_teams": false,
    "excluded": [
      "syntaqx"
    ],
    "notify_team": false
  },
  "members_count": 4,
  "repos_count": 2,
  "child_teams_count": 1,
  "viewer_role": "maintainer",
  "can_manage": true,
  "created_at": "2026-10-06T15:02:11.480Z",
  "updated_at": "2026-10-07T09:44:03.512Z"
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 409 | `conflict` | The request conflicts with the current state. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
