This event is fired when a new notification is created, whether via
the UI or API or anywhere else.
Payload #
The
ID for this notification.
The
IDs of the user(s) who sent this notification. The Cord backend will sometimes aggregate multiple notifications together, causing them to have multiple senders. For example, if multiple people react to the same message, that will generate only one notification (but with multiple senders, one for each person who reacted).
The URL of an icon image for this notification, if one was specified when it was created. This will always be null
for Cord's internally-generated notifications (i.e., it can only be non-null for notifications you create via the REST API).
The "header" or "text" of the notification. This will represent text like "Alice replied to your thread." or similar. For notifications you create via the REST API, this will be based upon the template
parameter, see below.
This is an array of items. Each item can be one of the following:
This is an object with the following fields:
This is an object with the following fields:
Additional context attached to the notification. For example, if this notification is about a new reaction on a message, the attachment will specify what message received that new reaction.
A renderer will typically check the type
field of the attachment and render that attachment type below the header
.
This property can be one of the following:
NotificationURLAttachment
This is an object with the following fields:
NotificationMessageAttachment
This is an object with the following fields:
readStatus #
"unread" | "read"
Whether this notification has been read by the recipient yet.
The time this notification was sent.
An arbitrary JSON object specified when the notification was created. This will always be an empty object for Cord's internally-generated notifications (i.e., it can only be non-null for notifications you create via the REST API).