notification-created

Ask the Community

This event is fired when a new notification is created, whether via the UI or API or anywhere else.


Payload #


id #

string
The ID for this notification.


senderUserIDs #

string[]
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).


recipientUserID #

string


iconUrl #

string | null
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).


NotificationHeaderNode[]
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:

  • NotificationTextHeader

    This is an object with the following fields:

    Show property details

  • NotificationUserHeader

    This is an object with the following fields:

    Show property details



attachment #

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:

  • null
  • NotificationURLAttachment

    This is an object with the following fields:

    Show property details

  • NotificationMessageAttachment

    This is an object with the following fields:

    Show property details



readStatus #

"unread" | "read"
Whether this notification has been read by the recipient yet.


timestamp #

Date
The time this notification was sent.


metadata #

EntityMetadata
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).

Not finding the answer you need? Ask our Developer Community

Ask Cordy