# Set a repository subscription

From **GitHub v3 REST API**.

`PUT /repos/{owner}/{repo}/subscription`

If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-repository-subscription) completely.

## Parameters

### `owner`

- Location: path
- Required: true
- Type: `string`

### `repo`

- Location: path
- Required: true
- Type: `string`

## Request body

- Required: false
### `application/json`

- Type: `object`

```json
{"properties":{"ignored":{"description":"Determines if all notifications should be blocked from this repository.","type":"boolean"},"subscribed":{"description":"Determines if notifications should be received from this repository.","type":"boolean"}},"type":"object"}
```

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Repository invitations let you manage who you collaborate with.

```json
{
  "created_at": "2012-10-06T21:34:12Z",
  "ignored": false,
  "reason": null,
  "repository_url": "https://api.github.com/repos/octocat/example",
  "subscribed": true,
  "url": "https://api.github.com/repos/octocat/example/subscription"
}
```

```json
{"description":"Repository invitations let you manage who you collaborate with.","properties":{"created_at":{"example":"2012-10-06T21:34:12Z","format":"date-time","type":"string"},"ignored":{"description":"Determines if all notifications should be blocked from this repository.","type":"boolean"},"reason":{"nullable":true,"type":"string"},"repository_url":{"example":"https://api.github.com/repos/octocat/example","format":"uri","type":"string"},"subscribed":{"description":"Determines if notifications should be received from this repository.","example":true,"type":"boolean"},"url":{"example":"https://api.github.com/repos/octocat/example/subscription","format":"uri","type":"string"}},"required":["created_at","ignored","reason","subscribed","url","repository_url"],"title":"Repository Invitation","type":"object"}
```

## Request examples

### cURL

```shell
curl --request PUT \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/subscription \
  --header 'content-type: application/json' \
  --data '{
  "ignored": true,
  "subscribed": true
}'
```
