Notifications
Notifications allow you to send/receive messages to/from other users of the platform.
The Notification Object
id integer
Primary key of the revision.
timestamp string
Timestamp in ISO8601 when the notification was created.
status string
Current status of the notification. One of "inbox", "archived".
recipient many-to-one
User that received the notification.
sender many-to-one
User that sent the notification, if any.
subject string
Subject line of the message.
message string
Notification's message content. Will be sent in the email.
collection string
Collection this notification references.
item string
Primary key of the item this notification references.
{
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "You were mentioned in articles",
"message": "\nHello admin@example.com,\n\rijk@directus.io has mentioned you in a comment:\n\n> Hello <em>admin@example.com</em>!\n\n<a href=\"http://localhost:8080/admin/content/articles/1\">Click here to view.</a>\n",
"collection": "articles",
"item": "1"
}{
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "You were mentioned in articles",
"message": "\nHello admin@example.com,\n\rijk@directus.io has mentioned you in a comment:\n\n> Hello <em>admin@example.com</em>!\n\n<a href=\"http://localhost:8080/admin/content/articles/1\">Click here to view.</a>\n",
"collection": "articles",
"item": "1"
}List Notifications
List all notifications that exist in Directus.
Request
Query Parameters
Supports all global query parameters.
Response
An array of up to limit notification objects. If no items are available, data will be an empty array.
Example
Retrieve a notification
List an existing notification by primary key.
Request
Query Parameters
Supports all global query parameters.
Response
Returns the requested notification object.
Example
Create a Notification
Create a new notification.
Request
Query Parameters
Supports all global query parameters.
Request Body
A partial notification object.
Response
Returns the notification object for the created notification.
Example
Create Multiple Notifications
Create multiple new notifications.
Request
Query Parameters
Supports all global query parameters.
Request Body
An array of partial notification objects.
Response
Returns the notification object for the created notification.
Example
Update a Notification
Update an existing notification.
Email Notifications
Emails are only sent when the notification is created. Updated to an existing notification won't trigger a new notification email to be sent.
Request
Query Parameters
Supports all global query parameters.
Request Body
A partial notification object.
Response
Returns the notification object for the updated notification.
Example
Update Multiple Notifications
Update multiple existing notifications.
Request
Query Parameters
Supports all global query parameters.
Request Body
keys Required
Array of primary keys of the notifications you'd like to update.
data Required
Any of the notification object's properties.
Response
Returns the notification objects for the updated notifications.
Example
Delete a Notification
Delete an existing notification.
Request
Response
Empty body.
Example
Delete Multiple Notifications
Delete multiple existing notifications.
Request
Request Body
An array of notification primary keys
Response
Empty body.