Authorization
Before you can send game data for a player and write to your widget on their profile, they must link their Discord account to your game. See Account Linking on Web for the web-specific flow, but it is recommended to support an in-game flow as well. Follow these steps to set up authorization for game stats widgets:- Set up an application in the Developer Portal and note your application ID (client ID)
- Get your bot token from the Bot section of your application dashboard
- Configure your widget in the Developer Portal
- Have the player link their Discord account to your game, requesting the
application_identities.writescope. If you are building a Social SDK integration, the Social SDK scopes already include this scope. - After the player completes linking, store the mapping between their Discord user ID and your game’s player ID. The player’s profile record is created on Discord’s side the first time you call the Update Application Identity Profile endpoint for them.
- Use the bot token to call the Update Application Identity Profile endpoint for that player
IDs Used in API Calls
The profile endpoint takes three identifiers in the path:
The
provider_issued_user_id is not a Discord ID. It’s your game’s own identifier for the player, stored alongside their Discord user ID when they complete account linking.
Your bot token is passed through the Authorization header:
Sending Your First Payload
The minimal first call looks like this, set a username and a few primary fields for the player:201 Created on first write, 204 No Content on subsequent updates.
For the complete payload shape, available primary fields, dynamic field types, request limits, and error responses, see the Application Identity Profile Resource.