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

# Slack

> Workspace messaging API for sending messages, reading channel history, and managing channels.

Workspace messaging API for sending messages, reading channel history, and managing channels. Use GET with query params for read endpoints (conversations.list, conversations.history, users.list, users.lookupByEmail) — POST with a JSON body silently drops filter params on some reads. Use POST with JSON body for writes (chat.postMessage, conversations.open). External Slack Connect users are NOT in users.list — resolve them via conversations.list + conversations.history user\_profile blocks. search.messages requires the umbrella `search:read` scope (granular variants do not satisfy it).

6 example endpoints available through Lava's AI Gateway. See the [Slack API docs](https://docs.slack.dev/reference/methods/) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>This is a **catch-all provider** — any valid URL under `https://slack.com` is supported. 200+ Slack Web API methods. Construct URL as [https://slack.com/api/\&#123;method\_name\&#125](https://slack.com/api/\&#123;method_name\&#125);. See [https://api.slack.com/methods](https://api.slack.com/methods) for full reference. The endpoints below are curated examples.</Info>

## Endpoints

### Send a message to a channel

**POST** `https://slack.com/api/chat.postMessage` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://slack.com/api/chat.postMessage', { body: {"channel":"C01234567","text":"Hello from Lava!"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fslack.com%2Fapi%2Fchat.postMessage" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"channel":"C01234567","text":"Hello from Lava!"}'
    ```
  </Tab>
</Tabs>

### Get channel message history. GET with query params — passing filters in a JSON POST body is silently ignored by Slack for some read endpoints.

**GET** `https://slack.com/api/conversations.history?channel=C01234567&limit=10` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://slack.com/api/conversations.history?channel=C01234567&limit=10', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fslack.com%2Fapi%2Fconversations.history%3Fchannel%3DC01234567%26limit%3D10" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List channels in workspace. GET with query params — POST with `types` in a JSON body is silently dropped and returns public channels regardless of the filter. Use types=im,mpim for DMs and group DMs, public\_channel for public channels, private\_channel for private.

**GET** `https://slack.com/api/conversations.list?types=public_channel&limit=100` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://slack.com/api/conversations.list?types=public_channel&limit=100', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fslack.com%2Fapi%2Fconversations.list%3Ftypes%3Dpublic_channel%26limit%3D100" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Open or resume a DM channel with a user. Required before chat.postMessage for DMs — pass the returned channel ID to chat.postMessage. Works even if the DM is already open (`already_open: true` is normal).

**POST** `https://slack.com/api/conversations.open` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://slack.com/api/conversations.open', { body: {"users":"U01234567"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fslack.com%2Fapi%2Fconversations.open" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"users":"U01234567"}'
    ```
  </Tab>
</Tabs>

### List users in the workspace. Internal members only — external Slack Connect users do NOT appear here. Resolve external users via conversations.list + conversations.history user\_profile blocks.

**GET** `https://slack.com/api/users.list` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://slack.com/api/users.list', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fslack.com%2Fapi%2Fusers.list" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Find a user by email. Confirm the exact email domain with the caller before using — corporate TLDs are often non-standard (e.g. .capital, .vc). GET with email as a query param.

**GET** `https://slack.com/api/users.lookupByEmail?email=user@example.com` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://slack.com/api/users.lookupByEmail?email=user@example.com', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fslack.com%2Fapi%2Fusers.lookupByEmail%3Femail%3Duser%40example.com" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
