A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
---
# SPDX-License-Identifier: AGPL-3.0-or-later
title: User content collections
description: Recent mentions, saved messages and deletion of your own messages.
---
import RouteHeader from '@/components/RouteHeader.astro';
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. For data archives see [Data harvests](/http-api/users/data-harvest/).
Only user tokens can call these routes, and Fluxer rejects a bot or OAuth2 bearer token with 403 `ACCESS_DENIED`.
## 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 Fluxer checks your permissions each time you list saved messages.
### 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](#saved-message-statuses) of the entry |
| message | ?[message](/http-api/messages/#message-object) object | The message as you can see it, null when `status` is `missing_permissions` |
## 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
The `scope` field of [Delete current user's messages](#delete-current-users-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 DMs you are no longer in |
## 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
<RouteHeader method="GET" path="/v1/users/@me/mentions" />
Returns [messages](/http-api/messages/#message-object) from your recent mention history that you can still read, newest first. Fluxer 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](/http-api/threads/#client-capability).
### 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
| Status | Body | Condition |
| --- | --- | --- |
| 200 | array[[message](/http-api/messages/#message-object) object] | Readable mentions were returned |
| 403 | [error response](/http-api/#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
<RouteHeader method="POST" path="/v1/users/@me/mentions/read" />
Removes entries from your recent mention history and returns 204. Sends a [Recent Mention Delete](/gateway/events/#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](/http-api/read-states/).
### JSON body
| Field | Type | Description |
| --- | --- | --- |
| message_ids | array[snowflake] | The message IDs of the entries to remove (1-100 entries) |
### 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
<RouteHeader method="DELETE" path="/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](/gateway/events/#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
<RouteHeader method="GET" path="/v1/users/@me/saved-messages" />
Returns an array of [saved messages](#saved-message-object), 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](/http-api/threads/#client-capability).
### 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
| Status | Body | Condition |
| --- | --- | --- |
| 200 | array[[saved message](#saved-message-object) object] | Saved entries were returned |
| 403 | [error response](/http-api/#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
<RouteHeader method="POST" path="/v1/users/@me/saved-messages" />
Saves a message and returns 204 when you can view its channel and the message itself, and sends a [Saved Message Create](/gateway/events/#saved-message-create) event to your sessions.
An account can save at most the `max_bookmarks` [instance limit](/http-api/instance/#limit-keys), 50 by default.
### JSON body
| Field | Type | Description |
| --- | --- | --- |
| channel_id | snowflake | The channel containing the message |
| message_id | snowflake | The ID of the message to save |
### Response
| Status | Body | Condition |
| --- | --- | --- |
| 204 | empty | The message is in your saved messages |
| 400 | [error response](/http-api/#error-response) | `MAX_BOOKMARKS` when you are at the limit, even for a message already saved |
| 403 | [error response](/http-api/#error-response) | `NSFW_CONTENT_AGE_RESTRICTED` when the channel needs age verification |
The rate limit is 30 requests per 10 seconds, on the `user:saved_messages:write` bucket.
## Unsave message
<RouteHeader method="DELETE" path="/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](/gateway/events/#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
<RouteHeader method="POST" path="/v1/users/@me/messages/bulk-delete-mine" mfa />
Deletes the messages you wrote that the filter selects, and needs [sudo mode](/http-api/users/mfa/#sudo-mode). Returns 202 before deletion starts. Fluxer sends [Message Delete Bulk](/gateway/events/#message-delete-bulk) events as it works and then a direct message from the system account with the totals. Personal notes are never deleted.
:::danger[Deletion is permanent]
Fluxer deletes every selected message for every recipient and removes its attachments. Nothing restores them.
:::
### JSON body
The sudo fields are the [sudo verification object](/http-api/users/mfa/#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](#bulk-message-deletion-scopes), 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 DMs 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](#guild-filter-modes), 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](/http-api/users/mfa/#webauthn-assertion-object) 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](/http-api/users/mfa/#send-a-sudo-email-code) (1-128 characters) |
| email_code? | string | The 6-digit code from that email |
### Response
| Status | Body | Condition |
| --- | --- | --- |
| 202 | empty | Deletion was accepted |
| 400 | [error response](/http-api/#error-response) | An `end_date` not after `start_date`, no `include_*` field true, or a wrong sudo proof |
| 403 | [error response](/http-api/#error-response) | `SUDO_MODE_REQUIRED` when no accepted proof is present |
The rate limit is 5 requests per 30 minutes, on the `user:messages:bulk_delete_mine_filtered` bucket.
## Request bulk message deletion
<RouteHeader method="POST" path="/v1/users/@me/messages/delete" mfa />
Schedules deletion of every message you have sent, to run one day later, and needs [sudo mode](/http-api/users/mfa/#sudo-mode). Returns 204 and sends a [User Update](/gateway/events/#user-update) event. The [user object](/http-api/users/#user-object) shows the schedule in [`pending_bulk_message_deletion`](/http-api/users/#pending-bulk-message-deletion-object), and a new request replaces it.
:::danger[Deletion is permanent once it runs]
This deletes everything you wrote, including personal notes, and removes the attachments. [Cancel bulk message deletion](#cancel-bulk-message-deletion) is the only way to stop it.
:::
### JSON body
The body is the [sudo verification object](/http-api/users/mfa/#sudo-verification-object). You can send an existing proof in the `X-Fluxer-Sudo-Mode-JWT` header instead.
### Response
| Status | Body | Condition |
| --- | --- | --- |
| 204 | empty | The deletion was scheduled |
| 400 | [error response](/http-api/#error-response) | A wrong sudo proof (`INVALID_PASSWORD`, `PASSWORD_NOT_SET`, `INVALID_MFA_CODE`) |
| 403 | [error response](/http-api/#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
<RouteHeader method="DELETE" path="/v1/users/@me/messages/delete" />
Cancels a pending bulk message deletion and sends a [User Update](/gateway/events/#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
| Field | Type | Description |
| --- | --- | --- |
| success | boolean | Always true |
### 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.