Skip to main content
This guide walks through authorizing requests and sending a first payload to the Application Identity Profile API. For the full API reference, see the Application Identity Profile Resource.

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:
  1. Set up an application in the Developer Portal and note your application ID (client ID)
  2. Get your bot token from the Bot section of your application dashboard
  3. Configure your widget in the Developer Portal
  4. Have the player link their Discord account to your game, requesting the application_identities.write scope. If you are building a Social SDK integration, the Social SDK scopes already include this scope.
  5. 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.
  6. 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:
Returns 201 Created on first write, 204 No Content on subsequent updates.
The data field is fully replaced on every PATCH. If you include data in your request body, the entire previous data payload is overwritten and any fields you omit are lost. Always send the complete set of data you want stored. If you omit data from the request body entirely, existing data is left untouched.
For the complete payload shape, available primary fields, dynamic field types, request limits, and error responses, see the Application Identity Profile Resource.

Reading the Profile Back

After a successful write, you can read the player’s stored profile back with the Get Application Identity Profile endpoint: