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 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.
An optional translation key used for this message. This is useful for system-generated messages where you might want to translate or customize them at runtime. See the translations documentation for more information.
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.
This is an array of items. Each item can be one of the following:
MessageFileAttachment
This is an object with the following fields:
type
"file"
The type of this attachment, which is always file for file attachments.
id
string
The ID of the file.
name
string
The name of the file.
url
string
The URL that a user can use to download the file. This is a signed URL that will expire after 24 hours.
mimeType
string
The MIME type of the file.
size
number
The size of the file, in bytes.
uploadStatus
"uploading" | "uploaded" | "failed" | "cancelled"
The status of the file upload. uploading means that the user has not yet completed uploading the file, uploaded means the file is successfully uploaded, failed means the upload encountered an error, and cancelled means the user cancelled the upload before it was finished.
MessageAnnotationAttachment
This is an object with the following fields:
type
"annotation"
The type of this attachment, which is always annotation for annotation attachments.
screenshot
UploadedFile
The screenshot attached to the annotation.
This is an object with the following fields:
id
string
The ID of the file.
name
string
The name of the file.
url
string
The URL that a user can use to download the file. This is a signed URL that will expire after 24 hours.
mimeType
string
The MIME type of the file.
size
number
The size of the file, in bytes.
uploadStatus
"uploading" | "uploaded" | "failed" | "cancelled"
The status of the file upload. uploading means that the user has not yet completed uploading the file, uploaded means the file is successfully uploaded, failed means the upload encountered an error, and cancelled means the user cancelled the upload before it was finished.
textContent
string | null
(Optional) The text that was selected when creating the annotation.
MessageScreenshotAttachment
This is an object with the following fields:
type
"screenshot"
The type of this attachment, which is always screenshot for screenshot attachments.
screenshot
UploadedFile
The screenshot attached to the message. Screenshots are attached via screenshotOptions.captureWhen API.
This is an object with the following fields:
id
string
The ID of the file.
name
string
The name of the file.
url
string
The URL that a user can use to download the file. This is a signed URL that will expire after 24 hours.
mimeType
string
The MIME type of the file.
size
number
The size of the file, in bytes.
uploadStatus
"uploading" | "uploaded" | "failed" | "cancelled"
The status of the file upload. uploading means that the user has not yet completed uploading the file, uploaded means the file is successfully uploaded, failed means the upload encountered an error, and cancelled means the user cancelled the upload before it was finished.
The hook will initially return undefined while the data loads from our API. Once it has loaded, your component will re-render and the hook will return an an object containing the message data. If no message matching the provided messageID is found, it will return null instead.