Duvet DOCS
GitHub

Message Events

MESSAGE_CREATE

EVENT MESSAGE_CREATE

Sent when a new message is created in a room. Broadcast to all members with access to the room. A pin notice (type 2) is created too: its author pinned the message in referenced_message, and its content is null.

FieldTypeDescription
id stringMessage ID
room_id string?Room ID the message was sent in
author_id string?ID of the message author. Null for webhook messages.
content string?Message text content
type integerMessage type (0 = default)
created_at stringISO 8601 creation timestamp
updated_at stringISO 8601 last update timestamp
nonce ?stringClient-generated nonce for deduplication
attachments Attachment[]File attachments on this message
reactions Reaction[]Reactions on this message
user ?UserAuthor user object. For webhook messages, a synthetic user with webhook_id as id, webhook username/avatar, and is_bot=true.
referenced_message ?ReferencedMessageReferenced message (for replies)
sticker_attachment_id string?Attachment ID if the message is a sticker
embeds Embed[]Link embeds extracted from the message content
webhook_id ?stringID of the webhook that sent this message. Only present for webhook messages.
{
  "type": "MESSAGE_CREATE",
  "data": {
    "id": "019cf96a-e0a4-72c5-830f-75e85355da00",
    "room_id": "019cf96a-be82-72c5-830f-75e85355d800",
    "author_id": "019cf96a-3d5b-72c5-830f-75e85355d078",
    "content": "Hello everyone!",
    "type": 0,
    "created_at": "2025-06-15T14:30:00Z",
    "updated_at": "2025-06-15T14:30:00Z",
    "nonce": "abc123",
    "attachments": [],
    "reactions": [],
    "user": {
      "id": "019cf96a-3d5b-72c5-830f-75e85355d078",
      "username": "MARCROCK22",
      "avatar": "9bd6da82-c850-424b-89a0-9e4733263a45",
      "flags": 1,
      "badges": 1
    },
    "referenced_message": null,
    "sticker_attachment_id": null,
    "embeds": []
  }
}

Webhook Message Example

When a message is sent via a webhook, author_id is null, webhook_id is set, and user contains a synthetic user built from the webhook’s identity:

{
  "type": "MESSAGE_CREATE",
  "data": {
    "id": "019d1234-abcd-7890-ef12-345678901234",
    "room_id": "019cf96a-be82-72c5-830f-75e85355d800",
    "author_id": null,
    "content": "Build deployed successfully",
    "type": 0,
    "created_at": "2026-04-07T10:00:00Z",
    "updated_at": "2026-04-07T10:00:00Z",
    "attachments": [],
    "reactions": [],
    "user": {
      "id": "019d1234-0000-7890-ef12-000000000001",
      "username": "github",
      "avatar": "b05278d5-b84b-43af-ae46-85bfdbaa571b",
      "is_bot": true
    },
    "webhook_id": "019d1234-0000-7890-ef12-000000000001",
    "sticker_attachment_id": null,
    "embeds": []
  }
}

MESSAGE_UPDATE

EVENT MESSAGE_UPDATE

Sent when a message is edited. Broadcast to all members with access to the room. Does not include attachments, reactions, or referenced_message.

FieldTypeDescription
id stringMessage ID
room_id string?Room ID
author_id string?ID of the message author. Null for webhook messages.
content string?Updated message text content
type integerMessage type
created_at stringISO 8601 creation timestamp
updated_at stringISO 8601 last update timestamp (reflects edit time)
sticker_attachment_id string?Sticker attachment ID
embeds Embed[]Updated link embeds
user ?UserAuthor user object

MESSAGE_DELETE

EVENT MESSAGE_DELETE

Sent when a message is deleted. Broadcast to all members with access to the room.

FieldTypeDescription
id stringID of the deleted message
room_id stringRoom ID the message was in

MESSAGE_PIN_UPDATE

EVENT MESSAGE_PIN_UPDATE

Sent when a message is pinned or unpinned. Broadcast to all members with access to the room. A pin also posts the room's pin notice, which arrives as a MESSAGE_CREATE of type 2.

FieldTypeDescription
id stringID of the message
room_id stringRoom ID the message is in
pinned_at ISO 8601?When it was pinned; null when it was unpinned

TYPING

EVENT TYPING

Sent when a user starts typing in a room, at most once every 2 seconds per user. It takes no sequence number and isn't buffered for resume.

FieldTypeDescription
user_id stringID of the typing user
username stringUsername of the typing user
alias string?Display name override
avatar string?Avatar attachment ID
room_id stringRoom where the user is typing

RECORDING

EVENT RECORDING

Sent when a user is recording a voice message in a room, at most once every 2 seconds per user. Like TYPING, it takes no sequence number and isn't buffered for resume.

FieldTypeDescription
user_id stringID of the recording user
username stringUsername of the recording user
alias string?Display name override
avatar string?Avatar attachment ID
room_id stringRoom where the user is recording

MENTION_CREATE

EVENT MENTION_CREATE

Sent to a user when they are mentioned in a room message.

FieldTypeDescription
message_id stringID of the message containing the mention
room_id stringRoom ID where the mention occurred
author_id stringID of the user who sent the message

REACTION_ADD

EVENT REACTION_ADD

Sent when a reaction is added to a room message.

FieldTypeDescription
message_id stringID of the message
user_id stringID of the user who reacted
emoji_name stringUnicode emoji character or custom emoji UUID
emoji_id ?stringCustom emoji UUID (if applicable)

REACTION_REMOVE

EVENT REACTION_REMOVE

Sent when a reaction is removed from a room message.

FieldTypeDescription
message_id stringID of the message
user_id stringID of the user who removed the reaction
emoji_name stringUnicode emoji character or custom emoji UUID