Duvet DOCS
GitHub

API Structures

Response and request structures used across multiple API endpoints that don’t map directly to a single resource.


AuthTokenResponse

Returned by login, register, and refresh endpoints.

FieldTypeDescription
token stringAccess token (Bearer)
session_token stringRefresh/session token
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "session_token": "019cf96a-abcd-1234-5678-abcdef012345"
}

InviteCode

Returned when creating a room invite: the invite link itself.

FieldTypeDescription
id stringInvite link ID
code stringThe invite code
room_id stringRoom the invite points to
created_by stringID of the user who created it
created_at stringISO 8601 creation timestamp
updated_at stringISO 8601 last update timestamp
expires_at string?ISO 8601 time it stops working; null for one that works until it is revoked
{
  "id": "01920000-0000-7000-8000-000000000001",
  "code": "01920000-0000-7000-8000-000000000002",
  "room_id": "01920000-0000-7000-8000-000000000003",
  "created_by": "01920000-0000-7000-8000-000000000004",
  "created_at": "2026-10-17T12:00:00Z",
  "updated_at": "2026-10-17T12:00:00Z",
  "expires_at": "2026-10-24T12:00:00Z"
}

InviteInfo

Returned when fetching invite details.

FieldTypeDescription
code stringThe invite code
space_id stringSpace ID
space_name stringSpace name
description stringSpace description
member_count integerCurrent member count

StorageStatus

Returned by storage status endpoints.

