slice icon Context Slice

Slack API Reference

Key Slack Web API methods and patterns for messaging

Authentication

All requests use OAuth Bearer token: Authorization: Bearer PLACEHOLDER_TOKEN. Pipedream handles token refresh.

Base URL: https://slack.com/api/

Core Methods

conversations.list

List channels, DMs, and group messages.

GET /conversations.list?types=public_channel,private_channel&limit=200
GET /conversations.list?types=im&limit=100  # DMs only

Response includes channels[] with id, name, is_private, is_member.

conversations.history

Fetch messages from a conversation.

GET /conversations.history?channel=C123ABC&limit=50

Returns messages[] with ts, user, text, blocks. Paginate with cursor.

chat.postMessage

Send a message to a channel or DM.

POST /chat.postMessage
Content-Type: application/json

{
  "channel": "C123ABC",
  "text": "Fallback text",
  "blocks": [...]  // Optional Block Kit
}

text is required (used for notifications and accessibility). blocks is optional for rich formatting.

users.info

Get user details by ID.

GET /users.info?user=U123ABC

Returns user.real_name, user.profile.display_name, user.profile.email.

users.list

List all workspace members.

GET /users.list?limit=200

Paginate with cursor. Filter out bots and deleted users.

Channel ID Patterns

  • C prefix: public channels
  • G prefix: private channels and multi-party DMs
  • D prefix: direct messages (1:1)
  • U prefix: user IDs

Rate Limits

Tier 2 methods (most reads): 20 requests/minute Tier 3 methods (chat.postMessage): 50 requests/minute

Respect Retry-After header on 429 responses.

Common Errors

Error Meaning
channel_not_found Invalid channel ID or no access
not_in_channel Bot/user must join first
msg_too_long Message exceeds 40k chars
invalid_blocks Block Kit JSON is malformed
restricted_action Workspace admin restrictions
                  ## Authentication

All requests use OAuth Bearer token: `Authorization: Bearer PLACEHOLDER_TOKEN`. Pipedream handles token refresh.

Base URL: `https://slack.com/api/`

## Core Methods

### conversations.list

List channels, DMs, and group messages.

```
GET /conversations.list?types=public_channel,private_channel&limit=200
GET /conversations.list?types=im&limit=100  # DMs only
```

Response includes `channels[]` with `id`, `name`, `is_private`, `is_member`.

### conversations.history

Fetch messages from a conversation.

```
GET /conversations.history?channel=C123ABC&limit=50
```

Returns `messages[]` with `ts`, `user`, `text`, `blocks`. Paginate with `cursor`.

### chat.postMessage

Send a message to a channel or DM.

```
POST /chat.postMessage
Content-Type: application/json

{
  "channel": "C123ABC",
  "text": "Fallback text",
  "blocks": [...]  // Optional Block Kit
}
```

`text` is required (used for notifications and accessibility). `blocks` is optional for rich formatting.

### users.info

Get user details by ID.

```
GET /users.info?user=U123ABC
```

Returns `user.real_name`, `user.profile.display_name`, `user.profile.email`.

### users.list

List all workspace members.

```
GET /users.list?limit=200
```

Paginate with `cursor`. Filter out bots and deleted users.

## Channel ID Patterns

- `C` prefix: public channels
- `G` prefix: private channels and multi-party DMs
- `D` prefix: direct messages (1:1)
- `U` prefix: user IDs

## Rate Limits

Tier 2 methods (most reads): 20 requests/minute
Tier 3 methods (chat.postMessage): 50 requests/minute

Respect `Retry-After` header on 429 responses.

## Common Errors

| Error               | Meaning                         |
| ------------------- | ------------------------------- |
| `channel_not_found` | Invalid channel ID or no access |
| `not_in_channel`    | Bot/user must join first        |
| `msg_too_long`      | Message exceeds 40k chars       |
| `invalid_blocks`    | Block Kit JSON is malformed     |
| `restricted_action` | Workspace admin restrictions    |