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

# Slack Actions integration

[Back to list of integrations](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems.md)

Use the Slack integration to let agents send and manage messages, request approvals or actions, manage channels and files, and look up users through Action Tools.

| Authentication | Actions | Workflow triggers |
| - | - | - |
| OAuth 2.0 | [26](#supported-actions) | [13](#workflow-triggers) |

## Supported actions

Actions are Slack operations that an agent runs as Action Tools during a conversation. You can also run them from an [Integration node](https://koreai.mintlify.site/agent-platform/workflows.md#integration-node) in a workflow.

| Group | Actions |
| - | - |
| Messaging | [Send Message To A Channel](#send-message-to-a-channel), [Send Message To A User](#send-message-to-a-user), [Update message](#update-message), [Delete Message](#delete-message), [Add Reaction to Message](#add-reaction-to-message), [Markdown to Slack format](#markdown-to-slack-format) |
| Human in the loop | [Request Approval in a Channel](#request-approval-in-a-channel), [Request Approval from A User](#request-approval-from-a-user), [Request Action in A Channel](#request-action-in-a-channel), [Request Action from A User](#request-action-from-a-user) |
| Read and search | [Get Message by Timestamp](#get-message-by-timestamp), [Retrieve Thread Messages](#retrieve-thread-messages), [Get channel history](#get-channel-history), [Search messages](#search-messages) |
| Channels | [Create Channel](#create-channel), [Set Channel Topic](#set-channel-topic), [Invite User to Channel](#invite-user-to-channel) |
| Files | [Upload file](#upload-file), [Get File](#get-file) |
| Users | [Find User by Email](#find-user-by-email), [Find User by Handle](#find-user-by-handle), [Find User by ID](#find-user-by-id), [List users](#list-users), [Update Profile](#update-profile), [Set User Status](#set-user-status) |
| Advanced | [Custom API Call](#custom-api-call) |

## Workflow triggers

Triggers are Slack events that start a workflow automatically. Select them as [app triggers](https://koreai.mintlify.site/agent-platform/workflows.md#app-triggers) when you configure a workflow.

| Trigger | Fires when |
| - | - |
| New Public Message Posted Anywhere | A message is posted to any public channel. |
| New Message Posted to Channel | A message is posted to a channel you choose. |
| New Direct Message | A message is posted in a direct message. |
| New Mention in Channel | A user name is mentioned in a channel. |
| New Mention in Direct Message | A user name is mentioned in a direct message. |
| New Reaction | A reaction is added to a message. |
| Channel created | A channel is created. |
| New Command in Channel | A command is sent to the bot in a channel, for example `@bot command arg1 arg2`. |
| New Command in Direct Message | A command is sent to the bot in a direct message. |
| New User | A user is created or first joins the workspace. |
| New Saved Message | You save a message. |
| New Team Custom Emoji | A custom emoji is added to the workspace. |
| New Modal Interaction | A user interacts with a modal. |

## Set up the integration

**1. Configure the Slack app**

[Create a Slack app](https://api.slack.com/apps). On **OAuth & Permissions**, add the Artemis **Callback URL** to **Redirect URLs** and the scopes listed in the next step. Copy the **Client ID** and **Client Secret** from **Basic Information**. Invite the app to every channel the agent uses (`/invite @<app name>`).

**2. Create the auth profile**

In **Integrations**, select **Slack** > **Connect**. On **Project Auth Profiles**, select **New Profile** > **Integration Profile** > **Slack** > **Continue**. Enter the **Client ID** and **Client Secret**, select **Create Profile**, and then select **Authorize**. Artemis pre-fills the Slack endpoints and scopes.

**Usage Mode**: **Preconfigured** shares one authorization across users; **JIT** and **Preflight** ask each user to authorize, during or before the session. See [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles).

> [accordion] Pre-filled scopes
>
> `channels:read`, `channels:manage`, `channels:history`, `channels:write.invites`, `chat:write`, `chat:write.customize`, `groups:read`, `groups:write`, `groups:history`, `groups:write.invites`, `im:read`, `im:write`, `im:history`, `mpim:read`, `mpim:write`, `mpim:history`, `reactions:read`, `reactions:write`, `users:read`, `users:read.email`, `users.profile:read`, `usergroups:read`, `files:read`, `files:write`, `links:read`, `links:write`, `emoji:read`

**3. Create the action tool**

In **Tools**, select **New Tool** > **Action** > **Slack** > **Continue**. Select the **Action** and **Auth Profile**, set parameter defaults (leave a value empty for the agent to supply at runtime), and select **Create Tool**. Then [assign the tool to an agent](https://koreai.mintlify.site/agent-platform/tools/actions.md#assign-an-action-to-an-agent).

## Action reference

Message timestamps (`ts`, `threadTs`) identify messages in Slack. Get them from a send action's output, from **Get channel history**, or from a message's **Copy link** URL.

### Messaging

> [accordion] Send Message To A Channel
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `text` | string | Message. |
> | `sendAsBot` | boolean | Posts as the bot. Default: `True`. |
> | `threadTs` | string | Parent message timestamp, to reply in a thread. |
> | `username` | string | Bot display name. |
> | `profilePicture` | string | Bot profile picture URL. |
> | `iconEmoji` | string | Bot icon emoji. |
> | `file` | string | File to attach. |
> | `replyBroadcast` | boolean | Also posts a thread reply to the channel. Default: `False`. |
> | `mentionOriginFlow` | boolean | Adds a mention of the originating flow at the end of the message. Default: `False`. |
> | `unfurlLinks` | boolean | Expands link previews. Default: `True`. |
> | `blocks` | object | Block Kit layout. See [Block Kit](https://api.slack.com/block-kit). |

> [accordion] Send Message To A User
>
> | Parameter | Type | Description |
> | - | - | - |
> | `userId` | enum | User. |
> | `text` | string | Message. |
> | `username` | string | Bot display name. |
> | `profilePicture` | string | Bot profile picture URL. |
> | `iconEmoji` | string | Bot icon emoji. |
> | `mentionOriginFlow` | boolean | Adds a mention of the originating flow. Default: `False`. |
> | `blocks` | object | Block Kit layout. |
> | `unfurlLinks` | boolean | Expands link previews. Default: `True`. |

> [accordion] Update message
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `ts` | string | Timestamp of the message to update. |
> | `text` | string | Updated text. |
> | `mentionOriginFlow` | boolean | Adds a mention of the originating flow. Default: `False`. |
> | `blocks` | object | Block Kit layout. |

> [accordion] Delete Message
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `ts` | string | Timestamp of the message to delete. |

> [accordion] Add Reaction to Message
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `ts` | string | Timestamp of the message. |
> | `reaction` | string | Emoji name without colons, for example `thumbsup`. |

> [accordion] Markdown to Slack format
>
> Converts Markdown to Slack's mrkdwn syntax. Use it before a send action when the agent produces Markdown.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `markdown` | string | Markdown text. |

### Human in the loop

These actions post a message and pause the tool until a user responds.

> [accordion] Request Approval in a Channel
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `text` | string | Approval request text. |
> | `username` | string | Bot display name. |
> | `profilePicture` | string | Bot profile picture URL. |
> | `mentionOriginFlow` | boolean | Adds a mention of the originating flow. Default: `False`. |

> [accordion] Request Approval from A User
>
> | Parameter | Type | Description |
> | - | - | - |
> | `userId` | enum | Approver. |
> | `text` | string | Approval request text. |
> | `username` | string | Bot display name. |
> | `profilePicture` | string | Bot profile picture URL. |
> | `mentionOriginFlow` | boolean | Adds a mention of the originating flow. Default: `False`. |

> [accordion] Request Action in A Channel
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `text` | string | Message. |
> | `actions` | array | Action buttons the user can select. |
> | `threadTs` | string | Parent message timestamp, to post in a thread. |
> | `username` | string | Bot display name. |
> | `profilePicture` | string | Bot profile picture URL. |
> | `mentionOriginFlow` | boolean | Adds a mention of the originating flow. Default: `False`. |

> [accordion] Request Action from A User
>
> | Parameter | Type | Description |
> | - | - | - |
> | `userId` | enum | User. |
> | `text` | string | Message. |
> | `actions` | array | Action buttons the user can select. |
> | `username` | string | Bot display name. |
> | `profilePicture` | string | Bot profile picture URL. |
> | `mentionOriginFlow` | boolean | Adds a mention of the originating flow. Default: `False`. |

### Read and search

> [accordion] Get Message by Timestamp
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `ts` | string | Timestamp of the message. |

> [accordion] Retrieve Thread Messages
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `threadTs` | string | Timestamp of the parent message. |

> [accordion] Get channel history
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `oldest` | number | Start of the time range, as a Unix timestamp. |
> | `latest` | number | End of the time range, as a Unix timestamp. |
> | `inclusive` | boolean | Includes messages at the `oldest` and `latest` timestamps. Default: `False`. |
> | `includeAllMetadata` | boolean | Returns all message metadata. Default: `False`. |

> [accordion] Search messages
>
> | Parameter | Type | Description |
> | - | - | - |
> | `query` | string | Slack search query, for example `invoice in:#finance`. |

### Channels

> [accordion] Create Channel
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channelName` | string | Channel name. |
> | `isPrivate` | boolean | Creates a private channel. Default: `False`. |

> [accordion] Set Channel Topic
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `topic` | string | Topic text. |

> [accordion] Invite User to Channel
>
> | Parameter | Type | Description |
> | - | - | - |
> | `channel` | enum | Channel. |
> | `userId` | enum | User to invite. |

### Files

> [accordion] Upload file
>
> Uploads a file without sharing it, unless you set `channel`.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `file` | string | File to upload. |
> | `title` | string | File title. |
> | `filename` | string | File name. |
> | `channel` | enum | Optional. Channel to share the file in. |

> [accordion] Get File
>
> | Parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | File ID. |

### Users

> [accordion] Find User by Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `email` | string | Email address. |

> [accordion] Find User by Handle
>
> | Parameter | Type | Description |
> | - | - | - |
> | `handle` | string | Slack handle. |

> [accordion] Find User by ID
>
> | Parameter | Type | Description |
> | - | - | - |
> | `id` | string | Slack user ID. |

> [accordion] List users
>
> | Parameter | Type | Description |
> | - | - | - |
> | `includeBots` | boolean | Includes bot users. Default: `False`. |
> | `includeDisabled` | boolean | Includes deactivated users. Default: `False`. |

> [accordion] Update Profile
>
> | Parameter | Type | Description |
> | - | - | - |
> | `firstName` | string | First name. |
> | `lastName` | string | Last name. |
> | `email` | string | Email address. |
> | `userId` | string | User to update. |

> [accordion] Set User Status
>
> | Parameter | Type | Description |
> | - | - | - |
> | `text` | string | Status text. |
> | `emoji` | string | Status emoji, for example `:palm_tree:`. |
> | `expiration` | number | Expiry time, as a Unix timestamp. |

### Advanced

> [accordion] Custom API Call
>
> Sends a request to any Slack Web API method. Artemis injects the authorization header from the auth profile.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `url` | object | Endpoint URL. |
> | `method` | enum | HTTP method. |
> | `headers` | object | Additional request headers. |
> | `queryParams` | object | Query parameters. |
> | `body_type` | enum | Body type. Default: `None`. |
> | `body` | object | Request body. |
> | `response_is_binary` | boolean | Turn on for binary responses, such as PDFs or images. Default: `False`. |
> | `failsafe` | boolean | Returns no error when the call fails. |
> | `timeout` | number | Timeout, in seconds. |
> | `followRedirects` | boolean | Follows HTTP redirects. Default: `False`. |

## Troubleshoot common issues

| Issue | Resolution |
| - | - |
| `bad_redirect_uri` during authorization | Add the exact **Callback URL** to **Redirect URLs** in the Slack app. |
| `not_in_channel` or `channel_not_found` | Invite the app to the channel with `/invite @<app name>`. |
| `missing_scope` | Add the scope to the Slack app, reinstall the app, and then authorize the profile again. |
| `message_not_found` | Confirm the `ts` value and the channel. Timestamps are unique only within a channel. |
| Messages show raw Markdown | Run the text through **Markdown to Slack format** before sending. |
| Channel or user dropdowns are empty | Confirm the profile is **Active** and includes `channels:read`, `groups:read`, and `users:read`. |

**Related articles:**

* [Enterprise systems integrations](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems.md)
* [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles)
* [Action Tools](https://koreai.mintlify.site/agent-platform/tools/actions.md)
* [Integration node](https://koreai.mintlify.site/agent-platform/workflows.md#integration-node)
* [Slack Web API](https://api.slack.com/web)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.