notifications
Receive notifications for activity on your account or statuses.
get
Get all notifications
Notifications concerning the user. This API returns Link headers containing links to the next/previous page. However, the links can also be constructed dynamically using query params and id
values.
Returns: Array of Notification
OAuth: User token + read:notifications
Version history:
0.0.0 - added
2.6.0 - add min_id
2.9.0 - add account_id
3.1.0 - add follow_request
type
Request
Headers
string
Query Parameters
string
string
string
string
array
follow
, favourite
, reblog
, mention
, poll
, follow_request
)
string
Response
200: Success
Sample call with limit=2. Use the Link header for pagination
Link: <https://mastodon.social/api/v1/notifications?max_id=34975535>; rel="next", <https://mastodon.social/api/v1/notifications?min_id=34975861>;
[
{
"id": "34975861",
"type": "mention",
"created_at": "2019-11-23T07:49:02.064Z",
"account": {
"id": "971724",
"username": "zsc",
"acct": "zsc",
...
},
"status": {
"id": "103186126728896492",
"created_at": "2019-11-23T07:49:01.940Z",
"in_reply_to_id": "103186038209478945",
"in_reply_to_account_id": "14715",
...
"content": "<p><span class=\"h-card\"><a href=\"https://mastodon.social/@trwnh\" class=\"u-url mention\">@<span>trwnh</span></a></span> sup!</p>",
...
"account": {
"id": "971724",
"username": "zsc",
"acct": "zsc",
...
},
...
"mentions": [
{
"id": "14715",
"username": "trwnh",
"url": "https://mastodon.social/@trwnh",
"acct": "trwnh"
}
],
...
}
},
{
"id": "34975535",
"type": "favourite",
"created_at": "2019-11-23T07:29:18.903Z",
"account": {
"id": "297420",
"username": "haskal",
"acct": "haskal@cybre.space",
...
},
"status": {
"id": "103186046267791694",
"created_at": "2019-11-23T07:28:34.210Z",
"in_reply_to_id": "103186044372624124",
"in_reply_to_account_id": "297420",
...
"account": {
"id": "14715",
"username": "trwnh",
"acct": "trwnh",
...
}
}
}
]
401: Unauthorized
Invalid or missing Authorization header
{
"error": "The access token is invalid"
}
get
Get a single notification
View information about a notification with a given ID.
Returns: Notification
OAuth: User token + read:notifications
Version history:
0.0.0 - added
Request
Path Parameters
string
Headers
string
Response
200: Success
A single Notification
{
"id": "34975861",
"type": "mention",
"created_at": "2019-11-23T07:49:02.064Z",
"account": {
"id": "971724",
"username": "zsc",
"acct": "zsc",
...
},
"status": {
"id": "103186126728896492",
"created_at": "2019-11-23T07:49:01.940Z",
"in_reply_to_id": "103186038209478945",
"in_reply_to_account_id": "14715",
...
"content": "<p><span class=\"h-card\"><a href=\"https://mastodon.social/@trwnh\" class=\"u-url mention\">@<span>trwnh</span></a></span> sup!</p>",
...
"account": {
"id": "971724",
"username": "zsc",
"acct": "zsc",
...
},
...
"mentions": [
{
"id": "14715",
"username": "trwnh",
"url": "https://mastodon.social/@trwnh",
"acct": "trwnh"
}
],
...
}
},
401: Unauthorized
Invalid or missing Authorization header
{
"error": "The access token is invalid"
}
post
Dismiss all notifications
Clear all notifications from the server.
Returns: empty object
OAuth: User token + write:notifications
Version history:
0.0.0 - added
Request
Headers
string
Response
200: Success
Notifications successfully cleared
{}
401: Unauthorized
Invalid or missing Authorization header
{
"error": "The access token is invalid"
}
post
Dismiss a single notification
Clear a single notification from the server.
Returns: empty object
OAuth: User token + write:notifications
Version history:
1.3.0 - added
Request
Path Parameters
string
Headers
string
Response
200: Success
Notification with given ID successfully dismissed
{}
401: Unauthorized
Invalid or missing Authorization header
{
"error": "The access token is invalid"
}
post
\(DEPRECATED\) Dismiss a single notification
Delete a single notification from the server.
Returns: empty object
OAuth: User token + write:notifications
Version history:
0.0.0 - available
3.0.0 - removed
Request
Headers
string
Form Data Parameters
string
Response
200: Success
Notification with given ID successfully dismissed
{}
401: Unauthorized
Invalid or missing Authorization header
{
"error": "The access token is invalid"
}
Last updated June 30, 2020 · Improve this page