Notifications

The Notifications API has methods for managing notifications.

Get notification

Get a notification by id.

GET /api/notifications/{id}
Path parameters
id integer required

Notification id.

Query parameters
trashed boolean

true to return notification even if trashed.

Example request
curl https://{WEAVY-SERVER}/api/notifications/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes

200 Success
401 Unauthorized
404 Not Found

Response schema
{
  "id": "integer",
  "action": "string",
  "actor_id": "integer",
  "actor": {
    "id": "integer",
    "uid": "string",
    "display_name": "string",
    "email": "string",
    "given_name": "string",
    "middle_name": "string",
    "name": "string",
    "family_name": "string",
    "nickname": "string",
    "phone_number": "string",
    "comment": "string",
    "directory_id": "integer",
    "picture_id": "integer",
    "avatar_url": "string",
    "metadata": "object",
    "tags": [
      "string"
    ],
    "presence": "string",
    "created_at": "string",
    "modified_at": "string",
    "is_bot": "boolean",
    "is_suspended": "boolean",
    "is_trashed": "boolean"
  },
  "template": "string",
  "args": [
    "string"
  ],
  "text": "string",
  "html": "string",
  "plain": "string",
  "link": {
    "id": "integer",
    "type": "string"
  },
  "url": "string",
  "user_id": "integer",
  "user": {
    "id": "integer",
    "uid": "string",
    "display_name": "string",
    "email": "string",
    "given_name": "string",
    "middle_name": "string",
    "name": "string",
    "family_name": "string",
    "nickname": "string",
    "phone_number": "string",
    "comment": "string",
    "directory_id": "integer",
    "picture_id": "integer",
    "avatar_url": "string",
    "metadata": "object",
    "tags": [
      "string"
    ],
    "presence": "string",
    "created_at": "string",
    "modified_at": "string",
    "is_bot": "boolean",
    "is_suspended": "boolean",
    "is_trashed": "boolean"
  },
  "metadata": "object",
  "created_at": "string",
  "is_unread": "boolean"
}

List notifications

List notifications for the authenticated user.

GET /api/notifications
Query parameters
action string

List notifications that were triggered by actions of this type, e.g. message_created or comment_updated etc.

unread boolean

true lists unread notifications, false lists read notifications and null (default) lists all notifications whether they are read or not.

q string

A query used to find matching items.

tag string

List items with the specified tag.

trashed boolean

Indicates whether trashed items should be listed (default is false). Specify null to return both trashed and non-trashed items.

order_by string

Specifies the sort order and direction for the listing, e.g. "name" or "name+desc"

top integer

Maximum number of items to return in the listing. Should be a value between 1 and 100. Default is 25.

skip integer

The number of items to skip. Used together with top to return a specific range of items (for pagination).

count_only boolean

true to only return the number of matching items; when this is specified the response will only contain the count property.

Example request
curl https://{WEAVY-SERVER}/api/notifications?top=10&unread=true
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes

200 Success
401 Unauthorized

Response schema
{
  "data": [
    {
      "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"
    }
  ],
  "start": "integer",
  "end": "integer",
  "count": "integer"
}

Mark as read

Mark a notification as read.

PUT /api/notifications/{id}/mark
Path parameters
id integer required

Notification id.

Example request
curl -X PUT https://{WEAVY_SERVER}/api/notifications/1/mark
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes

200 Success
401 Unauthorized
404 Not Found

Response schema
{
  "id": "integer",
  "action": "string",
  "actor_id": "integer",
  "actor": {
    "id": "integer",
    "uid": "string",
    "display_name": "string",
    "email": "string",
    "given_name": "string",
    "middle_name": "string",
    "name": "string",
    "family_name": "string",
    "nickname": "string",
    "phone_number": "string",
    "comment": "string",
    "directory_id": "integer",
    "picture_id": "integer",
    "avatar_url": "string",
    "metadata": "object",
    "tags": [
      "string"
    ],
    "presence": "string",
    "created_at": "string",
    "modified_at": "string",
    "is_bot": "boolean",
    "is_suspended": "boolean",
    "is_trashed": "boolean"
  },
  "template": "string",
  "args": [
    "string"
  ],
  "text": "string",
  "html": "string",
  "plain": "string",
  "link": {
    "id": "integer",
    "type": "string"
  },
  "url": "string",
  "user_id": "integer",
  "user": {
    "id": "integer",
    "uid": "string",
    "display_name": "string",
    "email": "string",
    "given_name": "string",
    "middle_name": "string",
    "name": "string",
    "family_name": "string",
    "nickname": "string",
    "phone_number": "string",
    "comment": "string",
    "directory_id": "integer",
    "picture_id": "integer",
    "avatar_url": "string",
    "metadata": "object",
    "tags": [
      "string"
    ],
    "presence": "string",
    "created_at": "string",
    "modified_at": "string",
    "is_bot": "boolean",
    "is_suspended": "boolean",
    "is_trashed": "boolean"
  },
  "metadata": "object",
  "created_at": "string",
  "is_unread": "boolean"
}

Mark as unread

Mark a notification as unread.

DELETE /api/notifications/{id}/mark
Path parameters
id integer required

Notification id.

Example request
curl -X DELETE https://{WEAVY_SERVER}/api/notifications/1/mark
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes

200 Success
401 Unauthorized
404 Not Found

Response schema
{
  "id": "integer",
  "action": "string",
  "actor_id": "integer",
  "actor": {
    "id": "integer",
    "uid": "string",
    "display_name": "string",
    "email": "string",
    "given_name": "string",
    "middle_name": "string",
    "name": "string",
    "family_name": "string",
    "nickname": "string",
    "phone_number": "string",
    "comment": "string",
    "directory_id": "integer",
    "picture_id": "integer",
    "avatar_url": "string",
    "metadata": "object",
    "tags": [
      "string"
    ],
    "presence": "string",
    "created_at": "string",
    "modified_at": "string",
    "is_bot": "boolean",
    "is_suspended": "boolean",
    "is_trashed": "boolean"
  },
  "template": "string",
  "args": [
    "string"
  ],
  "text": "string",
  "html": "string",
  "plain": "string",
  "link": {
    "id": "integer",
    "type": "string"
  },
  "url": "string",
  "user_id": "integer",
  "user": {
    "id": "integer",
    "uid": "string",
    "display_name": "string",
    "email": "string",
    "given_name": "string",
    "middle_name": "string",
    "name": "string",
    "family_name": "string",
    "nickname": "string",
    "phone_number": "string",
    "comment": "string",
    "directory_id": "integer",
    "picture_id": "integer",
    "avatar_url": "string",
    "metadata": "object",
    "tags": [
      "string"
    ],
    "presence": "string",
    "created_at": "string",
    "modified_at": "string",
    "is_bot": "boolean",
    "is_suspended": "boolean",
    "is_trashed": "boolean"
  },
  "metadata": "object",
  "created_at": "string",
  "is_unread": "boolean"
}

Mark (all) as read

Mark (all) notifications as read.

PUT /api/notifications/mark
Query parameters
id integer

Optional 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.

Example request
curl -X PUT https://{WEAVY_SERVER}/api/notifications/mark
-H "Authorization: Bearer {ACCESS-TOKEN}"
            
curl -X PUT https://{WEAVY_SERVER}/api/notifications/mark?id=3
-H "Authorization: Bearer {ACCESS-TOKEN}"
Response codes

204 No Content

Delete notification

Delete a notification.

DELETE /api/notifications/{id}
Path parameters
id integer required

Notification id.

Example request
curl -X DELETE https://{WEAVY_SERVER}/api/notifications/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes

204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found