Notifications
The Notifications API has methods for managing notifications.
Get notification
Get a notification by id.
GET /api/notifications/{id}
Path parameters
id
integer requiredNotification id.
Query parameters
trashed
booleantrue
to return notification even if trashed.
Response codes
200 Success
{
"id": "integer",
"action": "string",
"actor_id": "integer",
"template": "string",
"args": [
"string"
],
"text": "string",
"html": "string",
"plain": "string",
"url": "string",
"user_id": "integer",
"metadata": "object",
"created_at": "string",
"is_unread": "boolean"
}
Code sample
curl https://{WEAVY-SERVER}/api/notifications/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Delete notification
Delete a notification.
DELETE /api/notifications/{id}
Path parameters
id
integer requiredNotification id.
Response codes
204 No Content
Code sample
$ curl -X DELETE {WEAVY_SERVER}/api/notifications/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Mark as read
Mark a notification as read.
PUT /api/notifications/{id}/mark
Path parameters
id
integer requiredNotification id.
Response codes
200 Success
{
"id": "integer",
"action": "string",
"actor_id": "integer",
"template": "string",
"args": [
"string"
],
"text": "string",
"html": "string",
"plain": "string",
"url": "string",
"user_id": "integer",
"metadata": "object",
"created_at": "string",
"is_unread": "boolean"
}
404 Not Found
Code sample
$ curl -X PUT {WEAVY_SERVER}/api/notifications/1/mark
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Mark as unread
Mark a notification as unread.
DELETE /api/notifications/{id}/mark
Path parameters
id
integer requiredNotification id.
Response codes
200 Success
{
"id": "integer",
"action": "string",
"actor_id": "integer",
"template": "string",
"args": [
"string"
],
"text": "string",
"html": "string",
"plain": "string",
"url": "string",
"user_id": "integer",
"metadata": "object",
"created_at": "string",
"is_unread": "boolean"
}
404 Not Found
Code sample
$ curl -X DELETE {WEAVY_SERVER}/api/notifications/1/mark
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Mark (all) as read
Mark (all) notifications as read.
PUT /api/notifications/mark
Query parameters
id
integerOptional id of last seen notification. When specified, this and previous notifications are marked as read, otherwise all notifications (uncluding yet unseen) are marked as read.
Response codes
200 Success
Code sample
$ curl -X PUT {WEAVY_SERVER}/api/notifications/mark
-H "Authorization: Bearer {ACCESS-TOKEN}"
$ curl -X PUT {WEAVY_SERVER}/api/notifications/mark?id=3
-H "Authorization: Bearer {ACCESS-TOKEN}"
List notifications
List notifications for the authenticated user.
GET /api/notifications
Query parameters
action
stringList notifications that were triggered by actions of this type, e.g.
message_created
orcomment_updated
etc.
unread
booleantrue
lists unread notifications,false
lists read notifications andnull
(default) lists all notifications whether they are read or not.
q
stringA query used to find matching items.
tag
stringList items with the specified tag.
trashed
booleanIndicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
stringSpecifies the sort order and direction for the listing, e.g. "
name
" or "name+desc
"
top
integerMaximum number of items to return in the listing. Should be a value between
0
and100
. Default is25
.
skip
integerThe number of items to skip. Used together with
top
to return a specific range of items (for pagination).
count
booleanfalse
to skip counting the total number of matching items; default istrue
.
count_only
booleantrue
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Response codes
200 Success
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Code sample
curl https://{WEAVY-SERVER}/api/notifications?top=10&unread=true
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"