Skip to content

Integrate Discord Bot

Endpoint to integrate a Discord bot into the ToolzzAI agent.

Terminal window
curl --request POST \
--url https://chat.api.toolzz.com.br/api/v1/discord/integration \
--header 'Authorization: Bearer TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data '
{
"botId": "uuid",
"unitId": "uuid",
"title": "string",
"guildId": "string_digits",
"guildName": "string",
"channelIds": [
"string_digits"
],
"channelsDetail": [
{
"id": "string_digits",
"guild_id": "string_digits",
"name": "string",
"type": 0,
"position": 123,
"parent_id": "string_digits | null",
"topic": "string | null",
"nsfw": false,
"last_message_id": "string_digits | null",
"rate_limit_per_user": 0,
"flags": 0,
"icon_emoji": {
"id": "uuid | null",
"name": "string | null"
},
"theme_color": null,
"permission_overwrites": []
}
],
"permissions": "string_digits",
"autoReplyOnMention": true,
"threadAutoCreate": true,
"scope": "all | mentions | none",
"botToken": "discord_bot_token"
}
'
{
"id": "uuid",
"title": "string",
"connectionStatus": "string",
"guildName": "string",
"channelsDetail": [
{
"id": "string_digits",
"name": "string"
}
],
"channelIds": ["string_digits"],
"isActive": true,
"createdAt": "2026-04-17 12:26:12.804444"
}
ParameterTypeDescriptionRequired
AuthorizationStringAccess token (“Bearer” must be before the token)Yes
ParameterTypeDescriptionRequired
botIdUUIDUnique bot identifier in the Toolzz AI system.Yes
unitIdUUIDOrganizational unit identifier.Yes
titleStringCustom title to identify the integration.Yes
guildIdStringNumeric ID (Snowflake) of the Discord server.Yes
guildNameStringDiscord server name.Yes
channelIdsArray[Str]List containing only the IDs of the channels to be monitored.Yes
permissionsStringBitwise permissions (number defining the bot’s access).Yes
autoReplyOnMentionBooleanIf active, the bot automatically responds when mentioned.Yes
threadAutoCreateBooleanIf active, the bot creates threads to organize conversations.Yes
scopeStringAction scope (e.g., all, mentions).Yes
botTokenStringSecret token (Bot Token) obtained from the Discord Developer Portal.Yes
channelsDetail[]Array[Obj]List of objects with technical details for each channel:Yes
channelsDetail[].idStringChannel Snowflake ID.Yes
channelsDetail[].nameStringChannel name (e.g., “general”).Yes
channelsDetail[].typeNumberChannel type (e.g., 0 for text, 2 for voice, 4 for category).Yes
channelsDetail[].guild_idStringID of the server the channel belongs to.Yes
channelsDetail[].positionNumberHierarchical position of the channel in the server list.No
channelsDetail[].parent_idStringID of the parent category where the channel is inserted.No
channelsDetail[].topicStringDescription/Topic defined for the channel.No
channelsDetail[].nsfwBooleanDefines if the channel is marked for adult content.No
channelsDetail[].flagsNumberInternal configuration flags of the channel on Discord.No
channelsDetail[].icon_emojiObjectObject containing id and name of the channel emoji.No

Here is the consolidated technical documentation for the response (return) of the Discord integration configuration, based on the provided object:

Unified Documentation: Discord Configuration Response

Section titled “Unified Documentation: Discord Configuration Response”
KeyTypeDescription
idUUIDUnique identifier of the integration configuration in the database.
botIdUUIDUnique bot identifier in the Toolzz AI system.
unitIdUUIDUnique identifier of the owning organizational unit.
titleStringTitle assigned to the integration.
isActiveBooleanDefines if the integration is active in the system.
connectionStatusStringCurrent status of the connection with Discord (e.g., disconnected, connected).
guildIdStringSnowflake ID of the Discord server.
guildNameStringDiscord server name.
channelIds[]Array[Str]List of IDs of the channels configured for interaction.
channelsDetail[]Array[Obj]Summary list with the details of the available channels:
channelsDetail[].idStringChannel Snowflake ID.
channelsDetail[].nameStringChannel name on Discord.
scopeStringMessage monitoring scope (e.g., all).
permissionsStringBitwise permission string of the bot on the server.
autoReplyOnMentionBooleanIf the bot automatically responds when mentioned.
threadAutoCreateBooleanIf the bot automatically creates threads in new conversations.
welcomeMessageStringWelcome message sent by the bot when starting interactions.
botTokenStringBot token (usually masked for security).
isTokenMaskedBooleanIndicates if the botToken is hidden/masked in the response.
lastConnectedAtString/NullDate and time of the last successful connection.
lastDisconnectedAtString/NullDate and time of the last recorded disconnection.
lastConnectionErrorCodeString/NullError code of the last failed connection attempt.
lastConnectionErrorMessageString/NullDescriptive message of the connection error.
createdAtStringRecord creation date and time (ISO 8601).
updatedAtStringLast update date and time.
deletedAtString/NullLogical deletion date and time (soft delete), if any.

To access this endpoint, it is necessary to send a valid access token through the authorization header (Authorization) of the request. Additionally, the API is protected by other security measures to safeguard user data.

To access your access token, follow these steps:

  1. Log in to the ToolzzAI platform
  2. Click on “Settings”
  3. Click on “Access Token”
  4. Copy the access token

Access token page