On this page
What is a Slack webhook?
A Slack incoming webhook is a unique URL that Slack gives you for one channel. Send an HTTP POST to that URL with a small JSON body and Slack posts the message in that channel. You don't need an OAuth flow, an SDK or a bot token.
That makes webhooks the quickest way to get alerts into Slack from scripts, CI jobs, monitoring and contact forms. The trade-off is that a webhook only writes. It can't read messages, reply in threads by itself or switch channels. If you're new to the idea of one server calling another, our guide to web hooks covers the basics.
| Question | Incoming webhook |
|---|---|
| Direction | Into Slack only |
| Where it posts | One channel, chosen when you create it |
| Auth | The URL itself is the credential |
| Body | JSON with a text field, or Block Kit blocks |
| Success reply | HTTP 200 with the body ok |
How to create a Slack webhook
In Slack, webhooks belong to a Slack app. Creating the app takes about a minute, and you don't publish it anywhere: it lives in your own workspace.
Create the Slack app
- Open the Slack apps page and sign in to your workspace.
- Click Create New App, then choose From scratch.
- Give the app a name people will recognise in the channel, for example "Website forms", and pick the workspace.
Turn on incoming webhooks in your Slack app
- In the app's settings, open Incoming Webhooks under Features.
- Switch Activate Incoming Webhooks on.
- Scroll down and click Add New Webhook. In some workspaces the button says Add New Webhook to Workspace.
Pick the channel and copy the URL
- Choose the channel the messages should go to, then click Allow.
- Back on the Incoming Webhooks page, copy the new webhook URL from the table.
If your workspace limits app installs, an admin may have to approve the app first. Ask them to approve it, or ask an admin to create the webhook.
Slack's own incoming webhooks documentation covers the same steps and the full list of message options.
What does a webhook URL in Slack look like?
Every Slack incoming webhook URL starts with https://hooks.slack.com/services/, followed by three parts separated by slashes. The first two identify the workspace and the webhook. The last part is a long random string that works as the secret.
https://hooks.slack.com/services/TXXXXXXXX/BXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXThe X characters above are placeholders. A real URL holds real IDs and a real token, and the URL alone lets anyone post to your channel.
Slack webhook example with curl and JSON
Before you wire the URL into anything, test it from a terminal. Replace the placeholder with your URL and run:
curl -X POST \
-H 'Content-Type: application/json' \
--data '{"text":"Hello from my webhook"}' \
https://hooks.slack.com/services/TXXXXXXXX/BXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXIf it works, the terminal prints ok and the message appears in the channel under your app's name.
Plain text message JSON
The smallest valid body is a single text field. Use \n for line breaks. Slack formats the text as mrkdwn, so *bold* and <https://example.com|links> work.
{
"text": "New submission - Contact\nFrom: jane@example.com\n\nCan you send me a quote for 20 seats?"
}Block Kit message JSON
For richer layouts, send blocks. Keep a text field as well: Slack uses it for notifications and as a fallback.
{
"text": "New submission from jane@example.com",
"blocks": [
{
"type": "section",
"text": { "type": "mrkdwn", "text": "*New submission* from jane@example.com" }
},
{
"type": "section",
"text": { "type": "mrkdwn", "text": "Can you send me a quote for 20 seats?" }
}
]
}You can design and preview block layouts in Slack's Block Kit Builder.
How to keep a Slack webhook URL secret
The URL is the only credential a webhook has. Anyone who has it can post anything to your channel, including convincing phishing links. Handle it the way you would handle an API key.
- Never put it in front-end code. JavaScript in a web page, a mobile app bundle or a public form's HTML is readable by every visitor. Call the webhook from a server, or from a service that stores the URL for you.
- Keep it out of git. Load it from an environment variable or a secrets manager. Slack can revoke webhook URLs that get published in public code, so a leaked URL can suddenly stop working.
- Don't paste it in tickets or chat. Screenshots and support threads leak more URLs than attackers do.
- Rotate it if it leaks. Remove the webhook in the app's Incoming Webhooks settings, add a new one and update everything that used the old URL.
Why a browser form can't post to Slack directly
A static HTML form that sends to hooks.slack.com would have to ship the webhook URL in its page source. That's why form-to-Slack setups always need something in between that keeps the URL on a server.
Why is my Slack webhook not working?
When a request fails, Slack returns an HTTP error code with a short plain-text reason in the body. These are the ones you'll see most often:
| Response | What it means | Fix |
|---|---|---|
400 invalid_payload | The body is not valid JSON or has no message content | Validate the JSON and send a text or blocks field with the Content-Type: application/json header |
403 invalid_token | The token part of the URL is wrong or was revoked | Copy the URL again from the app settings, or create a new webhook |
403 action_prohibited | A workspace admin restricted posting to that channel | Ask an admin or pick a different channel |
404 channel_not_found | The channel was deleted or the app lost access | Create a new webhook for an existing channel |
404 no_service | The webhook was removed or the app was uninstalled | Reinstall the app and generate a new URL |
410 channel_is_archived | The target channel is archived | Unarchive it or point a new webhook at another channel |
| 429 | Too many messages in a short time | Slow down. Slack allows roughly one message per second per webhook, with short bursts |
Slack's incoming webhook error reference lists every code.
Webhooks from a Slack app always post to the channel picked at creation, and Slack ignores channel or username overrides in the JSON. To post somewhere else, create another webhook for that channel.
The JSON is usually being sent as form data or double-encoded into a string. Send the raw JSON object as the request body with the Content-Type: application/json header.
How to send form submissions to a Slack channel
If all you need is "someone filled in the form, tell the team", you don't need to host a server or set up an automation account. SendForm stores each submission and posts it to your Slack webhook from its own servers, so the URL never appears in your page. If you don't have a form yet, the contact form setup gives you one in a few minutes.
Connect a Slack app webhook to your form
- Create the Slack webhook as shown above and copy the hooks.slack.com URL.
- In the SendForm dashboard, open your form and go to the Plugins tab.
- Choose Slack, paste the webhook URL and click Connect.
- Use Send a test on the new connection. A "Test delivery" message should appear in your channel.
Slack is one of the built-in chat plugins, alongside Discord, Telegram and Mattermost, and it works on every plan. Only the Custom Webhook plugin, which sends raw JSON to any URL you choose, needs a paid plan. See pricing for what each plan includes.
What the Slack message looks like
SendForm spots the hooks.slack.com address and sends Slack's own format instead of raw JSON. Each submission becomes one readable message:
New submission - Contact
From: jane@example.com
Can you send me a quote for 20 seats?
company: Example Ltd
phone: +44 20 7946 0000
Attachments: brief.pdfThe first line names the form. Next come the sender's email, the message and every extra field as name: value. If files were uploaded, a final line lists their names.
What happens when Slack is down
- Each delivery is tried up to three times: immediately, then after 1 second, then after 3 seconds.
- Every attempt is logged on the form, so you can see the status code when something goes wrong.
- If delivery still fails after the retries, you get an in-app notification. You get at most one per form every six hours, so a broken channel can't flood you.
- Delivery runs after the visitor gets their response, so a slow Slack never delays the form.
Want the same message in several channels? Add one Slack webhook per channel to the form. Every enabled webhook gets each submission, and you can pause any of them with its toggle. The webhooks reference has the full delivery details.
Ready to see form submissions in Slack?
- Paste a hooks.slack.com URL into the form's Plugins tab
- Each submission arrives as a readable message, fields included
- Available on every plan, with retries and a delivery log
Frequently asked questions
Go to the Slack apps page, create a new app from scratch in your workspace, open Incoming Webhooks and switch it on. Click Add New Webhook, choose the channel and click Allow. Slack then shows a hooks.slack.com URL that you can copy and POST JSON messages to.
It starts with https://hooks.slack.com/services/ followed by three slash-separated parts. The first two are IDs for the workspace and the webhook, and the last is a long random token. The whole URL, including that token, is what you send requests to.
Yes. The URL is the only credential, so anyone who has it can post to your channel. Keep it out of front-end code, public repositories and support tickets. Load it from an environment variable, and if it ever leaks, remove the webhook and create a new one.
No. A webhook created by a Slack app is locked to the channel chosen when it was created, and Slack ignores channel overrides in the payload. To reach several channels, create one webhook per channel. In SendForm you can add several Slack webhooks to the same form.
Yes. Create an incoming webhook in Slack and paste its URL into your form's Plugins tab in SendForm. Each submission then posts straight to the channel as a readable message with the sender, the message and every field. This works on every plan, with no automation account or server to run.