Event: #
This event is fired when a new message is added to a thread, whether via the UI or API or anywhere else.
Payload #
This is an object with the following fields:
This is an object with the following fields:
The user's ID. This is unique within an application.
The user's short name. In most cases, Cord components will prefer using this name over name
when set.
profilePictureURL
string | null
A URL to the user's profile picture.
Any metadata that has been set for the user.
The ID for the message. If a message is created with no ID, a random UUID-based ID will be automatically created for it.
The URL of the icon to show next to the message. This is only used for action_message
messages; other messages show the avatar of the author. If an action_message
does not have an icon set, no icon is shown.
The timestamp when this message was created. The default value is the current time.
Arbitrary key-value pairs that can be used to store additional information.
A URL where the message can be seen. This determines where a user is sent when they click on a reference to this message, such as in a notification. If unset, it defaults to the thread's URL.
The content of the message.
The ID for the organization this message belongs to.
The ID for the thread this message is part of.
A plaintext version of the structured message content.
The reactions to this message.
The items attached to this message.
A list of IDs of the users that have seen the message.
deletedTimestamp #
Date | null
The timestamp when this message was deleted, if it was. If unset, the message is not deleted.
updatedTimestamp #
Date | null
The timestamp when this message was last edited, if it ever was. If unset, the message does not show as edited.
type #
"action_message" | "user_message"
The type of message this is. A user_message
is a message that the author sent. An action_message
is a message about something that happened, such as the thread being resolved. The default value is user_message
.
A optional space separated list of classnames to add to the message.
This is an object with the following fields:
The organization ID this thread is in.
The total number of messages in this thread. Equal to user messages + action messages. Deleted messages are excluded from this count.
The number of messages in this thread that were sent by users (i.e., not action messages).
The number of action messages sent in this thread. An example is the message that appears when a thread is resolved.
The number of deleted messages in this thread.
Whether this thread is resolved. This is equivalent to checking if resolvedTimestamp
is null.
resolvedTimestamp #
Date | null
The timestamp when this thread was resolved. Set to null
if this thread is not resolved.
participants #
ThreadParticipant[]
All of the users who are engaging in this thread. This includes both subscribed and unsubscribed users.
All of the users who are subscribed to this thread.
All of the users who have replied to this thread.
The users that are currently typing in this thread. Typing status is transient in nature, so the value is the set of users typing at a particular instant, but may change rapidly.
The name of the thread. This is shown to users when the thread is referenced, such as in notifications. This should generally be something like the page title.
A URL where the thread can be seen. This determines where a user is sent when they click on a reference to this thread, such as in a notification, or if they click on a reference to a message in the thread and the message doesn't have its own URL.
Arbitrary key-value pairs that can be used to store additional information.
An optional space separated list of classnames to add to the thread.
usersToNotify #
UsersToNotify[]
This is an array of objects, each of which has the following fields:
replyActions #
"create-thread" | "mention" | "assign-task" | "unassign-task" | "attach-file"[] | null
The user's ID. This is unique within an application.
shortName #
string | null
The user's short name. In most cases, Cord components will prefer using this name over name
when set.
profilePictureURL #
string | null
A URL to the user's profile picture.
Any metadata that has been set for the user.