Notifications
List notifications
List all notifications that exist in Directus.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
What metadata to return in the response.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Cursor for use in pagination. Often used in combination with limit.
Responses
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
GET /notifications
import { createDirectus, rest, readNotifications } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readNotifications(query_object));
type Query {
notifications: [directus_notifications]
}
{
"data": [
{
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "inbox",
"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"
}
],
"meta": {}
}
Create Multiple notifications
Create multiple new notifications.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
Responses
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
POST /notifications
import { createDirectus, rest, createNotifications } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createNotifications(notification_object_array));
type Mutation {
create_notifications_items(data: [create_directus_notifications_input!]!): [directus_notifications]
}
{
"data": [
{
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "inbox",
"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"
}
],
"meta": {}
}
Delete Multiple notifications
Delete multiple existing notifications.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Responses
DELETE /notifications
import { createDirectus, rest, deleteNotifications } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteNotifications(notification_id_array));
type Mutation {
delete_notifications_items(ids: [ID!]!): delete_many
}
Update Multiple notifications
Update multiple notifications at the same time.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
Responses
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
PATCH /notifications
import { createDirectus, rest, updateNotifications } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateNotifications(notification_id_array, partial_notification_object));
type Mutation {
update_notifications_items(ids: [ID!]!, data: update_directus_notifications_input): [directus_notifications]
}
{
"data": [
{
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "inbox",
"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"
}
],
"meta": {}
}
Create a Notification
Create a new notification.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
Responses
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
POST /notifications
import { createDirectus, rest, createNotification } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createNotification(notification_object));
type Mutation {
create_notifications_item(data: create_directus_notifications_input!): directus_notifications
}
{
"data": {
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "inbox",
"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"
}
}
Retrieve a notification
List an existing notification by primary key.
Query Parameters
Unique identifier of the notification.
Control what fields are being returned in the object.
What metadata to return in the response.
Responses
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
GET /notifications/{id}
import { createDirectus, rest, readNotification } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readNotification(notification_id, query_object));
type Query {
notifications_by_id(id: ID!): directus_notifications
}
{
"data": {
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "inbox",
"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"
}
}
Delete an notification
Delete an existing notification.
Query Parameters
Unique identifier of the notification.
Responses
DELETE /notifications/{id}
import { createDirectus, rest, deleteNotification } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteNotification(notification_id));
type Mutation {
delete_notifications_item(id: ID!): delete_one
}
Update a Notification
Update an existing notification.
Query Parameters
Unique identifier of the notification.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
Responses
Primary key of the revision.
Timestamp in ISO8601 when the notification was created.
Current status of the notification. One of "inbox", "archived"
User that received the notification.
User that sent the notification, if any.
Subject line of the message.
Subject line of the message.
Collection this notification references.
Primary key of the item this notification references.
PATCH /notifications/{id}
import { createDirectus, rest, updateNotification } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateNotification(notification_id, partial_notification_object));
type Mutation {
update_notifications_item(id: ID!, data: update_directus_notifications_input): directus_notifications
}
{
"data": {
"id": 2,
"timestamp": "2021-11-24T13:57:35Z",
"status": "inbox",
"recipient": "3EE34828-B43C-4FB2-A721-5151579B08EA",
"sender": "497a495e-5529-4e46-8feb-2f35e9b85601",
"subject": "inbox",
"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"
}
}