Skip to content

Reference

Discord

Connect Discord to Alter Vault for secure API access

Use Discord credentials to make authenticated API calls through Alter Vault without exposing API keys in code.

PropertyValue
Provider IDdiscord
CategoryCommunication
Credential TypeBot Token

Log in to the Discord Developer Portal

Select the application

Select the application (or create a new one).

Go to the Bot section

Go to the Bot section in the left sidebar.

Reset Token

Click ‘Reset Token’ to generate a new bot token (this will invalidate any previously issued token).

Copy the bot token

Copy the bot token.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add Discord

Go to Managed Secrets > Add Provider > Discord.

Enter credentials

Paste your Bot Token into the credential field.

Save

Click Save. You’ll receive a grant_id to use with the SDK.

response = await alter_app.request(
HttpMethod.POST,
"https://discord.com/api/v10/channels/YOUR_CHANNEL_ID/messages",
grant_id="YOUR_GRANT_ID",
json={"content": "Hello from Alter"},
)

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider path
create_messagesendPOST/channels/{channel_id}/messages
execute_webhooksendPOST/webhooks/{webhook_id}/{webhook_token}
execute_slack_compatible_webhooksendPOST/webhooks/{webhook_id}/{webhook_token}/slack
execute_github_compatible_webhooksendPOST/webhooks/{webhook_id}/{webhook_token}/github
crosspost_messagesendPOST/channels/{channel_id}/messages/{message_id}/crosspost
list_messagesreadGET/channels/{channel_id}/messages
get_messagereadGET/channels/{channel_id}/messages/{message_id}
update_messagewritePATCH/channels/{channel_id}/messages/{message_id}
delete_messagedeleteDELETE/channels/{channel_id}/messages/{message_id}
bulk_delete_messagesdeletePOST/channels/{channel_id}/messages/bulk-delete
create_dmwritePOST/users/@me/channels
get_channelreadGET/channels/{channel_id}
update_channeladminPATCH/channels/{channel_id}
delete_channeldeleteDELETE/channels/{channel_id}
create_channel_invitewritePOST/channels/{channel_id}/invites
invite_revokeadmin, deleteDELETE/invites/{code}
create_webhookadminPOST/channels/{channel_id}/webhooks
list_channel_webhooksreadGET/channels/{channel_id}/webhooks
get_webhookreadGET/webhooks/{webhook_id}
update_webhookadminPATCH/webhooks/{webhook_id}
delete_webhookadmin, deleteDELETE/webhooks/{webhook_id}
get_guildreadGET/guilds/{guild_id}
update_guildadminPATCH/guilds/{guild_id}
list_guild_membersreadGET/guilds/{guild_id}/members
get_guild_memberreadGET/guilds/{guild_id}/members/{user_id}
delete_guild_memberadminDELETE/guilds/{guild_id}/members/{user_id}
ban_user_from_guildadminPUT/guilds/{guild_id}/bans/{user_id}
unban_user_from_guildadminDELETE/guilds/{guild_id}/bans/{user_id}
bulk_ban_users_from_guildadminPOST/guilds/{guild_id}/bulk-ban
create_guild_roleadminPOST/guilds/{guild_id}/roles
delete_guild_roleadmin, deleteDELETE/guilds/{guild_id}/roles/{role_id}
add_guild_member_roleadminPUT/guilds/{guild_id}/members/{user_id}/roles/{role_id}
delete_guild_member_roleadminDELETE/guilds/{guild_id}/members/{user_id}/roles/{role_id}
get_my_userreadGET/users/@me
update_my_userwritePATCH/users/@me
list_my_guildsreadGET/users/@me/guilds
leave_guildadminDELETE/users/@me/guilds/{guild_id}

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.