Link a Discord account
curl --request POST \
--url https://my.server.express/api/v1/user/integrations/discord \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"redirectUri": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', redirectUri: '<string>'})
};
fetch('https://my.server.express/api/v1/user/integrations/discord', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/integrations/discord"
payload = {
"code": "<string>",
"redirectUri": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"discordId": "<string>",
"discordUsername": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Integrations
Link a Discord account
Exchanges a Discord OAuth authorization code for a token, reads the Discord user and stores its id and display name on the profile. A Discord account can be linked to only one user (409 otherwise). Writes a LINK_DISCORD audit entry. A failed code exchange surfaces as 500.
POST
/
v1
/
user
/
integrations
/
discord
Link a Discord account
curl --request POST \
--url https://my.server.express/api/v1/user/integrations/discord \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"redirectUri": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', redirectUri: '<string>'})
};
fetch('https://my.server.express/api/v1/user/integrations/discord', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/integrations/discord"
payload = {
"code": "<string>",
"redirectUri": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"discordId": "<string>",
"discordUsername": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Body
application/json