# Set a thread subscription

From **GitHub v3 REST API**.

`PUT /notifications/threads/{thread_id}/subscription`

If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.

You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-thread-subscription) endpoint.

## Parameters

### `thread_id`

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

thread_id parameter

## Request body

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

- Type: `object`

```json
{"properties":{"ignored":{"default":false,"description":"Whether to block all notifications from a thread.","type":"boolean"}},"type":"object"}
```

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Thread Subscription

```json
{
  "created_at": "2012-10-06T21:34:12Z",
  "ignored": false,
  "reason": null,
  "subscribed": true,
  "thread_url": "https://api.github.com/notifications/threads/1",
  "url": "https://api.github.com/notifications/threads/1/subscription"
}
```

```json
{"description":"Thread Subscription","properties":{"created_at":{"example":"2012-10-06T21:34:12Z","format":"date-time","nullable":true,"type":"string"},"ignored":{"type":"boolean"},"reason":{"nullable":true,"type":"string"},"repository_url":{"example":"https://api.github.com/repos/1","format":"uri","type":"string"},"subscribed":{"example":true,"type":"boolean"},"thread_url":{"example":"https://api.github.com/notifications/threads/1","format":"uri","type":"string"},"url":{"example":"https://api.github.com/notifications/threads/1/subscription","format":"uri","type":"string"}},"required":["created_at","ignored","reason","url","subscribed"],"title":"Thread Subscription","type":"object"}
```

### `304`

Not modified

### `401`

Requires authentication

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `403`

Forbidden

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request PUT \
  --url {protocol}://{hostname}/api/v3/notifications/threads/{thread_id}/subscription \
  --header 'content-type: application/json' \
  --data '{
  "ignored": true
}'
```
