Skip to content
Fluxer API

Private channels

A private channel is a direct message between two accounts or a group DM. Its fields are in the channel object. These routes take a user session or a bot token, not an OAuth2 token.

Each property name is the snowflake of one requested channel.

FieldTypeDescription
{channel_id}1?message objectThe latest message you can read, or null when there is none

1 Channels that aren't direct messages or group DMs are left out

Create private channel returns an array of these as unaddable_recipients in a GROUP_DM_RECIPIENTS_NOT_ADDABLE error response.

FieldTypeDescription
user_idsnowflakeThe recipient that could not be added
reasonstringThe unaddable reason
ValueNameDescription
unknown_userUnknown userThe recipient does not exist
not_friendsNot friendsYou are not friends with the recipient
blockedBlockedYou are a bot and share no guild with the recipient
group_dm_add_disabledGroup DM add disabledThe recipient's group DM add permission flags don't let you add them
GET/v1/users/@me/channelsBot

Returns your open direct message and group DM channel objects, unordered and unpaginated. Each channel's recipients leaves out the caller.

StatusBodyCondition
200array[channel object]Open private channels were returned

The rate limit is 40 requests per 10 seconds, on the user:channels bucket.

POST/v1/users/@me/channelsBot

Opens a direct message with one account, or creates a group DM.

Send recipient_id to open a direct message or recipients to create a group DM. Opening a direct message you already have returns the same channel.

An account that is not verified gets 403 UNCLAIMED_ACCOUNT_CANNOT_JOIN_GROUP_DMS, UNCLAIMED_ACCOUNT_CANNOT_SEND_DIRECT_MESSAGES, DIRECT_MESSAGE_EMAIL_VERIFICATION_REQUIRED or ACCOUNT_VERIFICATION_REQUIRED.

When the instance community policy sets direct_messages_disabled, every request gets 400 DIRECT_MESSAGES_DISABLED.

When your account is limited from starting new conversations, opening a direct message with someone who is not your friend returns 403 NEW_CONVERSATIONS_LIMITED, unless they have already sent a message there. Bots, staff and trusted accounts are never limited.

Your own ID returns 400 CANNOT_DM_YOURSELF on recipient_id, and an unknown user returns 404 UNKNOWN_USER. Blocks don't stop you from opening a direct message, but Create message returns 400 CANNOT_SEND_MESSAGES_TO_USER when either of you has blocked the other.

A limited account gets 403 ACCOUNT_LIMITED.

A group DM has at most max_group_dm_recipients participants including you (default 50), or the request returns 400 MAX_GROUP_DM_RECIPIENTS with max_recipients. Each participant must be in fewer than max_group_dms_per_user group DMs (default 150), or it returns 400 MAX_GROUP_DMS with max_group_dms.

A repeated ID returns 400 DUPLICATE_RECIPIENTS_NOT_ALLOWED and your own ID returns 400 CANNOT_ADD_YOURSELF_TO_GROUP_DM, both as field errors on recipients. If any recipient can't be added, the request returns 400 GROUP_DM_RECIPIENTS_NOT_ADDABLE with unaddable_recipients and the IDs that could be added in addable_recipients.

FieldTypeDescription
X-Captcha-Token?1stringThe solved ALTCHA challenge, see CAPTCHA handling

1 Needed with recipients when the instance has CAPTCHA turned on, otherwise 400 CAPTCHA_REQUIRED or INVALID_CAPTCHA

FieldTypeDescription
recipient_id?1snowflakeThe only recipient of a direct message
recipients?1array[snowflake]The other participants of a group DM, excluding the caller (max 49)

1 Send exactly one of the two

StatusBodyCondition
200channel objectThe direct message was opened or the group DM was created
400error responseThe request failed a check described above
403error responseThe account is not verified, is limited, or may not start a new conversation
404error responseUNKNOWN_USER when recipient_id does not exist

A new direct message opens only for you. The other side opens when a message is sent or a call rings in it, when they open it, or when you become friends. A new group DM makes you the owner, sends Channel Create to every participant and posts a RECIPIENT_ADD message, with its Message Create event, for each other recipient.

The rate limit is 40 requests per 10 seconds, on the user:channels bucket. A request with recipients also uses the user:group_dm:create bucket, at 10 requests per hour.

POST/v1/users/@me/preload-messagesBot

Returns the latest message you can read in each requested channel as a preloaded messages object.

FieldTypeDescription
channelsarray[snowflake]The private channels to preload (max 100)
StatusBodyCondition
200preloaded messages objectThe requested channels were resolved

The rate limit is 40 requests per 10 seconds, on the user:preload_messages bucket.

POST/v1/users/@me/channels/messages/preloadBot

Works the same as Preload private channel messages.

FieldTypeDescription
channelsarray[snowflake]The private channels to preload (max 100)
StatusBodyCondition
200preloaded messages objectThe requested channels were resolved

The rate limit is 40 requests per 10 seconds, on the user:preload_messages bucket.

PUT/v1/users/@me/channels/{channel_id}/pinBot

Adds a direct message or group DM to the end of your pinned list and sends you a User Pinned DMs Update Gateway event.

StatusBodyCondition
204emptyThe channel is pinned
400error responseCHANNEL_MUST_BE_DM_OR_GROUP_DM when the channel is another type

The rate limit is 40 requests per 10 seconds, on the user:channels bucket.

DELETE/v1/users/@me/channels/{channel_id}/pinBot

Removes a direct message or group DM from your pinned list and sends you a User Pinned DMs Update Gateway event.

StatusBodyCondition
204emptyThe channel is not pinned
400error responseCHANNEL_MUST_BE_DM_OR_GROUP_DM when the channel is another type

The rate limit is 40 requests per 10 seconds, on the user:channels bucket.