Skip to main content

How to make a webhook in Discord

A Discord webhook is a channel-specific URL that lets external apps post messages to your server automatically, with no bot to write or host. You create one in a channel's integration settings, name it, choose the channel it posts to, and copy the generated URL into the service you want to receive messages from.

The steps below walk through creating a Discord webhook from the desktop app.

Receiving webhooks?
Svix Ingest is a reliable webhook receiver. It verifies signatures, absorbs delivery spikes, and gives you one endpoint for webhooks from any provider. Start receiving webhooks with Svix Ingest.
  1. First, open Discord and pick the server where you want to create your webhook.

  2. Click the arrow next to your server name in the upper left corner and choose Server Settings from the drop down menu.

    Discord server name dropdown with Server Settings highlighted
  3. In the side bar, choose Integrations, then click on Create Webhook.

    Discord Integrations settings with the Create Webhook button

  4. The Integrations > Webhooks window allows creating a new webhook.

    The new webhook window under Discord Integrations > Webhooks

  5. Choose your preferred icon and name your webhook.

    Naming a Discord webhook and choosing its icon

  6. Pick the channel you want to post to from the drop down menu.

Selecting the Discord channel the webhook will post to

  1. Your webhook is ready! Click on the Copy Webhook URL button and a webhook URL will be copied to your pasteboard. You'll need to enter this URL into the 3rd party service you're receiving messages from.

The Copy Webhook URL button in Discord webhook settings

The webhook URL has the following format, where example-hash is a unique hash that identifies your channel webhook: https://discord.com/api/webhooks/example-hash

If for any reason you would like to delete the webhook, click on the Delete Webhook button.

The Delete Webhook button in Discord webhook settings

Webhook Security

Please note that webhooks have been a common vulnerability for Discord servers. Be very careful about who has webhook permissions on your Discord server and guard the webhook URL closely. If a hacker gets your webhook URL, they will be able to post messages in your server while impersonating your team.

Send a message to your Discord webhook

Discord webhooks accept an HTTP POST with a JSON body, and the only required field is content, the message text:

curl -X POST \
-H 'Content-Type: application/json' \
--data '{"content": "Hello from your app!"}' \
https://discord.com/api/webhooks/example-hash

Discord replies with 204 No Content and the message appears in the channel you picked. Send an embeds array instead of content when you want a title, a colored sidebar, and fields rather than plain text. Each webhook accepts roughly 30 requests per minute, so an app that fires more often than that has to batch its messages or queue them behind a rate limit of its own. If you are pointing GitHub at a Discord webhook and the requests come back rejected, see webhook error 400 from GitHub to Discord.

Find an existing webhook URL

To get the URL again later, reopen Server Settings > Integrations > Webhooks, click the webhook, and use Copy Webhook URL. Discord does not display the token anywhere else, and there is no way to rotate it in place, so a URL that leaks has to be deleted and recreated.

Now that you have successfully created your first Discord webhook for a dedicated channel, you can use third-party applications to automate message posting to Discord.

You should also checkout our tutorial on how to [send webhooks with Python]https://www.svix.com/guides/sending/send-webhooks-with-python/?utm_source=resources&utm_medium=content).

Need to receive webhooks reliably?

Svix Ingest gives you one endpoint for webhooks from any provider, with signature verification and durability built in, so a redeploy or a traffic spike never drops an event.