provider chat POST /chat.postMessage
@utdk/slack /chat.postMessage
chat_postMessage
Sends a message to a channel.
token header required
Authentication token. Requires scope: `chat:write`
string

Try it

Authentication
Configure credentials for Slack Web API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

chatPostmessage
POST/chat.postMessage
Sends a message to a channel.

Input

Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.

A JSON-based array of structured attachments, presented as a URL-encoded string.

A JSON-based array of structured blocks, presented as a URL-encoded string.

required

Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.

Emoji to use as the icon for this message. Overrides `icon_url`. Must be used in conjunction with `as_user` set to `false`, otherwise ignored. See [authorship](#authorship) below.

URL to an image to use as the icon for this message. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below.

Find and link channel names and usernames.

Disable Slack markup parsing by setting to `false`. Enabled by default.

Change how messages are treated. Defaults to `none`. See [below](#formatting).

Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.

How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.

Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.

Pass true to enable unfurling of primarily text-based content.

Pass false to disable unfurling of media content.

Set your bot's user name. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import slack from '@utdk/slack';

await slack.chatPostmessage()