> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# chat_post_message

> Send a message to a Slack channel, private group, or DM. Provide `text` for a plain message; set `thread_ts` to reply inside an existing thread.

<div className="tool-route"><span className="tool-row-method" data-method="POST">POST</span><code>{"https://slack.com/api/chat.postMessage"}</code></div>

```python slack_chat_post_message.py theme={null}
from charter.packs import slack

result = await slack.chat_post_message.ainvoke({"channel": ...})
```

<Note>
  Requires `chat:write`, `channels:read`, `groups:read`, `im:read`, `mpim:read`, `channels:history`, `groups:history`, `im:history`, `mpim:history`, `users:read`, `reactions:write`.
</Note>

## Body

<div className="reference-table">
  | Field                                                           | Type                                                                 | Description                                                                                                                                                                                      |
  | --------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | `channel` <span className="required" title="required">\*</span> | `string`                                                             | An encoded ID or channel name that represents a channel, private group, or IM channel to send the message to. Prefer the encoded ID (e.g. 'C123ABC456').                                         |
  | `text`                                                          | `string`                                                             | The main body text of the message. Required unless blocks or attachments are provided. Used as the fallback string for notifications when blocks are provided, so it is worth setting even then. |
  | `blocks`                                                        | `object`\[]                                                          | A JSON-based array of structured Block Kit blocks.                                                                                                                                               |
  | `attachments`                                                   | `object`\[]                                                          | A JSON-based array of structured attachments.                                                                                                                                                    |
  | `threadTs`                                                      | `string`                                                             | Provide another message's 'ts' value to make this message a reply in that thread. Avoid using a reply's ts value; use the parent's.                                                              |
  | `replyBroadcast`                                                | `boolean`                                                            | Used in conjunction with thread\_ts and indicates whether the reply should be made visible to everyone in the channel. Defaults to false.                                                        |
  | `markdownText`                                                  | `string`                                                             | Accepts message text formatted in markdown. Limit this field to 12,000 characters. Cannot be used together with blocks or text.                                                                  |
  | `mrkdwn`                                                        | `boolean`                                                            | Disable Slack markup parsing by setting to false. Defaults to true.                                                                                                                              |
  | `parse`                                                         | `string`                                                             | Change how messages are treated. Accepts 'none' or 'full'.                                                                                                                                       |
  | `linkNames`                                                     | `boolean`                                                            | Find and link user groups.                                                                                                                                                                       |
  | `unfurlLinks`                                                   | `boolean`                                                            | Pass true to enable unfurling of primarily text-based content.                                                                                                                                   |
  | `unfurlMedia`                                                   | `boolean`                                                            | Pass false to disable unfurling of media content.                                                                                                                                                |
  | `unfurlAppLinks`                                                | `boolean`                                                            | Pass true to enable unfurling of links to installed apps.                                                                                                                                        |
  | `username`                                                      | `string`                                                             | Set the bot's user name. Requires the chat:write.customize scope.                                                                                                                                |
  | `iconUrl`                                                       | `string`                                                             | URL to an image to use as the icon for this message. Requires the chat:write.customize scope.                                                                                                    |
  | `iconEmoji`                                                     | `string`                                                             | Emoji to use as the icon for this message, e.g. ':chart\_with\_upwards\_trend:'. Requires the chat:write.customize scope.                                                                        |
  | `metadata`                                                      | [MessageMetadata](/charter/charter/packs/slack/chat/objects#messagemetadata) | Application-specific metadata to attach to the message.                                                                                                                                          |
</div>
