# Set notification level

`POST /t/{id}/notifications.json`

Authentication: no security requirement declared for this operation.

Parameters:

- `Api-Key` (header, string, required)
  Type: string

- `Api-Username` (header, string, required)
  Type: string

- `id` (path, string, required)
  Type: string

Request body: application/json

Type: object

- `notification_level` (required)
  Type: string
  
  enum: ["0","1","2","3"]

Responses:

- 200: topic updated

Content type: application/json

Type: object

- `success` (optional)
  Type: string
  
  Example:
  
  ```json
  "OK"
  ```

## Examples

### cURL

```bash
curl -X POST 'https://discourse.example.com/t/string/notifications.json' \
  -H 'Api-Key: string' \
  -H 'Api-Username: string' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "notification_level": "0"
}'
```

### JavaScript

```javascript
const body = `{
  "notification_level": "0"
}`;

const response = await fetch('https://discourse.example.com/t/string/notifications.json', {
  method: 'POST',
  headers: {
    'Api-Key': 'string',
    'Api-Username': 'string',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "notification_level": "0"
}'''

response = requests.post(
    'https://discourse.example.com/t/string/notifications.json',
    data=body.encode('utf-8'),
    headers={
        'Api-Key': 'string',
        'Api-Username': 'string',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
