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

# Slack

> Integration details and setup guide for the Slack connector in Alloy Automation.

## Pre-Built Tooling

| Category                            | Details                                                            |
| ----------------------------------- | ------------------------------------------------------------------ |
| **Authentication**                  | OAuth 2.0 (Bot tokens and User tokens)                             |
| **Two-Way Sync**                    | Yes                                                                |
| **Events Supported**                | Yes (via Events API)                                               |
| **Realtime**                        | Yes (via Events API and Socket Mode)                               |
| **Supports Rate Limiting**          | Yes (Tier-based rate limits)                                       |
| **Authentication Scopes Supported** | Extensive bot and user scopes (channels, chat, users, files, etc.) |

***

## Objects Supported

Alloy Automation supports syncing the following objects from **Slack**:

* **Messages** - Channel and DM messages
* **Channels** - Public and private channels
* **Users** - Workspace members
* **Files** - Uploaded files and attachments
* **Reactions** - Message reactions/emojis
* **Threads** - Threaded conversations

***

## Set Up Guide

### Trial Access

| Question                                           | Answer                                                                                                                                    |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Offers free trial?**                             | Yes. Slack offers a free tier with unlimited messages (90-day history) for small teams. [Get started free](https://slack.com/get-started) |
| **Requires paid sandbox**                          | No. Free workspaces can be used for development.                                                                                          |
| **Requires partnership to obtain authentication?** | No. Anyone can create a Slack app and workspace.                                                                                          |

***

### Authentication (OAuth 2.0)

For customers who want to completely whitelabel their OAuth experience, you can provide your own developer keys instead of using Alloy Automation's.

<step>
  ## Step 1: Create a Slack Workspace (if needed)

  1. Visit **Slack** ([https://slack.com/](https://slack.com/))
  2. Click **Get Started** and create a new workspace
  3. Follow the setup wizard to configure your workspace
  4. Invite team members or use it as a development workspace
</step>

<step>
  ## Step 2: Create a Slack App

  1. Visit **Slack API** ([https://api.slack.com/apps](https://api.slack.com/apps))
  2. Click **Create New App**
  3. Choose **From scratch**
  4. Enter your app name (e.g., "Alloy Integration")
  5. Select the workspace where you want to develop the app
  6. Click **Create App**
</step>

<step>
  ## Step 3: Configure OAuth & Permissions

  1. In your app settings, navigate to **OAuth & Permissions**
  2. Scroll to **Redirect URLs**
  3. Click **Add New Redirect URL**
  4. Enter: `https://api.runalloy.com/api/strategy/connector/slack/callback`
  5. Click **Add** and **Save URLs**
  6. Scroll to **Scopes** and add Bot Token Scopes:
     * `channels:read` - View basic channel info
     * `channels:history` - View messages in public channels
     * `chat:write` - Post messages
     * `users:read` - View people in workspace
     * Add additional scopes based on your integration needs
</step>

<step>
  ## Step 4: Install App to Workspace

  1. Scroll to the top of **OAuth & Permissions**
  2. Click **Install to Workspace**
  3. Review the permissions and click **Allow**
  4. Copy the **Bot User OAuth Token** (starts with `xoxb-`)
  5. Optionally copy the **User OAuth Token** if using user scopes
</step>

<step>
  ## Step 5: Retrieve App Credentials

  1. Navigate to **Basic Information** in your app settings
  2. Scroll to **App Credentials**
  3. Copy:
     * **Client ID**
     * **Client Secret**
     * **Signing Secret** (for webhook verification)
  4. Store these securely
</step>

<step>
  ## Step 6: Connect to Alloy Automation

  1. In Alloy Automation, configure your Slack connector
  2. Provide your **Client ID** and **Client Secret**
  3. Initiate the OAuth flow
  4. Authorize the app for your workspace
  5. Alloy Automation will receive the OAuth tokens
</step>

***

## Use Cases

### 1) Automated notifications and alerts

Send automated notifications to Slack channels when important events occur in connected systems (e.g., new orders, support tickets, system alerts, or workflow completions).

### 2) Bi-directional workflow automation

Trigger workflows in external systems based on Slack events (message posted, reaction added, channel created) and post results back to Slack channels.

### 3) Customer support integration

Connect Slack with customer support platforms to enable team collaboration on support tickets, notify teams of urgent issues, or sync conversation threads.

### 4) Incident management

Integrate Slack with monitoring and incident management tools to create incident channels, post updates, and coordinate response efforts directly in Slack.

### 5) Approval workflows

Build approval workflows where requests posted to Slack channels can be approved/rejected via reactions or thread responses, triggering downstream actions in connected systems.

***

## API Gotchas

* **Rate Limiting Tiers:** Slack uses tier-based rate limiting with different limits per method. Most methods allow 1+ requests per second. Respect the `Retry-After` header in 429 responses and implement exponential backoff.

* **Token Types Matter:** Bot tokens (`xoxb-`) and user tokens (`xoxp-`) have different capabilities and scopes. Bot tokens are recommended for most integrations as they're tied to the app, not a specific user.

* **Message Formatting:** Slack uses mrkdwn (a Markdown variant) for formatting. Use Block Kit for rich message layouts with buttons, images, and structured content. Plain text and mrkdwn have different escaping rules.

* **Pagination with Cursors:** Slack APIs use cursor-based pagination. The `response_metadata.next_cursor` field contains the cursor for the next page. An empty cursor means you've reached the end.

* **Webhook Signature Verification:** Always verify webhook signatures using the `X-Slack-Signature` header and your app's signing secret. This prevents spoofed webhook events.

* **Socket Mode for Development:** For local development without public webhooks, use Socket Mode. This establishes a WebSocket connection to receive events without exposing a public endpoint.

> For questions or troubleshooting, contact **[support@runalloy.com](mailto:support@runalloy.com)**.
