# Mark notifications as read

`PUT /notifications/mark-read.json`

Authentication: no security requirement declared for this operation.

Request body: application/json

Type: object

- `id` (optional)
  Type: integer
  
  (optional) Leave off to mark all notifications as
  read

Responses:

- 200: notifications marked read

Content type: application/json

Type: object

- `success` (optional)
  Type: string

## Examples

### cURL

```bash
curl -X PUT 'https://discourse.example.com/notifications/mark-read.json' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 0
}'
```

### JavaScript

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

const response = await fetch('https://discourse.example.com/notifications/mark-read.json', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

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

response = requests.put(
    'https://discourse.example.com/notifications/mark-read.json',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
