User content collections
Recent mentions and saved messages are private lists that only the account that owns them can read. Two more routes delete the messages you wrote. To download a copy of all your data, request a data export.
Only user tokens can call these routes, and Squad rejects a bot or OAuth2 bearer token with 403 ACCESS_DENIED.
Saved message object
Заголовок раздела «Saved message object»A saved message is a private bookmark that pairs a message with the channel it was saved from. It stores no copy of the message, and Squad checks your permissions each time you list saved messages.
Structure
Заголовок раздела «Structure»| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the saved entry, always equal to message_id |
| channel_id | snowflake | The channel the message was saved from |
| message_id | snowflake | The ID of the saved message |
| status | string | The saved message status of the entry |
| message | ?message object | The message as you can see it, null when status is missing_permissions |
Saved message statuses
Заголовок раздела «Saved message statuses»| Value | Description |
|---|---|
| available | The message is included in the entry |
| missing_permissions | You can’t view the channel or read the message |
Bulk message deletion scopes
Заголовок раздела «Bulk message deletion scopes»The scope field of Delete current user’s messages.
| Value | Description |
|---|---|
| selected | The include_* fields and the guild filter decide which messages are deleted |
| inaccessible_only | Only guilds you have left and group direct messages you are no longer in |
Guild filter modes
Заголовок раздела «Guild filter modes»The guild_filter_mode field of the same endpoint.
| Value | Description |
|---|---|
| exclude | Every eligible guild except excluded_guild_ids |
| include_only | Only included_guild_ids |
List recent mentions
Заголовок раздела «List recent mentions»/v1/users/@me/mentionsReturns messages from your recent mention history that you can still read, newest first. Squad records only mentions in guild channels. A deleted message or a channel you can no longer view is left out, and a page can have fewer messages than limit.
An entry in a thread, forum channel or media channel is left out unless the session declares the channel_threads client capability.
Query parameters
Заголовок раздела «Query parameters»| Field | Type | Description |
|---|---|---|
| limit? | integer | The maximum number of mentions to look up (1-100, default 25) |
| roles? | boolean | Whether role mentions are included (default true) |
| everyone? | boolean | Whether @everyone and @here mentions are included (default true) |
| guilds? | boolean | Whether mentions in guild channels are included (default true) |
| before? | snowflake | Only return mentions with a message ID below this |
Only true, True and 1 count as true for the boolean fields. Setting guilds to false always returns an empty array.
Response
Заголовок раздела «Response»| Status | Body | Condition |
|---|---|---|
| 200 | array[message object] | Readable mentions were returned |
| 403 | error response | MISSING_ACCESS fails the whole list when an entry is in a thread you can no longer view |
The rate limit is 40 requests per 10 seconds, on the user:mentions:read bucket.
Mark recent mentions read
Заголовок раздела «Mark recent mentions read»/v1/users/@me/mentions/readRemoves entries from your recent mention history and returns 204. Sends a Recent Mention Delete event for each entry removed. It doesn’t change the channel’s unread mention count, which is part of its read state.
JSON body
Заголовок раздела «JSON body»| Field | Type | Description |
|---|---|---|
| message_ids | array[snowflake] | The message IDs of the entries to remove (1-100 entries) |
Response
Заголовок раздела «Response»| Status | Body | Condition |
|---|---|---|
| 204 | empty | The entries were removed, and unknown IDs are ignored |
The rate limit is 60 requests per 10 seconds, on the user:mentions:delete bucket.
Delete recent mention
Заголовок раздела «Delete recent mention»/v1/users/@me/mentions/{message_id}Removes one entry from your recent mention history and returns 204, whether or not the entry existed. Sends a Recent Mention Delete event when an entry is removed.
The rate limit is 60 requests per 10 seconds, on the user:mentions:delete bucket.
List saved messages
Заголовок раздела «List saved messages»/v1/users/@me/saved-messagesReturns an array of saved messages, newest first. An entry whose message you can no longer read comes back with status missing_permissions. An entry whose message was deleted is removed from your saved messages and left out, and a page can have fewer entries than limit.
An entry saved from a thread, forum channel or media channel is left out unless the session declares the channel_threads client capability.
Query parameters
Заголовок раздела «Query parameters»| Field | Type | Description |
|---|---|---|
| limit? | integer | The maximum number of entries to look up (1-100, default 25) |
| before? | snowflake | Only return entries with a message ID below this |
Response
Заголовок раздела «Response»| Status | Body | Condition |
|---|---|---|
| 200 | array[saved message object] | Saved entries were returned |
| 403 | error response | MISSING_ACCESS fails the whole list when an entry is in a thread you can no longer view |
The rate limit is 40 requests per 10 seconds, on the user:saved_messages:read bucket.
Save message
Заголовок раздела «Save message»/v1/users/@me/saved-messagesSaves a message and returns 204 when you can view its channel and the message itself, and sends a Saved Message Create event to your sessions.
An account can save at most the max_bookmarks instance limit, 50 by default.
JSON body
Заголовок раздела «JSON body»| Field | Type | Description |
|---|---|---|
| channel_id | snowflake | The channel containing the message |
| message_id | snowflake | The ID of the message to save |
Response
Заголовок раздела «Response»| Status | Body | Condition |
|---|---|---|
| 204 | empty | The message is in your saved messages |
| 400 | error response | MAX_BOOKMARKS when you are at the limit, even for a message already saved |
| 403 | error response | NSFW_CONTENT_AGE_RESTRICTED when the channel is marked 18+ and the account can’t see mature content |
The rate limit is 30 requests per 10 seconds, on the user:saved_messages:write bucket.
Unsave message
Заголовок раздела «Unsave message»/v1/users/@me/saved-messages/{message_id}Removes a message from your saved messages and returns 204, whether or not it was saved. You don’t need access to the channel. Sends a Saved Message Delete event to your sessions.
The rate limit is 30 requests per 10 seconds, on the user:saved_messages:write bucket.
Delete current user’s messages
Заголовок раздела «Delete current user’s messages»/v1/users/@me/messages/bulk-delete-mineDeletes the messages you wrote that the filter selects, and needs sudo mode. Returns 202 before deletion starts. Squad sends Message Delete Bulk events as it works and then a direct message from the system account with the totals. Personal notes are never deleted.
JSON body
Заголовок раздела «JSON body»The sudo fields are the sudo verification object, and you can send an existing proof in the X-Fluxer-Sudo-Mode-JWT header instead. The selected scope needs at least one of include_dms, include_dms_closed, include_group_dms and include_guilds to be true. The inaccessible_only scope ignores them and the guild filter.
| Field | Type | Description |
|---|---|---|
| scope? | string | The deletion scope, default selected |
| include_dms? | boolean | Whether open one-to-one DMs are included (default true) |
| include_dms_closed? | boolean | Whether closed one-to-one DMs are included (default true) |
| include_group_dms? | boolean | Whether group direct messages you are still in are included (default true) |
| include_guilds? | boolean | Whether guilds you are still in are included (default true) |
| guild_filter_mode? | string | The guild filter mode, default exclude |
| excluded_guild_ids? | array[snowflake] | The guilds to skip in exclude mode (max 500 IDs) |
| included_guild_ids? | array[snowflake] | The only guilds to delete from in include_only mode (max 500 IDs) |
| start_date? | ?ISO8601 timestamp | Only messages at or after this time |
| end_date? | ?ISO8601 timestamp | Only messages before this time, and it must be later than start_date |
| password? | string | The account password (8-256 characters) |
| mfa_method? | string | The sudo MFA method, one of totp, webauthn or email_code |
| mfa_code? | string | The sudo authenticator code or an unused backup code (1-32 characters) |
| webauthn_response? | WebAuthn assertion object | The sudo WebAuthn assertion |
| webauthn_challenge? | string | The sudo WebAuthn challenge (1-256 characters) |
| email_code_ticket? | string | The ticket from send a sudo email code (1-128 characters) |
| email_code? | string | The 6-digit code from that email |
Response
Заголовок раздела «Response»| Status | Body | Condition |
|---|---|---|
| 202 | empty | Deletion was accepted |
| 400 | error response | An end_date not after start_date, no include_* field true, or a wrong sudo proof |
| 403 | error response | SUDO_MODE_REQUIRED when no accepted proof is present |
The user:messages:bulk_delete_mine_filtered bucket allows 5 requests per 30 minutes.
Request bulk message deletion
Заголовок раздела «Request bulk message deletion»/v1/users/@me/messages/deleteSchedules deletion of every message you have sent, to run one day later, and needs sudo mode. Returns 204 and sends a User Update event. The user object shows the schedule in pending_bulk_message_deletion, and a new request replaces it.
JSON body
Заголовок раздела «JSON body»The body is the sudo verification object. You can send an existing proof in the X-Fluxer-Sudo-Mode-JWT header instead.
Response
Заголовок раздела «Response»| Status | Body | Condition |
|---|---|---|
| 204 | empty | The deletion was scheduled |
| 400 | error response | A wrong sudo proof (INVALID_PASSWORD, PASSWORD_NOT_SET, INVALID_MFA_CODE) |
| 403 | error response | SUDO_MODE_REQUIRED when no accepted proof is present |
The rate limit is 6 requests per minute, on the user:messages:bulk_delete bucket.
Cancel bulk message deletion
Заголовок раздела «Cancel bulk message deletion»/v1/users/@me/messages/deleteCancels a pending bulk message deletion and sends a User Update event with pending_bulk_message_deletion set to null. It returns 200 even when nothing is pending. Once the deletion has started, the deleted messages are not restored.
Response body
Заголовок раздела «Response body»| Field | Type | Description |
|---|---|---|
| success | boolean | Always true |
Response
Заголовок раздела «Response»| Status | Body | Condition |
|---|---|---|
| 200 | response body | The pending deletion, if any, was cancelled |
The rate limit is 6 requests per minute, on the user:messages:bulk_delete bucket.