> ## 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 to public channel

> Send a Slack message to a public channel without joining it first.

`slack.sendMessageToPublicChannel` posts to a public channel even when the installed bot is not a member. Prefer `slack.sendMessage` when the bot already belongs to the destination because it needs only `chat:write`.

## Example

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

export default automation("Post public Slack update", () => {
  onDashboardRun({ title: "Post public Slack update" })

  slack.sendMessageToPublicChannel({
    channelId: "C01234567",
    text: "Deployment completed successfully.",
  })
})
```

## Inputs

| Input         | Type                          | Required          | Description                           |
| ------------- | ----------------------------- | ----------------- | ------------------------------------- |
| `channelId`   | `string`                      | Yes               | Stable public-channel ID.             |
| `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 legacy attachments.         |
| `unfurlLinks` | `boolean`                     | No                | Whether Slack unfurls links.          |
| `unfurlMedia` | `boolean`                     | No                | Whether Slack unfurls media.          |

## Output

Returns `conversationId`, the stable message `timestamp`, and Slack's normalized `message` object. This action requires both `chat:write` and `chat:write.public`.
