How to create a Discord webhook and extract Id/Token

2 September 2025, 03:29
Nguyen Tuan Son
0
4

Follow these steps to create a Discord webhook, copy the webhook URL, and extract the two pieces you’ll need (the numeric webhook ID and the webhook key/token).

I - Create the webhook

  1. Open Discord (desktop or web) and go to the server and text channel where you want alerts posted.
  2. Click the channel name → IntegrationsView WebhooksNew Webhook (or Create Webhook).
  3. Give the webhook a name (e.g., Smart Alert Manager ) and optionally set an avatar.
  4. Under Channel, confirm the target channel.
  5. Click Copy Webhook URL (or Save then Copy Webhook URL). The URL will look like: https://discordapp.com/api/webhooks/123456789012345678/AbCDefGhIjKlMnOpQrStUvWxYZ0123456789abcdefGHIjklMn

II - Extract the Webhook ID and Webhook Key (token)

From the webhook URL https://discordapp.com/api/webhooks/<WEBHOOK_ID>/<WEBHOOK_TOKEN> :

  • Webhook ID = the first path segment after /webhooks/ → e.g. 123456789012345678
  • Webhook Key / Token = the second path segment → e.g. AbCDefGhIjKlMnOpQrStUvWxYZ0123456789abcdefGHIjklMn

III - Notes / tips

  • Keep the token secret. Anyone with the token can post to the channel.
  • To revoke/regenerate the token: channel → Integrations → View Webhooks → select the webhook → click Regenerate URL or Delete and create a new one.
  • Discord webhook tokens are longer than MQL5’s single-field limit (63 chars). You may need to split the token into two parts and paste them across the two lines in order — the tool will recombine them when sending.

IV - Use with Smart Alert Manager

Copy the WEBHOOK_ID above to Webhook Id field and the WEBHOOK_TOKEN above to Webhook Key field to start receiving alert messages. Remember to split the key into 2 parts as it exceed the single-field limit (63 chars) of MQL.