Incoming Webhooks are a simple way to post messages from external sources into Slack. They make use of normal HTTP requests with a JSON payload, which includes the message text and some options. Message Attachments can also be used in Incoming Webhooks to display richly-formatted messages that stand out from regular chat messages.
Set up an incoming webhook integration in your Slack team to try it out.
You have two options for sending data to an Incoming Webhook URL:
payload parameter in a POST requestFor a simple message, your JSON payload must contain a text property. This is the text that will be posted to the channel.
{
"text": "This is a line of text.\nAnd this is another one."
}
This will be displayed in the channel as:

To create a link in your text, enclose the URL in <> angle brackets. For example: payload={"text": "<https://slack.com>"} will post a clickable link to https://slack.com.
To display hyperlinked text instead of the actual URL, use the pipe character, as shown in this example:
{
"text": "<https://alert-system.com/alerts/1234|Click here> for details!"
}
This will be displayed in the channel as:

You can override an incoming webhook's configured name with the username parameter in your JSON payload.
You can also override the bot icon either with icon_url or icon_emoji".
{
"username": "new-bot-name",
"icon_url": "https://slack.com/img/icons/app-57.png",
"icon_emoji": ":ghost:"
}
An overridden username and icon could look like this:
![]()
Incoming webhooks have a default channel. You can override it with the channel parameter in your JSON payload.
A public channel can be specified with "channel": "#other-channel", and a Direct Message with "channel": "@username".
{
"channel": "#other-channel", // A public channel override
"channel": "@username", // A Direct Message override
}
You can use Slack's standard message markup to add simple formatting to your messages. You can also use message attachments to display richly-formatted message blocks.

Here is a sample curl command for posting to a channel:
curl -X POST --data-urlencode 'payload={"text": "This is posted to <#general> and comes from *monkey-bot*.", "channel": "#general", "username": "monkey-bot", "icon_emoji": ":monkey_face:"}' https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
This will be displayed in the #general channel as:
