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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Send message

> Send a text, Block Kit, or legacy attachment message to Slack.

`sendMessage` posts a top-level message to a channel or direct conversation.
Provide text, Block Kit `blocks`, legacy `attachments`, or a combination.

## Example

```ts automations/post-slack-update.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { sendMessage } from "automate.ax/slack"

export default automation("Post Slack update", () => {
  onHttpRequest({ scope: "automation" })

  sendMessage({
    conversation: "C01234567",
    text: "Deployment completed successfully.",
    blocks: [
      {
        type: "section",
        text: {
          type: "mrkdwn",
          text: "*Deployment completed* :white_check_mark:",
        },
      },
    ],
    unfurlLinks: false,
  })
})
```

## Inputs

| Input          | Type                                             | Required          | Default         | Description                                                              |
| -------------- | ------------------------------------------------ | ----------------- | --------------- | ------------------------------------------------------------------------ |
| `conversation` | `string`                                         | One destination   | —               | Conversation ID or accepted Slack destination; a leading `#` is removed. |
| `channel`      | `string`                                         | One destination   | —               | Alias for `conversation`. If both are present, they must match.          |
| `text`         | `string`                                         | One content field | —               | Plain text or accessibility fallback.                                    |
| `blocks`       | `Record<string, JsonValue>[]`                    | One content field | —               | Up to 50 Block Kit blocks.                                               |
| `attachments`  | `Record<string, JsonValue>[]`                    | One content field | —               | Up to 100 provider-native legacy attachments.                            |
| `unfurlLinks`  | `boolean`                                        | No                | Slack default   | Whether Slack parses and unfurls links.                                  |
| `unfurlMedia`  | `boolean`                                        | No                | Slack default   | Whether Slack unfurls media.                                             |
| `account`      | `string \| IntegrationAccountReference<"slack">` | No                | Project default | Slack workspace binding.                                                 |

## Output

Returns `conversationId`, the stable message `timestamp`, and a normalized
`message` containing Slack's text, content, author, thread, reaction, and file
metadata. Keep both identifiers for updates, deletion, reactions, or replies.

The bot needs access to the destination. Supplying `text` alongside blocks gives
notifications and assistive technology a useful fallback.
