Duvet DOCS
GitHub

Room & Role Events

ROOM_CREATE

EVENT ROOM_CREATE

Sent when a new room is created in a space. Broadcast to all space members.

Payload is a full Room object.

{
  "type": "ROOM_CREATE",
  "data": {
    "id": "019cf96a-be82-72c5-830f-75e85355d800",
    "space_id": "019cf96a-4a1b-72c5-830f-75e85355d100",
    "parent_id": null,
    "type": 1,
    "name": "general",
    "description": null,
    "position": 0,
    "nsfw": false,
    "created_at": "2025-06-01T12:00:00Z",
    "updated_at": "2025-06-01T12:00:00Z"
  }
}

ROOM_UPDATE

EVENT ROOM_UPDATE

Sent when a room is updated (name, description, position, parent). Broadcast to all space members.

Payload is a full Room object.

ROOM_DELETE

EVENT ROOM_DELETE

Sent when a room is deleted. Broadcast to all space members.

FieldTypeDescription
id stringDeleted room ID
space_id stringSpace the room belonged to
{
  "type": "ROOM_DELETE",
  "data": {
    "id": "019cf96a-be82-72c5-830f-75e85355d800",
    "space_id": "019cf96a-4a1b-72c5-830f-75e85355d100"
  }
}

ROOM_REORDER

EVENT ROOM_REORDER

Sent after a room position change to sync all room positions. Broadcast to all space members.

FieldTypeDescription
rooms Room[]All rooms in the space with updated positions

ROOM_OVERWRITE_UPDATE

EVENT ROOM_OVERWRITE_UPDATE

Sent when a permission overwrite is created or updated. Broadcast to all space members.

Payload is a full Room Overwrite object.

{
  "type": "ROOM_OVERWRITE_UPDATE",
  "data": {
    "id": "019cf96a-cf93-72c5-830f-75e85355d900",
    "room_id": "019cf96a-be82-72c5-830f-75e85355d800",
    "target_id": "019cf96a-6f3d-72c5-830f-75e85355d300",
    "target_type": 0,
    "allow_flags": 1024,
    "deny_flags": 0,
    "created_at": "2025-06-01T12:00:00Z",
    "updated_at": "2025-06-01T12:00:00Z"
  }
}

ROOM_OVERWRITE_DELETE

EVENT ROOM_OVERWRITE_DELETE

Sent when a permission overwrite is removed. Broadcast to all space members.

FieldTypeDescription
room_id stringRoom ID
target_id stringTarget role or member ID that was removed

ROLE_CREATE

EVENT ROLE_CREATE

Sent when a new role is created. Broadcast to all space members.

Payload is a full Role object.

{
  "type": "ROLE_CREATE",
  "data": {
    "id": "019cf96a-6f3d-72c5-830f-75e85355d300",
    "space_id": "019cf96a-4a1b-72c5-830f-75e85355d100",
    "name": "Moderator",
    "color_from": 5793266,
    "color_via": null,
    "color_to": null,
    "flags": 0,
    "permissions": 14,
    "hoisted": true,
    "position": 1,
    "created_at": "2025-06-01T12:00:00Z",
    "updated_at": "2025-06-01T12:00:00Z"
  }
}

ROLE_UPDATE

EVENT ROLE_UPDATE

Sent when a role is updated (name, permissions, color, position). Broadcast to all space members.

Payload is a full Role object.

ROLE_DELETE

EVENT ROLE_DELETE

Sent when a role is deleted. Broadcast to all space members.

FieldTypeDescription
id stringDeleted role ID
space_id stringSpace the role belonged to