List notifications

List all notifications that exist in Directus.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

offset
integer

How many items to skip when fetching data.

meta
string

What metadata to return in the response.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

page
integer

Cursor for use in pagination. Often used in combination with limit.

Response

Successful request

data
array
meta
object
GET /notifications
Response Example
{
  "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

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Request Body

data
array

Response

Successful request

data
array
meta
object
POST /notifications
Response Example
{
  "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

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Request Body

An array of notification primary keys.

[array]
array
DELETE /notifications

Update Multiple notifications

Update multiple notifications at the same time.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Request Body

data
object
keys
array

Response

Successful request

data
array
meta
object
PATCH /notifications
Response Example
{
  "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

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Request Body

[object]
object

Response

Successful request

data
object
POST /notifications‎
Response Example
{
  "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

id
string

Unique identifier of the notification.

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Response

Successful request

data
object
GET /notifications/{id}
Response Example
{
  "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

id
string

Unique identifier of the notification.

DELETE /notifications/{id}

Update a Notification

Update an existing notification.

Query Parameters

id
string

Unique identifier of the notification.

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Request Body

[object]
object

Response

Successful request

data
object
PATCH /notifications/{id}
Response Example
{
  "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"
  }
}