thread-message-added


Event: #

This event is fired when a new message is added to a thread, whether via the UI or API or anywhere else.

Payload #


message #

WebhookMessage

This is an object with the following fields:


author #

ClientUserData

This is an object with the following fields:


id
string
The user's ID. This is unique within an application.

name
string | null
The user's name.

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.

metadata
EntityMetadata
Any metadata that has been set for the user.

id #

string
The ID for the message. If a message is created with no ID, a random UUID-based ID will be automatically created for it.

iconURL #

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

createdTimestamp #

Date
The timestamp when this message was created. The default value is the current time.

metadata #

EntityMetadata
Arbitrary key-value pairs that can be used to store additional information.

url #

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

content #

object[]
The content of the message.

organizationID #

string
The ID for the organization this message belongs to.

threadID #

string
The ID for the thread this message is part of.

plaintext #

string
A plaintext version of the structured message content.

reactions #

Reaction[]
The reactions to this message.

attachments #

array
The items attached to this message.

seenBy #

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

extraClassnames #

string | null
A optional space separated list of classnames to add to the message.

thread #

CoreThreadData

This is an object with the following fields:


id #

string
The ID for this thread.

organizationID #

string
The organization ID this thread is in.

total #

number
The total number of messages in this thread. Equal to user messages + action messages. Deleted messages are excluded from this count.

userMessages #

number
The number of messages in this thread that were sent by users (i.e., not action messages).

actionMessages #

number
The number of action messages sent in this thread. An example is the message that appears when a thread is resolved.

deletedMessages #

number
The number of deleted messages in this thread.

resolved #

boolean
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.

subscribers #

string[]
All of the users who are subscribed to this thread.

repliers #

string[]
All of the users who have replied to this thread.

typing #

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

name #

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

url #

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

location #

Location
The location of this thread.

metadata #

EntityMetadata
Arbitrary key-value pairs that can be used to store additional information.

extraClassnames #

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

id #

string
The user's ID. This is unique within an application.

name #

string | null
The user's name.

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.

metadata #

EntityMetadata
Any metadata that has been set for the user.

Ask Cordy