Add documentation for GET /api/v1/notifications/policy

This commit is contained in:
Claire 2024-05-17 16:07:24 +02:00 committed by GitHub
parent 5f0bd3cb77
commit c1c822c509
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 56 additions and 0 deletions

View File

@ -391,6 +391,62 @@ Invalid or missing Authorization header.
---
## Get the filtering policy for notifications {#get-policy}
```http
GET /api/v1/notifications/policy HTTP/1.1
```
Notifications filtering policy for the user.
**Returns:** [NotificationPolicy]({{< relref "entities/NotificationPolicy" >}})\
**OAuth:** User token + `read:notifications`\
**Version history:**\
4.3.0 - added
#### Request
##### Headers
Authorization
: {{<required>}} Provide this header with `Bearer <user token>` to gain authorized access to this API method.
#### Response
```http
GET https://mastodon.social/api/v1/notifications/policy HTTP/1.1
Authorization: Bearer xxx
```
##### 200: OK
The response body contains the current notifications filtering policy for the user.
```json
{
"filter_not_following": false,
"filter_not_followers": false,
"filter_new_accounts": false,
"filter_private_mentions": true,
"summary": {
"pending_requests_count": 0,
"pending_notifications_count": 0
}
}
```
##### 401: Unauthorized
Invalid or missing Authorization header.
```json
{
"error": "The access token is invalid"
}
```
---
## See also
{{< page-relref ref="methods/push" caption="push API methods" >}}