Unified.to
All articles

How to get your Discord OAuth 2 credentials and bot token


May 21, 2024

Last updated: May 2026

This guide explains how to register your application with Discord and obtain your OAuth 2 credentials and bot token. You'll need these credentials to activate the Discord integration and access Discord via Unified.to's unified API.

Register your application in Discord

  1. Sign into Discord and navigate to the Developer Portal.
    discord_1.png
  2. Click New Application at the top right of the page.
  3. In the Create an application window:
    • Enter a name for your application
    • Check the box to agree to Discord's terms of service and developer policy
    • Click Create

discord_2.png

Discord will create a new application and take you to the General Information tab for your application's page. Think of this application as the container for both your OAuth 2 credentials and your bot user.

Get your Discord OAuth 2 credentials

Once your application is registered, you can obtain its OAuth 2 credentials. These authenticate your app and let it access the Discord API through Unified.to.

  1. On your application's page, select the OAuth2 tab from the left sidebar.
  2. Under Client Information, make note of your Client ID and Client Secret — you'll need these later.
  3. Under Redirects, click Add Redirect.
  4. Enter https://api.unified.to/oauth/code as the redirect URL. (If your workspace is hosted in the EU or AU region, use the corresponding regional redirect URL.)
  5. Click Save Changes at the bottom of the page.

discord_4.png

Keep these private. Never commit your Client Secret or Bot Token to source control, share them in screenshots, or include them in client-side code. Store them in environment variables or a secrets manager.

Retrieve your Discord bot token

The Discord integration also requires a Bot Token to access the Discord API.

  1. Select Bot from the left sidebar.
  2. Under Build-A-Bot > Token, copy the Bot Token.
  3. If no token is shown (for a new bot), click Reset Token to generate one, confirm in the dialog, and copy the new token that appears.

Note: Resetting the token invalidates the previous one. If a bot is already running in production with the existing token, resetting will break those connections until you update them. You also won't be able to view a token again after it's generated, so store it securely right away.

Untitled.png

Configure bot permissions and intents

Enable the permissions and privileged gateway intents that match the data your integration accesses. Enable only what you need — Unified.to maps each capability to the minimum required access. The Discord integration supports messages and channels (via the Messaging API) and members (via the HRIS API):

  • To list channels (Messaging Channel list/get): no privileged intent is required. The bot needs the standard View Channels permission in the server.
  • To read or write messages (Messaging Message list/create/update/get/remove): enable Message Content Intent under Privileged Gateway Intents. Note that Message Content Intent is gated by Discord and may require verification once your bot is in a larger number of servers.
    Untitled.png
  • To read members (HRIS Employee list/get, which maps Discord guild members to the unified employee object — a Unified.to abstraction, not a Discord-native concept): enable Server Members Intent under Privileged Gateway Intents. (Discord's documentation refers to this as the Guild Members Intent; the developer portal UI labels it "Server Members Intent.")

After enabling the intents you need, click Save Changes at the bottom of the page. Granting intents or permissions you don't use increases risk and can complicate Discord's review process once your bot reaches a larger number of servers.

Activate Discord in Unified.to

  1. Navigate to Integrations in Unified.to.
  2. Find and click on the Discord integration card.
  3. On the integration details page, select Your OAuth 2 credentials, then enter your:
    • Discord Client ID
    • Discord Client Secret
    • Discord Bot Token
  4. Click Activate to save your changes and enable the Discord integration.

discord_7.png

You can now use the Unified API to build new experiences with Discord.

Start your 30-day free trial

Book a demo

All articles