Skip to Content
API ReferenceCommunity connections

Sync Discord roles

Read the Discord servers' roles again and check that the bot can give them.

Run this after you add, rename, or move roles in Discord. SellApp reads each server's roles again and checks whether the bot's role sits high enough to give the roles your products sell. A server reporting hierarchy: "hierarchy_issue" needs the bot's role moved higher in Discord's server settings. Members are not changed.

POST
/v2/community-connections/discord/sync-roles

Read the role list of the store's Discord servers from Discord again and check the bot's role position, which tells whether the bot can give the roles your products sell. Syncs every connected server, or only server_id. A server Discord refuses is reported on its own row with synced: false, and the others still sync; failed_count counts those rows. Nothing is given to or taken from a member, so repeating the request is safe. 422 on platform when no Discord server is connected, and on server_id when that server is not connected to this store. Requires the community API-key ability and the community permission in your team role. OAuth callers use the admin grant and select a store with X-STORE. Current membership and role permissions apply to every request.

Authorization

headerAuthorizationBearer <API Key>

Provide your SellApp API key as a bearer token.

Header Parameters

X-STORE?string

Store slug. Required for OAuth access tokens. API keys may omit it to use their current store, or the first accessible store when no current store is selected.

Request Body

application/json
  1. body
server_id?|

The Discord server to sync. Leave out or send null to sync every connected server.

Lengthlength <= 32

Response Body

Successful response.

application/json
  1. response
data*
Example Request
curl -X POST 'https://sell.app/api/v2/community-connections/discord/sync-roles' \  -H 'X-STORE: launch-lab' \  -H 'Content-Type: application/json' \  -d '{}'
{  "data": {    "platform": "discord",    "synced_servers": [      {        "id": "server_launch_lounge",        "name": "Launch Lounge",        "synced": false,        "error": "Discord refused the request. The bot may have been removed from this server or lost its permissions."      },      {        "id": "server_ship_room",        "name": "The Ship Room",        "synced": true,        "roles_synced": 6,        "hierarchy": "healthy",        "bot_can_assign": 6,        "total_roles": 6      }    ],    "failed_count": 1  }}