# Watch a repository

> Watch a repository you can read: give level, with events for custom; or, as booleans, subscribed (all its activity, or with false, only what you take part in) and ignored (nothing at all).

<div class="g1t-endpoint"><span class="g1t-method" data-method="put">PUT</span><code>/repos/{owner}/{name}/subscription</code></div>

Returns how you watch it now.

| `level` | You hear of |
| --- | --- |
| `participating` | What you take part in, or are mentioned in (the default) |
| `all` | Every issue and pull request opened, commented on, closed or merged, and every deployment |
| `custom` | What you take part in, and the kinds in `events`: `issues`, `pulls`, `deployments`, `security` |
| `ignore` | Nothing, not even a mention |

Instead of `level`, `{"subscribed": true}` is `all`, `{"subscribed": false}` is `participating` and `{"ignored": true}` is `ignore`.

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

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |

## Body parameters

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

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `level` | string | No | participating: only what you take part in. all: all its activity. ignore: nothing. custom: what you take part in, and events. One of `participating`, `all`, `ignore`, `custom`. |
| `events` | array of strings | No | With custom: the kinds of activity to hear of. One of `issues`, `pulls`, `deployments`, `security`. |
| `subscribed` | boolean | No | Instead of level: true for all its activity, false for only what you take part in. |
| `ignored` | boolean | No | Instead of level: true to hear of nothing on it. |

## Example request

```sh
curl -X PUT https://api.g1t.sh/repos/flagon-io/hello/subscription \
  -H "Authorization: Bearer $G1T_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "level": "custom",
    "events": [
      "pulls",
      "deployments"
    ]
  }'
```

## Example response

A successful request answers `200` with:

```json
{
  "repo": "flagon-io/hello",
  "level": "custom",
  "events": [
    "pulls",
    "deployments"
  ],
  "subscribed": true,
  "ignored": false,
  "updated_at": "2026-10-07T10:06:00.000Z"
}
```

## 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. |