FieldTypeDescription
used_bytes integerBytes used in the default storage (files in your own buckets don't count)
max_bytes integerMaximum storage allowed
upload_limit_bytes integerMaximum single upload size
percentage_used numberUsage as a percentage (0-100)
{
  "used_bytes": 52428800,
  "max_bytes": 33554432,
  "upload_limit_bytes": 10485760,
  "percentage_used": 15.6
}

StorageBucket

Returned by bucket management endpoints.

FieldTypeDescription
id stringBucket UUID
owner_id stringOwner user/space ID
name stringDisplay name
endpoint stringS3-compatible endpoint URL
region stringBucket region
bucket_name stringActual bucket name on the provider
access_key_id stringAccess key ID
secret_access_key stringSecret access key
is_active booleanWhether this bucket is currently active
is_default booleanWhether this is the default system bucket
use_path_style booleanWhether to use path-style S3 URLs
max_bytes integer?Custom storage limit
upload_limit_bytes integer?Custom upload size limit
created_at stringISO 8601 creation timestamp
updated_at stringISO 8601 last update timestamp
deleted_at string?ISO 8601 soft-delete timestamp

Friend

Returned by friend list and accept endpoints.

FieldTypeDescription
id stringFriend record UUID
request_id stringOriginal friend request UUID
sender_id stringUser who sent the original request
recipient_id stringUser who received the original request
user_username stringThe other user's username
user_alias string?The other user's display name
user_avatar string?The other user's avatar ID

FriendRequest

Returned by friend request endpoints.

FieldTypeDescription
id stringRequest UUID
sender_id stringSender user ID
recipient_id stringRecipient user ID
created_at stringISO 8601 creation timestamp
updated_at stringISO 8601 last update timestamp
user_username stringThe other user's username
user_alias string?The other user's display name
user_avatar string?The other user's avatar ID

MessageResponse

Returned by message list and get endpoints. Extends the base Message with additional resolved fields.

FieldTypeDescription
id stringMessage UUID
room_id string?Room ID
author_id string?Author user ID
content string?Message text content
type integerMessage type: 0 a message, 1 a voice note, 2 a pin notice
created_at stringISO 8601 creation timestamp
updated_at stringISO 8601 last update timestamp
pinned_at string?ISO 8601 time the message was pinned; null while it isn't
sticker_attachment_id string?Sticker attachment ID
embeds Embed[]Link embeds
user ?UserAuthor user object
attachments Attachment[]File attachments
reactions Reaction[]Reactions grouped by emoji
referenced_message ?ReferencedMessageResolved referenced message (for replies)
conversation_id string?Conversation ID (for DM/group messages)
webhook_id ?string?Webhook ID if sent by a webhook
member_alias string?Member server nickname at time of message

ReferencedMessage

Nested inside MessageResponse when a message is a reply. The replied message is always in the same room or conversation. Once it’s deleted, only type, message_id, room_id and space_id are left: the missing created_at is how to tell (a message without text still has its date).

FieldTypeDescription
type integer?Reference type (always 0 = reply)
message_id string?Referenced message ID
room_id string?Room of the referenced message
space_id string?Space of the referenced message
content ?string?Content preview
author_id ?stringAuthor ID of the referenced message
author_name ?stringAuthor display name
author_avatar ?string?Author avatar ID
created_at ?stringCreation timestamp of the referenced message; absent once it's deleted

MessageReference (Request)

Used in create message request body to reference another message (reply/forward).

FieldTypeDescription
type ?integerReference type (0 = reply)
message_id ?stringMessage ID to reference
room_id ?stringRoom ID of the referenced message
space_id ?stringSpace ID of the referenced message
fail_if_not_exists ?booleanWhether to fail if the referenced message doesn't exist (default: true)

CreateSpaceResult

Returned when creating a new space.

FieldTypeDescription
space SpaceThe created space
role RoleThe default @everyone role
text_room RoomThe default text room (general)
voice_room RoomThe default voice room (general)
member MemberThe creator's member object

MemberWithUser

Returned by member list endpoints. Combines member data with user profile.

FieldTypeDescription
id stringMember UUID
space_id stringSpace ID
user_id stringUser ID
alias string?Server nickname
created_at stringJoin timestamp
updated_at stringLast update timestamp
deleted_at string?Always null: members who left aren't listed
user UserFull user profile
max_pos integerHighest role position for sorting

ThreadMessageResponse

Returned by thread message endpoints. A lightweight message representation used in thread/reply contexts.

FieldTypeDescription
id stringMessage UUID
room_id string?Room ID
author_id string?Author user ID
content string?Message text content
created_at stringISO 8601 creation timestamp
updated_at stringISO 8601 last update timestamp
ref_type integer?Reference type (e.g., reply)
ref_message_id string?Referenced message ID
ref_room_id string?Room of the referenced message
ref_space_id string?Space of the referenced message
depth integerThread nesting depth
webhook_id ?stringWebhook ID if sent by a webhook
user ?UserAuthor user object
member_alias string?Member server nickname at time of message

GatewaySpaceCreatePayload

Full space snapshot sent with the SPACE_CREATE event when a user joins or creates a space.

FieldTypeDescription
space GatewaySpaceCreateSpaceThe space object with embedded rooms, roles, and members
rooms Record<string, Room>Map of room ID to room object
roles_permissions Record<string, Role>Map of role ID to role object
member_roles Record<string, string[]>Map of member ID to array of role IDs
overwrites Record<string, Overwrite[]>?Map of room ID to permission overwrites
owner_id stringSpace owner user ID
voice_states VoiceState[]Current voice states in the space (empty when nobody is in voice)
activities ?Record<string, Activity[]>Map of user ID to that member's current activities; absent for bots and when nobody has one
member_statuses ?Record<string, integer>Map of user ID to online status; absent when none is known

VoiceState

A user’s state in a voice room, in SPACE_CREATE snapshots. version orders it against VOICE_STATE_UPDATE events.

FieldTypeDescription
room_id stringVoice room ID
user_id stringUser ID
muted booleanWhether the user is muted (always true without SpeakInVoice)
deafened booleanWhether the user is deafened
screen_sharing booleanWhether the user is screen sharing
version integerVersion of this state; see VOICE_STATE_UPDATE

GatewayReady

Payload of the READY event users get after identify (bots get GatewayBotReady).

FieldTypeDescription
user UserThe connected user
sessionToken stringGateway session token, for resuming
guild_ids string[]IDs of the user's spaces; a SPACE_CREATE follows for each
unread_rooms string[]Rooms with messages newer than the user's read state
last_read_rooms Record<string, string>Map of room ID to the last message ID the user read
last_msg_rooms Record<string, string>Map of room ID to its last message ID
unread_convs string[]Conversations with unread messages
active_calls ReadyActiveCall[]?Calls going on in the user's conversations
ice_servers RTCIceServer[]ICE servers for voice peer connections: the ones the gateway uses itself. Each has urls, plus username and credential when set; credentialType (always "password") is added by the WebRTC library and can be ignored

GatewayBotReady

Payload of the READY event bots get.

FieldTypeDescription
user UserThe bot user
sessionToken stringGateway session token, for resuming
guild_ids string[]IDs of the spaces this shard handles
shard [integer, integer]This connection's shard_id and num_shards

ReadyActiveCall

FieldTypeDescription
conversation_id stringConversation the call is in
initiator_id stringUser who started the call
voice_states CallVoiceState[]?Who is connected to the call; null before anyone joins

CallVoiceState

FieldTypeDescription
user_id stringUser ID
muted booleanWhether the user is muted
deafened booleanWhether the user is deafened
screen_sharing booleanWhether the user is screen sharing
version integerVersion of this state; see VOICE_STATE_UPDATE

MessageSearchResponse

Returned by the message search endpoints of a space and of a conversation.

FieldTypeDescription
total_results integerHow many messages the search finds, all its pages together, counted up to 1000
messages MessageResponse[]This page of them, newest first

MentionCounts

Returned by the mention counts endpoint.

FieldTypeDescription
(key) stringRoom or conversation ID
(value) integerNumber of unread mentions
{
  "019cf96a-be82-72c5-830f-75e85355d800": 3,
  "019cf96a-cf44-72c5-830f-75e85355d900": 1
}