openapi: 3.0.3 info: title: Adapt REST API description: Public REST API for the Adapt chat platform license: name: AGPL-3.0 version: 0.1.0 servers: - url: https://api.adapt.chat description: Production paths: /bots: get: tags: - users summary: Get All Bots description: Fetches all bot accounts owned by the authenticated user. operationId: get_bots responses: '200': description: List of bots content: application/json: schema: type: array items: $ref: '#/components/schemas/Bot' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - users summary: Create Bot description: Registers a new bot account with the given payload. operationId: create_bot requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateBotPayload' required: true responses: '201': description: Bot ID and token content: application/json: schema: $ref: '#/components/schemas/CreateBotResponse' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Username is already taken content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /bots/{bot_id}: get: tags: - users summary: Get Bot description: Fetches information about a bot account by its ID. operationId: get_bot parameters: - name: bot_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Bot object content: application/json: schema: $ref: '#/components/schemas/Bot' '404': description: Bot not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - users summary: Delete Bot description: Deletes a bot account. Requires the bot owner's password if the bot is in over 20 guilds. operationId: delete_bot parameters: - name: bot_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/DeleteBotPayload' nullable: true required: false responses: '204': description: Bot was successfully deleted '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token/credentials content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - users summary: Edit Bot description: Modifies information about a bot account. operationId: edit_bot parameters: - name: bot_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditBotPayload' required: true responses: '200': description: Bot object after modification content: application/json: schema: $ref: '#/components/schemas/Bot' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Username is already taken content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /bots/{bot_id}/tokens: post: tags: - users summary: Regenerate Bot Token description: |- Regenerates a token for a bot you own. If the bot is in over 20 guilds, you must provide the bot owner's password. operationId: regenerate_bot_token parameters: - name: bot_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/RegenerateBotTokenPayload' nullable: true required: false responses: '200': description: Token regenerated content: application/json: schema: $ref: '#/components/schemas/LoginResponse' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token/credentials content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}: get: tags: - channels summary: Get Channel description: |- Gets information about a channel given its ID. This includes guild channels, DM channels, and group DM channels. operationId: get_channel parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Channel information content: application/json: schema: $ref: '#/components/schemas/Channel' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - channels summary: Delete Channel description: |- Deletes a channel. For guild channels, you must have the `MANAGE_CHANNELS` permission to use this endpoint. For standard DM channels, you must be a recipient of the DM. For group DM channels, you must be the owner of the group DM. operationId: delete_channel parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Channel deleted '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - channels summary: Edit Channel description: |- Edits a channel with the given payload. For guild channels, you must have the `MODIFY_CHANNELS` permission to use this endpoint. operationId: edit_channel parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditChannelPayload' required: true responses: '200': description: Channel with updated details content: application/json: schema: $ref: '#/components/schemas/Channel' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/ack/{message_id}: put: tags: - channels summary: Acknowledge Channel description: |- Acknowledges a channel up to the given message ID, marking the message and all messages before it as read. Note that a message with the given ID does not have to actually exist; to mark a specific message as unread you can pass ``message_id - 1`` to this endpoint instead. operationId: acknowledge_channel parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Channel acknowledged '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/messages: get: tags: - messages summary: Get Message History description: |- Fetches multiple messages from the channel's message history in bulk. If in a guild, you must have the `VIEW_MESSAGE_HISTORY` permission to use this endpoint. operationId: get_message_history parameters: - name: before in: query description: |- If specified, only messages before this message will be returned. If any messages exactly match this ID, they will **not** be returned. required: false schema: type: integer format: int64 nullable: true minimum: 0 - name: after in: query description: |- If specified, only messages after this message will be returned. If any messages exactly match this ID, they will **not** be returned. required: false schema: type: integer format: int64 nullable: true minimum: 0 - name: around in: query description: |- If specified, messages will be fetched centered around this message ID, with equal padding on both sides up to the limit. If there are not enough messages on either side, the results will be cut off on that side. required: false schema: type: integer format: int64 nullable: true minimum: 0 - name: limit in: query description: |- The limit of messages to return. If unspecified, this defaults to ``100``. Must be between ``0`` and ``200``. required: false schema: type: integer format: int32 minimum: 0 - name: user_id in: query description: If specified, only messages sent by the given user will be returned. required: false schema: type: integer format: int64 nullable: true minimum: 0 - name: oldest_first in: query description: |- Whether to query messages starting from the oldest message first. Defaults to ``false``. If ``true``, messages will be sorted from oldest to newest. If ``false``, messages will be sorted from newest to oldest. required: false schema: type: boolean - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Array of message objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Message' '400': description: Invalid query content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - messages summary: Create Message description: |- Sends a message in the given channel. You must have both the `VIEW_CHANNEL` and `SEND_MESSAGES` permissions in that channel if this message is being sent in a guild. operationId: create_message parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateMessagePayload' required: true responses: '201': description: Message object content: application/json: schema: $ref: '#/components/schemas/Message' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/messages/{message_id}: get: tags: - messages summary: Get Message description: |- Gets a message in the given channel with the given ID. If in a guild, you must have the `VIEW_MESSAGE_HISTORY` permission to use this endpoint. operationId: get_message parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Message object content: application/json: schema: $ref: '#/components/schemas/Message' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel or message not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - messages summary: Delete Message description: |- Deletes a message in the given channel. In a guild, you must have the `VIEW_CHANNEL` permission to delete your own messages, with addition to the `MANAGE_MESSAGES` permission if you want to delete messages sent by other members. If you have this permission, you are only able to delete any messages sent by members who have either left the guild or are ranked lower than you in the role hierarchy. operationId: delete_message parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Message deleted '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel or message not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - messages summary: Edit Message description: |- Edits a message in the given channel. You must have the `VIEW_CHANNEL` and `SEND_MESSAGES` permissions in that channel if the target message is in a guild. operationId: edit_message parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditMessagePayload' required: true responses: '200': description: Message object content: application/json: schema: $ref: '#/components/schemas/Message' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel or message not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/messages/{message_id}/pin: put: tags: - messages summary: Pin Message description: |- Pins a message to its given channel. You must have the `PIN_MESSAGES` permission in the channel, or be in a DM-type channel. This endpoint is idempotent. operationId: pin_message parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Message pinned '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel or message not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - messages summary: Unpin Message description: |- Unpins a message from its given channel. You must have the `PIN_MESSAGES` permission in the channel, or be in a DM-type channel. This endpoint is idempotent, so it may still return success even if the message wasn't originally pinned. operationId: unpin_message parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Message unpinned '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel or message not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/messages/{message_id}/reactions: get: tags: - messages summary: Get Message Reactions description: |- Fetches all reactions for a message. The reaction objects returned in the response will include the `created_at` field. If in a guild, this requires the `VIEW_CHANNEL` permission. operationId: get_message_reactions parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Array of reaction objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Reaction' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel or message not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - messages summary: Clear Reactions description: |- Removes all reactions from a message. This requires the `MANAGE_MESSAGES` permission in the guild. This method is idempotent: if you try to remove reactions from a message that has no reactions, nothing will happen. operationId: clear_reactions parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Reactions removed '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel or message not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/messages/{message_id}/reactions/{emoji}: delete: tags: - messages summary: Remove All Reactions for Emoji description: |- Removes all reactions for a given emoji from a message. This requires the `MANAGE_MESSAGES` permission in the guild. The emoji path parameter should be either a literal unicode emoji or the ID of a custom emoji. operationId: remove_all_reactions_for_emoji parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: emoji in: path required: true schema: type: string responses: '204': description: Reactions removed '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel, message, or emoji not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/messages/{message_id}/reactions/{emoji}/me: put: tags: - messages summary: Add Reaction description: |- Adds a reaction to a message. If in a guild and the reaction does not exist, this will require the `ADD_REACTIONS` permission. This endpoint is idempotent: if you have already reacted to this message with this emoji, nothing will happen. The emoji path parameter should be either a literal unicode emoji or the ID of a custom emoji. operationId: add_reaction parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: emoji in: path required: true schema: type: string responses: '204': description: Reaction added '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel, message, or emoji not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - messages summary: Remove Own Reaction description: |- Removes your own reaction from a message. This method is idempotent: if you try to remove a reaction that you haven't added, nothing will happen. The emoji path parameter should be either a literal unicode emoji or the ID of a custom emoji. operationId: remove_reaction parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: emoji in: path required: true schema: type: string responses: '204': description: Reaction removed '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel, message, or emoji not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /channels/{channel_id}/messages/{message_id}/reactions/{emoji}/{user_id}: delete: tags: - messages summary: Remove User Reaction description: |- Forcibly removes a reaction by another user from a message. This requires the `MANAGE_MESSAGES` permission in the guild. This method is idempotent: if you try to remove a reaction that doesn't exist, nothing will happen. The emoji path parameter should be either a literal unicode emoji or the ID of a custom emoji. operationId: remove_user_reaction parameters: - name: channel_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: message_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: emoji in: path required: true schema: type: string - name: user_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Reaction removed '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Channel, message, or emoji not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /emojis: get: tags: - emojis summary: List Unicode Emojis description: |- Lists all supported unicode emojis. This endpoint does not require authentication. The data returned from this endpoint is extracted and up to date with GitHub's [genmoji](https://github.com/github/gemoji/blob/master/db/emoji.json). operationId: list_unicode_emojis responses: '200': description: List of unicode emojis content: application/json: schema: type: array items: $ref: '#/components/schemas/EmojiData' /emojis/{emoji_id}: get: tags: - emojis summary: Get Emoji description: Gets information about a custom emoji. operationId: get_emoji parameters: - name: emoji_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Custom emoji object content: application/json: schema: $ref: '#/components/schemas/CustomEmoji' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Emoji not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds: get: tags: - guilds summary: Get All Guilds description: Fetches information for all guilds the user is a member of, abiding by the given query. operationId: get_all_guilds parameters: - name: channels in: query description: Whether to resolve the guild's channels in the response. required: false schema: type: boolean - name: members in: query description: Whether to resolve the guild's members in the response. required: false schema: type: boolean - name: roles in: query description: Whether to resolve the guild's roles in the response. required: false schema: type: boolean - name: emojis in: query description: Whether to resolve the guild's emojis in the response. required: false schema: type: boolean responses: '200': description: Array of guild objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Guild' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - guilds summary: Create Guild description: Creates a new guild with the given payload. operationId: create_guild requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateGuildPayload' required: true responses: '201': description: Guild was successfully created content: application/json: schema: $ref: '#/components/schemas/Guild' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}: get: tags: - guilds summary: Get Guild description: |- Fetches information for the guild with the given ID. You must be a member of the guild to fetch it. operationId: get_guild parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Guild object content: application/json: schema: $ref: '#/components/schemas/Guild' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not a member of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - guilds summary: Delete Guild description: Deletes the guild with the given ID. You must be the owner of the guild to delete it. operationId: delete_guild parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/DeleteGuildPayload' nullable: true required: false responses: '204': description: Guild was successfully deleted '401': description: Invalid token or password content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not the owner of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - guilds summary: Edit Guild description: |- Modifies details of the guild with the given ID. You must have `MANAGE_GUILD` permissions to modify the guild. Returns the modified guild as a partial guild on success. operationId: edit_guild parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditGuildPayload' required: true responses: '200': description: Modified guild content: application/json: schema: $ref: '#/components/schemas/PartialGuild' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You do not have permission to modify the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/bans: get: tags: - members summary: Get Guild Bans description: Returns a list of all bans in the guild. Requires the `BAN_MEMBERS` permission. operationId: get_bans parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Array of ban objects content: application/json: schema: type: array items: $ref: '#/components/schemas/GuildBan' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing BAN_MEMBERS permission content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/bans/{user_id}: get: tags: - members summary: Get Guild Ban description: Returns the ban entry for the given user in the guild. Requires the `BAN_MEMBERS` permission. operationId: get_ban parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: user_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Ban object content: application/json: schema: $ref: '#/components/schemas/GuildBan' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing BAN_MEMBERS permission content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or ban not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] put: tags: - members summary: Ban Member description: |- Bans a user from a guild. The user is removed from the guild if they are currently a member. Requires the `BAN_MEMBERS` permission, and the target's highest role must be lower than yours. operationId: create_ban parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: user_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/BanMemberPayload' required: true responses: '201': description: Ban was created content: application/json: schema: $ref: '#/components/schemas/GuildBan' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: |- You are forbidden from banning this user. This can be because: * You are not a member of the guild. * You are missing the BAN_MEMBERS permission. * The target's top role is equal to or higher than yours. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: User is already banned content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - members summary: Unban Member description: Removes the ban for the given user from the guild. Requires the `BAN_MEMBERS` permission. operationId: unban_member parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: user_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Ban was removed '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing BAN_MEMBERS permission content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or ban not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/bots/{bot_id}: put: tags: - members summary: Add Bot to Guild description: |- Adds the bot to the guild with the given ID. If not the owner of the bot, the bot must be public. If the bot is already in the guild, nothing happens. operationId: add_bot_to_guild parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: bot_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: description: '' content: application/json: schema: allOf: - $ref: '#/components/schemas/AddBotPayload' nullable: true required: false responses: '200': description: Bot is already in the guild, no change content: application/json: schema: $ref: '#/components/schemas/Member' '201': description: Added bot content: application/json: schema: $ref: '#/components/schemas/Member' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Bot is not public content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/channels: get: tags: - channels summary: Get Guild Channels description: Returns a list of all channels in the guild. operationId: get_guild_channels parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Array of guild channels content: application/json: schema: type: array items: $ref: '#/components/schemas/GuildChannel' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - channels summary: Create Guild Channel description: |- Creates a new channel in the guild with the given payload. You must have the `MANAGE_CHANNELS` permission to use this endpoint. operationId: create_guild_channel parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateGuildChannelPayload' required: true responses: '201': description: Channel was successfully created content: application/json: schema: $ref: '#/components/schemas/Channel' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - channels summary: Edit Guild Channel Positions description: |- Modifies the positions of channels in a guild. You must have the `MANAGE_CHANNELS` permission to use this endpoint. You must specify all channels that will have a new absolute position, and there is no automatic normalization/shifting of positions. You must ensure that after overwriting the positions of the specified channels, all channels in the guild have a valid position. For example, if you want to swap the positions of two channels, you must specify the new desired positions for _both_ channels. If you want to move a channel from the top of a category to the bottom, you must specify new positions for every single channel in that category because their positions would be shifted. Channel positions are scoped by category (or lack thereof), and categories themselves take their own scope, separate from normal channels. The positioning restrictions are as follows: - No two channels in a positioning scope may have the same position. - No gap in positions may exist in a positioning scope. - The lowest position in a positioning scope is always 0. This means that a positioning scope with N channels must have all integer positions from 0 to _N-1_. operationId: edit_guild_channel_positions parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/EditChannelPositionPayload' required: true responses: '204': description: Channel positions updated '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or channel not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/emojis: get: tags: - emojis summary: List Custom Emojis description: |- Lists all custom emojis in the guild. If the guild is not public, you must be a member of the guild to use this endpoint. operationId: list_guild_emojis parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: List of custom emojis content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomEmoji' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: The guild is not public and you are not a member of the guild. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - emojis summary: Create Custom Emoji description: |- Creates a new custom emoji in the guild. You must have the `MANAGE_EMOJIS` permission for the guild to use this endpoint. operationId: create_emoji parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateEmojiPayload' required: true responses: '201': description: Custom emoji object content: application/json: schema: $ref: '#/components/schemas/Role' '400': description: Invalid payload or name length content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: |- You are forbidden from creating the emoji. This can be because: * You are not a member of the guild. * You do not have the `MANAGE_EMOJIS` permission in the guild. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/emojis/{emoji_id}: delete: tags: - emojis summary: Delete Emoji description: |- Deletes a custom emoji. You must have the `MANAGE_EMOJIS` permission for the guild to use this endpoint. operationId: delete_emoji parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: emoji_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Emoji deleted content: application/json: schema: default: null nullable: true '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing Manage Emojis permission content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Emoji not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - emojis summary: Edit Emoji description: |- Modifies a custom emoji. You must have the `MANAGE_EMOJIS` permission for the guild to use this endpoint. operationId: edit_emoji parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: emoji_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditEmojiPayload' required: true responses: '200': description: Custom emoji object content: application/json: schema: $ref: '#/components/schemas/CustomEmoji' '400': description: Invalid payload or name length content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing Manage Emojis permission content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Emoji not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/invites: get: tags: - invites summary: Get Guild Invites description: |- Gets a list of invites for the given guild. You must have the `MANAGE_INVITES` permission for the guild to use this endpoint. operationId: get_guild_invites parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: List of invites content: application/json: schema: type: array items: $ref: '#/components/schemas/Invite' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - invites summary: Create Invite to Guild description: |- Creates an invite that leads to the homepage of the given guild. You must have the `CREATE_INVITES` permission for the guild to use this endpoint. operationId: create_guild_invite parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateInvitePayload' required: true responses: '201': description: Invite was successfully created content: application/json: schema: $ref: '#/components/schemas/Invite' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/invites/{code}: delete: tags: - invites summary: Delete Invite description: |- Deletes (revokes) an invite given its guild ID and code. You must have the `MANAGE_INVITES` permission for the guild to use this endpoint. operationId: delete_guild_invite parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: code in: path required: true schema: type: string responses: '204': description: Invite was successfully deleted '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Missing permissions content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or invite not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/members: get: tags: - members summary: Get All Members description: Gets information of all members in a guild. You must be a member of the guild. operationId: get_members parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Array of member objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Member' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not a member of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/members/me: get: tags: - members summary: Get Authenticated User as Member description: |- Gets information of the authenticated user as a member of a guild. You must be a member of the guild. operationId: get_client_member parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Member object content: application/json: schema: $ref: '#/components/schemas/Member' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not a member of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - members summary: Leave Guild description: |- Leaves a guild. You must be a member of the guild beforehand. If you are the owner of the guild, you must transfer ownership to another member before leaving. operationId: leave_guild parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Success left the guild '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are the owner of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - members summary: Edit Authenticated User as Member description: |- Edits the authenticated user as a member of the given guild. You must be a member of the guild. Parts of the payload require different permissions: * The `nick` field requires the `CHANGE_NICKNAME` permission. operationId: edit_client_member parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditClientMemberPayload' required: true responses: '200': description: Member object after modifications content: application/json: schema: $ref: '#/components/schemas/Member' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not a member of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/members/{member_id}: get: tags: - members summary: Get Member description: Gets information of a member in a guild. You must be a member of the guild. operationId: get_member parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: member_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Member object content: application/json: schema: $ref: '#/components/schemas/Member' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not a member of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or member not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - members summary: Kick Member description: |- Kicks a member from a guild. You must be a member of the guild and have the `KICK_MEMBERS` permission, and their highest role must be lower than yours. operationId: kick_member parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: member_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Member was kicked '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: |- You are forbidden from editing the member. This can be because: * You are not a member of the guild. * You are missing permissions. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or member not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - members summary: Edit Member description: |- Edits information of a member in a guild. Parts of the payload require different permissions: * The `nick` field requires the `MANAGE_NICKNAMES` permission. * The `roles` field requires the `MANAGE_ROLES` permission. Returns the modified member object on success. operationId: edit_member parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: member_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditMemberPayload' required: true responses: '200': description: Member object after modifications content: application/json: schema: $ref: '#/components/schemas/Member' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: |- You are forbidden from editing the member. This can be because: * You are not a member of the guild. * You are missing permissions. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or member not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/roles: get: tags: - roles summary: Get All Roles description: |- Fetches information for all roles in the guild with the given ID. You must be a member of the guild. operationId: get_roles parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Array of role objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Role' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not a member of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - roles summary: Create Role description: |- Creates a role in the guild with the given guild ID. You must have the `MANAGE_ROLES` permission to create roles. operationId: create_role parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateRolePayload' required: true responses: '201': description: Role object content: application/json: schema: $ref: '#/components/schemas/Role' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: |- You are forbidden from creating the roles. This can be because: * You are not a member of the guild. * You do not have the `MANAGE_ROLES` permission in the guild. * You are creating a role that allows or denies permissions you do not have. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - roles summary: Edit Role Positions description: |- Modifies the positions of all roles in the guild with the given ID. You must have the ``MANAGE_ROLES`` permission. operationId: edit_role_positions parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: type: array items: type: integer format: int64 minimum: 0 required: true responses: '200': description: Modified role positions '400': description: "Invalid list of role IDs. Your array must contain all roles in the guild exactly\n once, including roles above your top role but excluding the default role.\n " content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: "You are forbidden from reordering roles. This can be because:\n* You are not a member of the guild.\n* You do not have the `MANAGE_ROLES` permission in the guild.\n* A role higher than or equal to your top role had its position changed.\n " content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or role not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /guilds/{guild_id}/roles/{role_id}: get: tags: - roles summary: Get Role description: |- Fetches information for the role with the given ID in the given guild. You must be a member of the guild the role belongs to. operationId: get_role parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: role_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Role object content: application/json: schema: $ref: '#/components/schemas/Role' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: You are not a member of the guild content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or role not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - roles summary: Delete Role description: |- Deletes the role with the given ID in the given guild. You must have the `MANAGE_ROLES` permission, the role cannot be managed, and the role must be lower than your highest role. operationId: delete_role parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: role_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Role deleted '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: |- You are forbidden from deleting the role. This can be because: * You are not a member of the guild. * You do not have the `MANAGE_ROLES` permission in the guild. * The role is managed. * The role is higher than your highest role. content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - roles summary: Edit Role description: |- Modifies the role with the given ID in the given guild. You must have the `MANAGE_ROLES` permission, and the role must be lower than your highest role. operationId: edit_role parameters: - name: guild_id in: path required: true schema: type: integer format: int64 minimum: 0 - name: role_id in: path required: true schema: type: integer format: int64 minimum: 0 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditRolePayload' required: true responses: '200': description: Modified role object content: application/json: schema: $ref: '#/components/schemas/Role' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: | You are forbidden from editing the role. This can be because: * You are not a member of the guild. * You do not have the `MANAGE_ROLES` permission in the guild. * You are editing a role that allows or denies permissions you do not have. * You are editing a role that is higher than your highest role. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Guild or role not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /invites/{code}: get: tags: - invites summary: Get Invite description: |- Gets an invite by its code. This endpoint does not require authentication, but is rate limited by IP. operationId: get_invite parameters: - name: code in: path required: true schema: type: string responses: '200': description: Invite content: application/json: schema: $ref: '#/components/schemas/Invite' '404': description: Invite not found content: application/json: schema: $ref: '#/components/schemas/Error' post: tags: - invites summary: Use Invite description: |- Joins a guild using an invite. If the guild was successfully joined, the created member object is returned. If the user is already in the guild, the existing member object is returned. operationId: use_invite parameters: - name: nonce in: query description: The nonce to provide to the guild. required: false schema: type: string nullable: true - name: code in: path required: true schema: type: string responses: '200': description: Member object for the joined guild content: application/json: schema: $ref: '#/components/schemas/Member' '400': description: Bot account content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Invite not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /login: post: tags: - auth summary: Generate Token (Login) description: Login to the API with your email and password to retrieve an authentication token. operationId: login requestBody: content: application/json: schema: $ref: '#/components/schemas/LoginRequest' required: true responses: '200': description: Login successful content: application/json: schema: $ref: '#/components/schemas/LoginResponse' '401': description: Invalid credentials content: application/json: schema: $ref: '#/components/schemas/Error' /relationships: get: tags: - users summary: Get Relationships description: Fetches all relationships of the authenticated user. operationId: get_relationships responses: '200': description: List of relationships content: application/json: schema: type: array items: $ref: '#/components/schemas/Relationship' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /relationships/blocks/{target_id}: put: tags: - users summary: Block User description: Blocks a user. operationId: block_user parameters: - name: target_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Relationship object content: application/json: schema: $ref: '#/components/schemas/Relationship' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Relationship not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Cannot act on self content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /relationships/friends: post: tags: - users summary: Send Friend Request description: Requests to add a user as a friend by their username and discriminator. operationId: add_friend requestBody: content: application/json: schema: $ref: '#/components/schemas/SendFriendRequestPayload' required: true responses: '200': description: Relationship object content: application/json: schema: $ref: '#/components/schemas/Relationship' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: User not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Cannot act on self content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /relationships/friends/{target_id}: put: tags: - users summary: Accept Friend Request description: Accepts an incoming friend request. operationId: accept_friend_request parameters: - name: target_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: Relationship object content: application/json: schema: $ref: '#/components/schemas/Relationship' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Relationship not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Cannot act on self content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /relationships/{target_id}: delete: tags: - users summary: Delete Relationship description: |- Deletes a relationship with a user. This includes: * Revoking outgoing friend requests * Declining incoming friend requests * Unfriending users * Unblocking users (unidirectional) operationId: delete_relationship parameters: - name: target_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '204': description: Relationship deleted '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Relationship not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Cannot act on self content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /users: post: tags: - users summary: Create User description: Registers a new user account with the given payload. operationId: create_user requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateUserPayload' required: true responses: '201': description: User ID and token content: application/json: schema: $ref: '#/components/schemas/CreateUserResponse' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Username or email is already taken content: application/json: schema: $ref: '#/components/schemas/Error' /users/check/{username}: get: tags: - users summary: Check Username Availability description: Checks if a username is available. operationId: check_username parameters: - name: username in: path required: true schema: type: string responses: '200': description: Username is available '400': description: Invalid username content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Username is taken content: application/json: schema: $ref: '#/components/schemas/Error' /users/me: get: tags: - users summary: Get Authenticated User description: Fetches information about the logged-in user. operationId: get_client_user responses: '200': description: User object content: application/json: schema: $ref: '#/components/schemas/ClientUser' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] delete: tags: - users summary: Delete User description: Deletes the user account of the authenticated user. This is irreversible. operationId: delete_user requestBody: content: application/json: schema: $ref: '#/components/schemas/DeleteUserPayload' required: true responses: '204': description: User was successfully deleted '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token/credentials content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] patch: tags: - users summary: Edit User description: Modifies information about the logged in user. operationId: edit_user requestBody: content: application/json: schema: $ref: '#/components/schemas/EditUserPayload' required: true responses: '200': description: User object after modification content: application/json: schema: $ref: '#/components/schemas/User' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Username is already taken content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /users/me/channels: get: tags: - channels summary: Get DM Channels description: Fetches all DM and group DM channels that the current user is a part of. operationId: get_dm_channels responses: '200': description: DM channels were successfully fetched content: application/json: schema: type: array items: $ref: '#/components/schemas/DmChannel' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] post: tags: - channels summary: Open DM Channel / Create Group DM Channel description: |- Opens a DM channel with the given user, or creates a group DM channel with the given users. # For standard DM channels You may only open DM channels with users that are your friends, share a mutual guild, and do not have you blocked. If a DM channel already exists, the existing channel is returned. # For group DM channels You may only create group DM channels with users that are your friends and do not have you blocked. operationId: create_dm_channel requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateDmChannelPayload' required: true responses: '201': description: Channel was successfully created content: application/json: schema: $ref: '#/components/schemas/DmChannel' '400': description: Invalid payload content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Invalid token content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: User not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] /users/{user_id}: get: tags: - users summary: Get User description: Fetches information about a user by their ID. operationId: get_user parameters: - name: user_id in: path required: true schema: type: integer format: int64 minimum: 0 responses: '200': description: User object content: application/json: schema: $ref: '#/components/schemas/User' '404': description: User not found content: application/json: schema: $ref: '#/components/schemas/Error' security: - token: [] components: schemas: AddBotPayload: type: object description: The payload sent to add a bot to a guild. properties: permissions: allOf: - $ref: '#/components/schemas/Permissions' nullable: true Attachment: type: object description: Represents a message attachment. required: - id - filename - size properties: alt: type: string description: The description/alt text of the attachment. nullable: true filename: type: string description: The filename of the attachment. id: type: string format: uuid description: The UUID of the attachment. size: type: integer format: int64 description: The size of the attachment, in bytes. minimum: 0 BanMemberPayload: type: object description: The payload sent to ban a member from a guild. properties: delete_message_seconds: type: integer format: int32 description: |- The number of seconds of message history to delete from the banned user. Capped at 7 days (604800 seconds). If not specified or `0`, no messages are deleted. minimum: 0 reason: type: string description: The reason for the ban. nullable: true Bot: type: object description: Represents details about a bot. required: - user - owner_id - default_permissions - flags properties: default_permissions: $ref: '#/components/schemas/Permissions' flags: $ref: '#/components/schemas/BotFlags' owner_id: type: integer format: int64 description: The ID of the user who owns this bot. minimum: 0 user: $ref: '#/components/schemas/User' BotFlags: type: integer format: int32 ChangeEmailPayload: type: object description: Payload sent when changing a user's email. required: - password - new_email properties: new_email: type: string description: The new email of the user. password: type: string description: The current password of the user. ChangePasswordPayload: type: object description: Payload sent when changing a user's password. required: - current_password - new_password properties: current_password: type: string description: The current password of the user. new_password: type: string description: The new password of the user. Channel: oneOf: - $ref: '#/components/schemas/GuildChannel' - $ref: '#/components/schemas/DmChannel' description: Represents any channel. ChannelType: type: string description: |- An intermediate representation of a channel's type. This is never used directly, but is used to help deserialization. enum: - text - announcement - voice - category - merged - dm - group ClientUser: allOf: - $ref: '#/components/schemas/User' - type: object required: - dm_privacy - group_dm_privacy - friend_request_privacy - onboarding_flags - settings - notification_override properties: dm_privacy: $ref: '#/components/schemas/PrivacyConfiguration' email: type: string format: email description: |- The associated email of the client's account. If the client is a bot, this is `None`. nullable: true friend_request_privacy: $ref: '#/components/schemas/PrivacyConfiguration' group_dm_privacy: $ref: '#/components/schemas/PrivacyConfiguration' notification_override: type: object description: A map of notification overrides. additionalProperties: $ref: '#/components/schemas/NotificationFlags' onboarding_flags: $ref: '#/components/schemas/UserOnboardingFlags' settings: $ref: '#/components/schemas/Settings' description: |- Represents user info about the client. This has other information that is not available to the public, such as emails, guilds, and relationships (friends and blocked users). CreateBotPayload: type: object description: Payload sent when creating a new bot account. required: - username properties: display_name: type: string description: The global display name of the bot. Must be between 2 and 32 characters. nullable: true public: type: boolean description: |- Whether the bot is public. Public bots can be added by anyone, while private bots can only be added by the owner. username: type: string description: |- The unique username of the bot. Must between 2 and 32 characters and only contain alphanumeric characters, periods (.), hyphens (-), and underscores (_). Note that unlike usernames, bot usernames are only unique to you. The full username of the bot will be ``owner_username/given_username``, for example ``user123/MyBot``. CreateBotResponse: allOf: - $ref: '#/components/schemas/Bot' - type: object required: - token properties: token: type: string description: The token to use for authentication. description: Data sent when creating a new bot account. CreateDmChannelPayload: oneOf: - type: object description: A standard DM channel with a single recipient. required: - recipient_id - type properties: recipient_id: type: integer format: int64 description: The ID of the recipient to add to the DM with. minimum: 0 type: type: string enum: - dm - type: object description: A group DM channel with multiple recipients. required: - name - recipient_ids - type properties: name: type: string description: The name of the group DM. recipient_ids: type: array items: type: integer format: int64 minimum: 0 description: A list of recipient IDs to initially add to the group DM. type: type: string enum: - group description: The request body sent to create a new DM or group channel. discriminator: propertyName: type CreateEmojiPayload: type: object description: The payload sent to create a new emoji. required: - name - image properties: image: type: string description: |- The emoji image. The image should be represented as a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme). name: type: string description: The name of the emoji. CreateGuildChannelInfo: oneOf: - type: object description: A text channel. required: - type properties: topic: type: string description: The topic of the text channel, if any. nullable: true type: type: string enum: - text - type: object description: An announcement channel. required: - type properties: topic: type: string description: The topic of the text channel, if any. nullable: true type: type: string enum: - announcement - type: object description: A voice channel. required: - type properties: type: type: string enum: - voice user_limit: type: integer format: int32 description: |- The user limit of the channel. This should be a value between `0` and `500`. A value of `0` is the default and indicates the absence of a user limit. minimum: 0 - type: object required: - type properties: type: type: string enum: - category description: The type and other information sent to create a new guild channel. discriminator: propertyName: type CreateGuildChannelPayload: allOf: - $ref: '#/components/schemas/CreateGuildChannelInfo' - type: object required: - name properties: color: allOf: - $ref: '#/components/schemas/ExtendedColor' nullable: true icon: type: string description: |- The icon of the channel represented as a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme), if any. nullable: true name: type: string description: The name of the text channel. nonce: type: string description: |- A nonce to include with the channel. This is not stored and can be used to identify the channel later on (it is relayed through the websocket). nullable: true overwrites: type: array items: $ref: '#/components/schemas/PermissionOverwrite' description: A list of permission overwrites to apply to the channel, if any. nullable: true parent_id: type: integer format: int64 description: The ID of the category to create the channel in, if any. nullable: true minimum: 0 description: The request body sent to create a new channel in a guild. CreateGuildPayload: type: object description: The payload sent to create a new guild. required: - name properties: banner: type: string description: The banner URL for the guild. Must be a valid URL, or `None` to not set a banner. nullable: true description: type: string description: |- The description of the guild. Must be between 0 and 1000 characters, or `None` for no description. nullable: true icon: type: string description: |- The icon for the guild. Must be a valid URL, or `None` to not set an icon. This should be a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme) if provided. nullable: true name: type: string description: The name of the guild. Must be between 2 and 100 characters. nonce: type: string description: |- A nonce to include with the guild. This is not stored and can be used to identify the guild later on (it is relayed through the websocket). nullable: true public: type: boolean description: Whether the guild should be public or not. Defaults to `false`. CreateInvitePayload: type: object description: |- The payload sent to create a new invite in a guild. Note that invites are immutable, so after creation, they cannot be modified. properties: max_age: type: integer format: int32 description: |- The duration of the invite, in seconds. Must be between 0 and 604_800 (7 days), or leave empty for an invite that never expires. minimum: 0 max_uses: type: integer format: int32 description: |- The maximum number of uses for the invite. Must be at least 1, or leave empty for unlimited uses. minimum: 0 CreateMessagePayload: type: object description: Payload sent to send a message. properties: content: type: string description: |- The content of the message, if any. If specified, this should be a string with a size of at most 4 KB. nullable: true embeds: type: array items: $ref: '#/components/schemas/Embed' description: |- A list of rich embeds to send with the message. Leave empty to send no embeds. If specified, this takes a maximum of 10 embeds. nonce: type: string description: |- A nonce to include with the message. This is not stored and can be used to identify the message later on (it is relayed through the websocket). nullable: true references: type: array items: $ref: '#/components/schemas/MessageReference' description: Message(s) that this message replies to. CreateRolePayload: type: object description: Payload sent to create a new role in a guild. required: - name properties: color: allOf: - $ref: '#/components/schemas/ExtendedColor' nullable: true hoisted: type: boolean description: Whether the role should be hoisted. icon: type: string description: |- The icon of the role represented as a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme), if any. nullable: true mentionable: type: boolean description: Whether the role should be mentionable by anyone. name: type: string description: The name of the role. permissions: $ref: '#/components/schemas/PermissionPair' position: type: integer format: int32 description: |- The position the role should be in. Must be at least (and defaults to) ``1`` and at most the position of your top role (unless you are owner). minimum: 0 CreateUserPayload: type: object description: Payload sent to create a new user. required: - username - email - password - captcha_token properties: captcha_token: type: string description: Turnstile CAPTCHA response from Cloudflare. display_name: type: string description: The global display name of the user. Must be between 2 and 32 characters. nullable: true email: type: string format: email description: The email of the user. Must be a valid email address. password: type: string format: password description: The password of the user. Must be between 8 and 32 characters. username: type: string description: |- The unique username of the user. Must between 2 and 32 characters and only contain alphanumeric characters, periods (.), hyphens (-), and underscores (_). CreateUserResponse: type: object description: Data returned when creating a new user. required: - id - token properties: id: type: integer format: int64 description: The ID of the user. minimum: 0 token: type: string description: The token to use for authentication. CustomEmoji: type: object description: Represents a custom emoji. required: - id - guild_id - name properties: created_by: type: integer format: int64 description: The ID of the user that created the emoji. This is `None` if the user has been deleted. nullable: true minimum: 0 guild_id: type: integer format: int64 description: The ID of the guild the emoji is in. minimum: 0 id: type: integer format: int64 description: The ID of the emoji. minimum: 0 name: type: string description: The name of the emoji. DeleteBotPayload: type: object description: Payload sent when deleting a bot. required: - password properties: password: type: string format: password description: The password of the bot owner. DeleteGuildPayload: type: object description: The payload sent to delete a guild. required: - password properties: password: type: string description: |- The password of the user. If this is a bot account, the password is not required and no body should be sent. DeleteUserPayload: type: object description: Payload sent when deleting a user. required: - password properties: password: type: string format: password description: The password of the user. DmChannel: allOf: - $ref: '#/components/schemas/DmChannelInfo' - type: object required: - id properties: id: type: integer format: int64 description: The ID of the channel. minimum: 0 last_message: allOf: - $ref: '#/components/schemas/Message' nullable: true description: Represents a direct-message-like channel that does not belong in a guild. DmChannelInfo: oneOf: - type: object description: A normal DM channel. required: - recipient_ids - type properties: recipient_ids: type: array items: type: integer format: int64 maxItems: 2 minItems: 2 type: type: string enum: - dm - type: object description: A group chat consisting of multiple users. required: - name - owner_id - recipient_ids - type properties: icon: type: string description: The URL of the group's icon, if any. nullable: true name: type: string description: The name of the group chat. owner_id: type: integer format: int64 description: The ID of the owner of the group chat. minimum: 0 recipient_ids: type: array items: type: integer format: int64 minimum: 0 description: A list of recipients in the group chat by user ID. topic: type: string description: The topic of the group chat, if any. nullable: true type: type: string enum: - group description: Represents extra information associated with DM channels. discriminator: propertyName: type EditBotPayload: allOf: - $ref: '#/components/schemas/EditUserPayload' - type: object properties: default_permissions: allOf: - $ref: '#/components/schemas/Permissions' nullable: true global_enabled: type: boolean description: Whether the bot should support global access. nullable: true group_dm_enabled: type: boolean description: Whether the bot should support being added to group DMs. nullable: true guild_enabled: type: boolean description: Whether the bot should support being added to guilds. nullable: true public: type: boolean description: Whether the bot should be public. Leave empty to keep the current setting. nullable: true description: Payload sent to edit details of a bot account. EditChannelPayload: type: object description: The request body sent to modify a channel. properties: color: allOf: - $ref: '#/components/schemas/ExtendedColor' nullable: true icon: type: string format: byte description: |- The new icon of the channel. Explicitly setting this to `None` will clear the icon. Takes effect for all channels except for user DMs. This should be a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme). nullable: true name: type: string description: |- The new name of the channel. If left blank, the name will not be changed. Takes effect for all channels except for user DMs. nullable: true overwrites: type: array items: $ref: '#/components/schemas/PermissionOverwrite' description: |- The new permission overwrites to apply to the channel. If provided, this will completely replace the existing overwrites. You may only create overwrites for manageable roles and users. You may only modify/set permissions that you have. Only takes effect for guild channels. nullable: true topic: type: string description: |- The new topic or description of the channel. Explicitly setting this to `None` will clear the topic. Only takes effect for text-based channels in guilds, or group chats. nullable: true user_limit: type: integer format: int32 description: |- The new user limit of the voice channel. Explicitly setting this to `0` will remove the current limit, if there is any. Only takes effect for guild voice channels. nullable: true minimum: 0 EditChannelPositionPayload: type: object description: The payload used per channel to specify its new position data. required: - id - position properties: id: type: integer format: int64 description: The ID of the channel to modify. minimum: 0 parent_id: type: integer format: int64 description: |- The new parent category of the channel. If left blank, the scope will not be changed. If set to `Null`, the channel will be moved to the root of the channel list. nullable: true minimum: 0 position: type: integer format: int32 description: The new position of the channel. minimum: 0 EditChannelPositionsPayload: type: object description: The request body sent to modify channel positions. required: - positions properties: positions: type: array items: $ref: '#/components/schemas/EditChannelPositionPayload' description: A list of channel positions to modify. EditClientMemberPayload: type: object description: The payload send to edit the authenticated user as a member. properties: nick: type: string description: |- The new nickname of the member. Leave empty to keep the current nickname, and set to `null` to remove the nickname. nullable: true EditEmojiPayload: type: object description: |- The payload sent to modify an emoji. # Note The image of an emoji is immutable. To change the image, create a new emoji instead. required: - name properties: name: type: string description: The new name of the emoji. EditGuildPayload: type: object description: The payload sent to edit a guild. properties: banner: type: string description: |- The new banner URL of the guild. Leave empty to keep the current banner, and set to `null` to remove the banner. nullable: true description: type: string description: |- The new description of the guild. Leave empty to keep the current description, and set to `null` to remove the description. nullable: true icon: type: string format: byte description: |- The new icon of the guild. Leave empty to keep the current icon, and set to `null` to remove the icon. The icon should be represented as a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme). nullable: true name: type: string description: The new name of the guild. Leave empty to keep the current name. nullable: true public: type: boolean description: Whether the guild should be public or not. Leave empty to keep the current setting. nullable: true EditMemberPayload: type: object description: The payload sent to edit a member. properties: nick: type: string description: |- The new nickname of the member. Leave empty to keep the current nickname, and set to `null` to remove the nickname. nullable: true permissions: allOf: - $ref: '#/components/schemas/Permissions' nullable: true roles: type: array items: type: integer format: int64 minimum: 0 description: |- If provided, this is a bulk overwrite of the member's roles. Any roles not in this list will be removed from the member, and any roles in this list that are managable by the user will be added to the member (that is, if the role isn't managed and the user's top role is higher than the role). If any role is not found, a 404 will be returned. The default role will always be added to the member, regardless of whether it is in this list. nullable: true EditMessagePayload: type: object description: Payload sent to edit a message. properties: content: type: string description: The new content of the message, if any. Explicitly specify `null` to remove the content. nullable: true embeds: type: array items: $ref: '#/components/schemas/Embed' description: |- A list of rich embeds to send with the message. This will overwrite any existing embeds if specified. This wlil remove all embeds if set to either an empty list or explicitly set to `null`. nullable: true EditRolePayload: type: object description: Payload sent to edit a role. properties: color: allOf: - $ref: '#/components/schemas/ExtendedColor' nullable: true hoisted: type: boolean description: Whether the role should be hoisted. nullable: true icon: type: string format: byte description: |- The new icon of the role. Explicitly setting this to `None` will clear the icon. This should be a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme). nullable: true mentionable: type: boolean description: Whether the role should be mentionable by anyone. nullable: true name: type: string description: The new name of the role, if any. nullable: true permissions: allOf: - $ref: '#/components/schemas/PermissionPair' nullable: true EditUserPayload: type: object description: Payload sent when editing a user. properties: avatar: type: string format: byte description: |- The new avatar of the user. Leave empty to keep the current avatar, and set to `null` to remove the avatar. If provided, the avatar should be represented as a [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme). nullable: true banner: type: string description: |- The new banner URL of the user. Leave empty to keep the current banner, and set to `null` to remove the banner. nullable: true bio: type: string description: |- The new bio of the user. Leave empty to keep the current bio, and set to `null` to remove the bio. nullable: true display_name: type: string description: |- The new display name of the user. Leave empty to keep the current display name, and set to `null` to remove the display name. nullable: true username: type: string description: The new username of the user. Leave empty to keep the current username. nullable: true Embed: type: object description: |- Represents a special card shown in the UI for various purposes, embedding extra information to the user in a more visually appealing way. These are known as embeds and are used in messages. required: - type properties: author: allOf: - $ref: '#/components/schemas/EmbedAuthor' nullable: true color: type: integer format: int32 description: The color of the embed, shown as a stripe on the left side of the embed. nullable: true minimum: 0 description: type: string description: The description, or body text of the embed. nullable: true fields: type: array items: $ref: '#/components/schemas/EmbedField' description: A list of fields in the embed. nullable: true footer: allOf: - $ref: '#/components/schemas/EmbedFooter' nullable: true hue: type: integer format: int32 description: |- The hue of the main body of the background. This is only available for rich embeds. This should be a number between `0` and `100`, measured as a percentage. nullable: true minimum: 0 image: type: string description: The image URL of the embed. nullable: true thumbnail: type: string description: The thumbnail URL of the embed. nullable: true timestamp: type: string format: date-time description: The timestamp of the embed. nullable: true title: type: string description: The title of the embed. nullable: true type: $ref: '#/components/schemas/EmbedType' url: type: string description: |- The URL of the embed, shown as a hyperlink in the title. Only available if the embed has a title. nullable: true EmbedAuthor: type: object description: The author information of a message embed. required: - name properties: icon_url: type: string description: The URL of the author's icon. nullable: true name: type: string description: The name of the author. url: type: string description: The URL of the author, shown as a hyperlink of the author's name. nullable: true EmbedField: type: object description: Information about an embed's field. required: - name - value properties: align: $ref: '#/components/schemas/MessageEmbedFieldAlignment' name: type: string description: The name of the field. value: type: string description: The value of the field. EmbedFooter: type: object description: The footer information of a message embed. required: - text properties: icon_url: type: string description: The URL of the footer's icon. nullable: true text: type: string description: The text of the footer. EmbedType: type: string description: The type of a message embed. enum: - rich - image - video - meta EmojiData: type: object required: - emoji - description - category - aliases - tags - unicode_version - ios_version properties: aliases: type: array items: type: string category: type: string description: type: string emoji: type: string ios_version: type: string skin_tones: type: boolean nullable: true tags: type: array items: type: string unicode_version: type: string Error: oneOf: - type: object description: Received a malformed JSON or MsgPack body. required: - error_type - message - type properties: error_type: $ref: '#/components/schemas/MalformedBodyErrorType' message: type: string description: A generalized message about the error. type: type: string enum: - malformed_body - type: object description: |- You are missing the request body in an endpoint that requires it. This is commonly JSON or MsgPack. required: - message - type properties: message: type: string description: The error message. type: type: string enum: - missing_body - type: object description: Invalid field in the request body. required: - field - message - type properties: field: type: string description: The field that failed validation. message: type: string description: The error message. type: type: string enum: - invalid_field - type: object description: You are missing a required field in the request body. required: - field - message - type properties: field: type: string description: The name of the missing field. message: type: string description: The error message. type: type: string enum: - missing_field - type: object description: Could not resolve a plausible IP address from the request. required: - message - type properties: message: type: string description: The error message. type: type: string enum: - malformed_ip - type: object description: The entity was not found. required: - entity - message - type properties: entity: type: string description: The type of item that couldn't be found. message: type: string description: The error message. type: type: string enum: - not_found - type: object description: This operation is only allowed in guilds. required: - message - type properties: message: type: string description: The error message. type: type: string enum: - guild_only - type: object description: Tried authorizing a bot account with anything but an authentication token. required: - message - type properties: message: type: string description: The error message. type: type: string enum: - unsupported_auth_method - type: object description: |- The request required a valid authentication token, but one of the following happened: * The token was not provided. * The token was malformed, i.e. a non-UTF-8 string. * The token does not exist or is invalid. required: - message - type properties: message: type: string description: The error message. type: type: string enum: - invalid_token - type: object description: Invalid login credentials were provided, i.e. an invalid password. required: - what - message - type properties: message: type: string description: The error message. type: type: string enum: - invalid_credentials what: type: string description: Which credential was invalid. - type: object description: |- Invalid Turnstile CAPTCHA token was provided. This is a token provided by Cloudflare when a user completes a CAPTCHA, and is used while registering new users to prevent spam. required: - message - type properties: message: type: string description: The error message. type: type: string enum: - invalid_captcha - type: object description: You must be a member of the guild to perform the requested action. required: - guild_id - message - type properties: guild_id: type: integer format: int64 description: The ID of the guild you are not a member of. minimum: 0 message: type: string description: The error message. type: type: string enum: - not_member - type: object description: You must be the owner of the guild to perform the requested action. required: - guild_id - message - type properties: guild_id: type: integer format: int64 description: The ID of the guild you are not the owner of. minimum: 0 message: type: string description: The error message. type: type: string enum: - not_owner - type: object description: You must be the owner of the bot to perform the requested action. required: - bot_id - message - type properties: bot_id: type: integer format: int64 description: The ID of the bot you are not the owner of. minimum: 0 message: type: string description: The error message. type: type: string enum: - not_bot_owner - type: object description: You are not the author of the message you are trying to edit. required: - message_id - message - type properties: message: type: string description: The error message. message_id: type: integer format: int64 description: The ID of the message you are trying to edit. minimum: 0 type: type: string enum: - not_message_author - type: object description: You are too low in the role hierarchy to perform the requested action. required: - guild_id - top_role_id - top_role_position - desired_position - message - type properties: desired_position: type: integer format: int32 description: The desired position your top role should be in the role hierarchy. minimum: 0 guild_id: type: integer format: int64 description: The ID of the guild you are not the owner of. minimum: 0 message: type: string description: The error message. top_role_id: type: integer format: int64 description: The ID of your top role. This is the role you possess with the highest position. minimum: 0 top_role_position: type: integer format: int32 description: The position of your top role. minimum: 0 type: type: string enum: - role_too_low - type: object description: You are missing the required permissions to perform the requested action. required: - guild_id - permissions - message - type properties: guild_id: type: integer format: int64 description: The ID of the guild you are missing permissions in. minimum: 0 message: type: string description: The error message. permissions: $ref: '#/components/schemas/Permissions' type: type: string enum: - missing_permissions - type: object description: You are trying to delete a managed role. required: - guild_id - role_id - message - type properties: guild_id: type: integer format: int64 description: The ID of the guild the role is in. minimum: 0 message: type: string description: The error message. role_id: type: integer format: int64 description: The ID of the role that is managed. minimum: 0 type: type: string enum: - role_is_managed - type: object description: You are banned from the guild you are trying to join. required: - guild_id - message - type properties: guild_id: type: integer format: int64 description: The ID of the guild you are banned from. minimum: 0 message: type: string description: The error message. reason: type: string description: The reason for the ban, if any. nullable: true type: type: string enum: - banned_from_guild - type: object description: |- You cannot leave a server or group DM that you are the owner of (you should transfer ownership before leaving). required: - id - message - type properties: id: type: integer format: int64 description: The ID of the guild or group DM you are trying to leave. minimum: 0 message: type: string description: The error message. type: type: string enum: - cannot_leave_as_owner - type: object description: You cannot perform the requested action on yourself. required: - message - type properties: message: type: string description: The error message. type: type: string enum: - cannot_act_on_self - type: object description: You cannot add bots as friends. required: - target_id - message - type properties: message: type: string description: The error message. target_id: type: integer format: int64 description: The ID of the bot you are trying to friend. minimum: 0 type: type: string enum: - cannot_friend_bots - type: object description: |- The user you are trying to interact with (e.g. add as a friend, open DMs, etc.) has privacy settings that prevent you from doing so. required: - interaction_type - target_id - message - type properties: interaction_type: $ref: '#/components/schemas/UserInteractionType' message: type: string description: The error message. target_id: type: integer format: int64 description: The ID of the user you are attempting to interact with. minimum: 0 type: type: string enum: - user_interaction_disallowed - type: object description: The user has blocked you, so you cannot interact with them. required: - target_id - message - type properties: message: type: string description: The error message. target_id: type: integer format: int64 description: The ID of the user that blocked you. minimum: 0 type: type: string enum: - blocked_by_user - type: object description: Something was already taken, e.g. a username or email. required: - what - message - type properties: message: type: string description: The error message. type: type: string enum: - already_taken what: type: string description: What was already taken. - type: object description: Something already exists, e.g. a relationship. required: - what - message - type properties: message: type: string description: The error message. type: type: string enum: - already_exists what: type: string description: What already exists. - type: object description: You are sending requests too quickly are you are being rate limited. required: - retry_after - ip - message - type properties: ip: type: string description: The IP address that is being rate limited. message: type: string description: The ratelimited message. retry_after: type: number format: float description: How long you should wait before sending another request, in whole seconds. type: type: string enum: - ratelimited - type: object description: Internal server error occured, this is likely a bug. required: - message - type properties: debug: type: string description: A debug version of the error, or `None` if there is no debug version. nullable: true message: type: string description: The error message. type: type: string enum: - internal_error what: type: string description: What caused the error. `None` if unknown. nullable: true description: An error that occurs within Adapt. discriminator: propertyName: type ExtendedColor: oneOf: - type: object description: A solid color. required: - color - type properties: color: type: integer format: int32 description: The color of the solid color. minimum: 0 type: type: string enum: - solid - allOf: - $ref: '#/components/schemas/Gradient' - type: object required: - type properties: type: type: string enum: - gradient description: |- A color that can either be solid or a linear gradient. Individual colors are specified as integers between 0 and 16777215. discriminator: propertyName: type Gradient: type: object description: |- A variation of an extended color that represents a linear gradient. Note that gradients are strictly linear and are provided in this format to allow for better consistency and ease of implementation in clients. required: - angle - stops properties: angle: type: number format: float description: The angle of the gradient, in radians. stops: type: array items: $ref: '#/components/schemas/GradientStop' description: The color stops of the gradient. GradientStop: type: object description: A single color stop in a linear gradient. required: - position - color properties: color: type: integer format: int32 description: The color of the stop. minimum: 0 position: type: number format: float description: The position of the stop in the gradient, between 0 and 1. Guild: allOf: - $ref: '#/components/schemas/PartialGuild' - type: object properties: channels: type: array items: $ref: '#/components/schemas/GuildChannel' description: |- A list of resolved channels in the guild. This is only available during the following events: * Fetching the guild directly * The client retrieves the response after a request to join a guild through an invite * The client receives a ready event containing all guild data through the gateway. * The client receives a guild create event through the gateway. nullable: true emojis: type: array items: $ref: '#/components/schemas/CustomEmoji' description: |- A list of resolved emojis in the guild. This is only available during the following events: * Fetching the guild directly * The client retrieves the response after a request to join a guild through an invite * The client receives a ready event containing all guild data through the gateway. * The client receives a guild create event through the gateway. nullable: true members: type: array items: $ref: '#/components/schemas/Member' description: |- A list of resolved members in the guild. This is only available during the following events: * Fetching the guild directly * The client retrieves the response after a request to join a guild through an invite * The client receives a ready event containing all guild data through the gateway. * The client receives a guild create event through the gateway. nullable: true roles: type: array items: $ref: '#/components/schemas/Role' description: |- A list of resolved roles in the guild. This is only available during the following events: * Fetching the guild directly * The client retrieves the response after a request to join a guild through an invite * The client receives a ready event containing all guild data through the gateway. * The client receives a guild create event through the gateway. nullable: true description: Represents a guild with all information, sometimes referred to as a server. GuildBan: allOf: - $ref: '#/components/schemas/MaybePartialUser' - type: object required: - guild_id - moderator_id - banned_at properties: banned_at: type: string format: date-time description: The time that the ban was issued. guild_id: type: integer format: int64 description: The ID of the guild this ban is in. minimum: 0 moderator_id: type: integer format: int64 description: The ID of the moderator that issued the ban. minimum: 0 reason: type: string description: The reason for the ban, if any. nullable: true description: Represents a ban entry in a guild. GuildChannel: allOf: - $ref: '#/components/schemas/GuildChannelInfo' - type: object required: - id - guild_id - name - position - overwrites properties: color: allOf: - $ref: '#/components/schemas/ExtendedColor' nullable: true guild_id: type: integer format: int64 description: The ID of the guild that this channel is in. minimum: 0 icon: type: string description: The URL to the icon of the channel, if any. nullable: true id: type: integer format: int64 description: The ID of the channel. minimum: 0 name: type: string description: The name of the channel. overwrites: type: array items: $ref: '#/components/schemas/PermissionOverwrite' description: The permission overwrites for this channel. parent_id: type: integer format: int64 description: |- The ID of the parent category of the channel. This is `None` if the channel is not in a category. This is also used for merged channels. nullable: true minimum: 0 position: type: integer format: int32 description: |- The position of the channel in the channel list. A lower value means appearing "higher" in the UI, basically think of this as a 0-indexed listing of the channels from top-to-bottom. Positions are scoped per category, and categories have their own positions. Channels that lack a category will be shown above all categories. This is because no channels can be displayed in between or after categories - in the UI all non-category channels are displayed above any other category channels. For example: ```text [0] text-channel [1] voice-channel [2] another-text-channel [0] Category [0] another-text-channel [1] another-voice-channel [0] Another Category [1] nested-voice-channel [2] nested-voice-channel-2 [1] Yet Another Category [0] another-text-channel ``` minimum: 0 description: Represents a channel in a guild. GuildChannelInfo: oneOf: - allOf: - $ref: '#/components/schemas/TextBasedGuildChannelInfo' - type: object required: - type properties: type: type: string enum: - text - allOf: - $ref: '#/components/schemas/TextBasedGuildChannelInfo' - type: object required: - type properties: type: type: string enum: - announcement - type: object description: A voice channel. required: - user_limit - type properties: type: type: string enum: - voice user_limit: type: integer format: int32 description: |- The user limit of the channel. This should be a value between `0` and `500`. A value of `0` indicates the absence of a user limit. minimum: 0 - type: object required: - type properties: type: type: string enum: - category - allOf: - $ref: '#/components/schemas/TextBasedGuildChannelInfo' - type: object required: - type properties: type: type: string enum: - merged description: Represents the type along with type-specific info of a guild channel. discriminator: propertyName: type GuildFlags: type: integer format: int32 GuildFolder: type: object description: Represents a folder that contains a collection of guilds. This is only shown in the client's UI. required: - guilds properties: guilds: type: array items: type: integer format: int64 minimum: 0 description: |- A list of guild IDs representing guilds that were placed in this folder, in order from top to bottom. path: type: array items: $ref: '#/components/schemas/GuildFolderInfo' description: |- The path of the folder, with the top-level folder first. This is `None` if this folder represents the collection of guilds that are not in any folders, or in other terms, the root folder. nullable: true GuildFolderInfo: type: object description: |- Represents information such as the name and color of a guild folder. This is only shown in the client's UI. required: - name - color properties: color: type: integer format: int32 description: The color of the folder. minimum: 0 name: type: string description: The name of the folder. GuildMemberCount: type: object description: Represents member counts for a guild. required: - total properties: online: type: integer format: int32 description: |- The number of members that are online. If this was part of a partial guild object, then this will be `None`. nullable: true minimum: 0 total: type: integer format: int32 description: The total number of members in the guild. minimum: 0 Invite: type: object description: |- A model representing an invite to a guild. All invites are **immutable**; they cannot be modified once changed. required: - code - guild_id - uses - max_uses - max_age properties: code: type: string description: The code of the invite. created_at: type: string format: date-time description: |- A timestamp representing when this invite was created. This is `None` if this is a vanity invite. nullable: true guild: allOf: - $ref: '#/components/schemas/PartialGuild' nullable: true guild_id: type: integer format: int64 description: The ID of the guild this invite leads to. minimum: 0 inviter_id: type: integer format: int64 description: The ID of the user that created this invite. This is `None` if this is a vanity invite. nullable: true minimum: 0 max_age: type: integer format: int32 description: |- How long this invite is valid for, in seconds. ``0`` if this invite never expires. This counts from the time the invite was created (see `created_at`). minimum: 0 max_uses: type: integer format: int32 description: How many times this invite can be used. ``0`` if unlimited. minimum: 0 uses: type: integer format: int32 description: How many times this invite has been used. minimum: 0 LoginRequest: type: object description: The request body for POST /login required: - email - password properties: email: type: string description: The email to log in with. method: $ref: '#/components/schemas/TokenRetrievalMethod' password: type: string format: password description: The password to log in with. LoginResponse: type: object description: The response body for POST /login required: - user_id - token properties: token: type: string description: The authentication token to use for future requests. user_id: type: integer format: int64 description: The user ID of the logged in user. minimum: 0 MalformedBodyErrorType: type: string description: The categorization of why the body is malformed. enum: - invalid_content_type - invalid_utf8 - invalid_json - invalid_multipart MaybePartialMessage: oneOf: - $ref: '#/components/schemas/Message' - type: object description: Just the ID of the message. required: - id properties: id: type: integer format: int64 minimum: 0 description: Either a fully resolved message or just its ID. MaybePartialUser: oneOf: - $ref: '#/components/schemas/User' - type: object description: A user with only an ID. required: - id properties: id: type: integer format: int64 minimum: 0 description: Potentially a partial user. Member: allOf: - $ref: '#/components/schemas/MaybePartialUser' - type: object required: - guild_id - joined_at - permissions properties: guild_id: type: integer format: int64 description: The ID of the guild this member is in. minimum: 0 joined_at: type: string format: date-time description: The time that the member joined the guild. nick: type: string description: The nickname of the member. `None` if the member has no nickname. nullable: true permissions: $ref: '#/components/schemas/Permissions' roles: type: array items: type: integer format: int64 minimum: 0 description: A list of IDs of the roles that the member has. This could be `None` in some cases. nullable: true description: Represents a member of a guild. Members are user objects associated with a guild. MemberOrUser: oneOf: - $ref: '#/components/schemas/Member' - $ref: '#/components/schemas/User' description: Represents either a member or a user. Message: allOf: - $ref: '#/components/schemas/MessageInfo' - type: object required: - id - channel_id - embeds - attachments - flags - reactions - mentions - references properties: attachments: type: array items: $ref: '#/components/schemas/Attachment' description: A list of attachments included in this message. author: allOf: - $ref: '#/components/schemas/MemberOrUser' nullable: true author_id: type: integer format: int64 description: |- The snowflake ID of the author of this message, or `None` if this is a system message, or if the user has been deleted. nullable: true minimum: 0 channel_id: type: integer format: int64 description: The snowflake ID of the channel this message was sent in. minimum: 0 content: type: string description: The text content of this message. nullable: true edited_at: type: string format: date-time description: |- The timestamp at which this message was last edited. This is `None` if the message has not been edited. nullable: true embeds: type: array items: $ref: '#/components/schemas/Embed' description: A list of embeds included in this message. flags: $ref: '#/components/schemas/MessageFlags' id: type: integer format: int64 description: The snowflake ID of the message. minimum: 0 mentions: type: array items: type: integer format: int64 minimum: 0 description: |- A list of snowflake IDs of users and/or roles that this message mentions. If this message also mentions everyone/here in a guild, then the guild ID is also included in this list. Note: Users or roles will stay in this list even if they are deleted. This represents those that were mentioned at the time the message was sent. That is, there is no guarantee that all of these IDs will resolve to a user or role! reactions: type: array items: $ref: '#/components/schemas/Reaction' description: The reactions received on this message. references: type: array items: $ref: '#/components/schemas/MessageReference' description: A list of messages that this message references. description: Represents a text or system message in a channel. MessageEmbedFieldAlignment: type: string description: The alignment type of a message embed field. enum: - left - center - right - inline MessageFlags: type: integer format: int32 MessageInfo: oneOf: - type: object required: - type properties: type: type: string enum: - default - type: object required: - type - metadata properties: metadata: type: object description: A join message, sent when a user joins either a group DM or a guild. required: - user_id properties: user_id: type: integer format: int64 description: The ID of the user who joined. minimum: 0 type: type: string enum: - join - type: object required: - type - metadata properties: metadata: type: object description: A leave message, sent when a user leaves either a group DM or a guild. required: - user_id properties: user_id: type: integer format: int64 description: The ID of the user who left. minimum: 0 type: type: string enum: - leave - type: object required: - type - metadata properties: metadata: type: object description: A message that indicates another message has been pinned. required: - pinned_message_id - pinned_by properties: pinned_by: type: integer format: int64 description: The ID of the user that pinned the message. minimum: 0 pinned_message_id: type: integer format: int64 description: The ID of the message that was pinned. minimum: 0 type: type: string enum: - pin description: Represents the type and info of a message. discriminator: propertyName: type MessageReference: type: object description: Represents partial message data about a referenced message. required: - message_id - channel_id properties: channel_id: type: integer format: int64 description: The ID of the channel the referenced message is in. minimum: 0 guild_id: type: integer format: int64 description: The ID of the guild the referenced message is in, if any. nullable: true minimum: 0 mention_author: type: boolean description: Whether to mention the author of the referenced message. message_id: type: integer format: int64 description: The ID this message is referencing. minimum: 0 NotificationFlags: type: integer format: int32 PartialEmoji: type: object description: Represents partial information about a custom emoji or a unicode emoji. required: - name properties: id: type: integer format: int64 description: The ID of the custom emoji. This is `None` if the emoji is a unicode emoji. nullable: true minimum: 0 name: type: string description: The name of the custom emoji, or the emoji itself if this is a unicode emoji. PartialGuild: type: object description: Represents a guild with partial information, sometimes referred to as a server. required: - id - name - owner_id - flags properties: banner: type: string description: The URL of the banner of the guild. nullable: true description: type: string description: The description of the guild. nullable: true flags: $ref: '#/components/schemas/GuildFlags' icon: type: string description: The URL of the icon of the guild. nullable: true id: type: integer format: int64 description: The snowflake ID of the guild. minimum: 0 member_count: allOf: - $ref: '#/components/schemas/GuildMemberCount' nullable: true name: type: string description: The name of the guild. owner_id: type: integer format: int64 description: The ID of the owner of the guild. minimum: 0 vanity_code: type: string description: |- The vanity URL code of the guild. This solely includes the code, not the full URL. This is `None` if the guild does not have a vanity URL. Guilds have the ability to set vanity URLs once they surpass 100 non-bot members *and* have their visibility set to public. The vanity URL code can be between 3 and 32 characters long. nullable: true PermissionOverwrite: allOf: - $ref: '#/components/schemas/PermissionPair' - type: object required: - id properties: id: type: integer format: int64 description: |- The ID of the role or user this overwrite applies to. The model type can be extracted from the ID. minimum: 0 description: Represents a permission overwrite. PermissionPair: type: object description: |- Represents a pair of permissions, one representing allowed permissions and the other representing denied permissions. This is so that any permission that is represented as "neutral" where it is neither allowed/denied remains easily overwritten by lower roles or members. required: - allow - deny properties: allow: $ref: '#/components/schemas/Permissions' deny: $ref: '#/components/schemas/Permissions' Permissions: type: integer format: int64 PrivacyConfiguration: type: integer format: int32 Reaction: type: object description: Represents a reaction on a message. required: - message_id - emoji - user_ids properties: created_at: type: array items: type: string format: date-time description: |- A list of timestamps representing when the users reacted with this emoji. The index of the timestamp corresponds to the index of the user ID in `user_ids`. This is **only** provided when explicitly fetching reactions for a message. Otherwise, this is `None`. nullable: true emoji: $ref: '#/components/schemas/PartialEmoji' message_id: type: integer format: int64 description: The ID of the message the reaction is on. minimum: 0 user_ids: type: array items: type: integer format: int64 minimum: 0 description: A list of user IDs that have reacted with this emoji. RegenerateBotTokenPayload: type: object description: Payload sent when regenerating a bot's token. required: - password properties: password: type: string format: password description: The password of the bot owner. Relationship: type: object description: Represents a relationship that a user has with another user. required: - user - type properties: type: $ref: '#/components/schemas/RelationshipType' user: $ref: '#/components/schemas/User' RelationshipType: type: string description: Represents the type of relationship a user has with another user. enum: - friend - outgoing_request - incoming_request - blocked Role: type: object description: A role in a guild. required: - id - guild_id - name - permissions - position - flags properties: color: allOf: - $ref: '#/components/schemas/ExtendedColor' nullable: true flags: $ref: '#/components/schemas/RoleFlags' guild_id: type: integer format: int64 description: The ID of the guild this role belongs to. minimum: 0 icon: type: string description: The URL of the role's icon, if any, displayed alongside member names in chat. nullable: true id: type: integer format: int64 description: The snowflake ID of the role. minimum: 0 name: type: string description: The name of the role. permissions: $ref: '#/components/schemas/PermissionPair' position: type: integer format: int32 description: |- The position of this role in the role hierarchy. The lower the number, the lower the role. The default role always has a position of 0. The backend will try its best to keep all role positions unique, but on the event two collide due to something such as a data race, then the true position of these roles will not be predictable, and will likely be in the order of model creation. minimum: 0 RoleFlags: type: integer format: int32 SendFriendRequestPayload: type: object description: Payload sent when requesting to add a user as a friend. required: - username properties: username: type: string description: The username of the user to add as a friend. Settings: type: integer format: int32 TextBasedGuildChannelInfo: type: object description: Represents common information found in text-based guild channels. required: - nsfw - locked - slowmode properties: last_message: allOf: - $ref: '#/components/schemas/Message' nullable: true locked: type: boolean description: |- Whether the channel is locked. Only people with the `MANAGE_CHANNELS` permission can send messages in locked channels. nsfw: type: boolean description: Whether the channel is NSFW. slowmode: type: integer format: int32 description: |- The slowmode delay of the channel, in **milliseconds**. This should be a value between `0` and `86_400_000` (24 hours). `0` indicates the absence of slowmode. minimum: 0 topic: type: string description: The topic of the channel, if any. nullable: true TokenRetrievalMethod: type: string description: The method to use to retrieve an authentication token. enum: - new - revoke - reuse User: type: object description: |- Represents a user account. A lot of information is stored in the user's flags, including whether or not the user is a bot account. required: - id - username - flags properties: avatar: type: string description: The URL of the user's avatar. This is `None` if the user has no avatar. nullable: true banner: type: string description: The URL of the user's banner. This is `None` if the user has no banner. nullable: true bio: type: string description: The user's bio. This is `None` if the user has no bio. nullable: true display_name: type: string description: The display name of the user. This is `None` if the user has no display name. nullable: true flags: $ref: '#/components/schemas/UserFlags' id: type: integer format: int64 description: The snowflake ID of the user. minimum: 0 username: type: string description: The username of the user. UserFlags: type: integer format: int32 UserInteractionType: type: string description: The type of user interaction that was disallowed. enum: - dm - group_dm - friend_request UserOnboardingFlags: type: integer format: int64 securitySchemes: token: type: apiKey in: header name: Authorization