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 onlyResponse includes channels[] with id, name, is_private, is_member.
conversations.history
Fetch messages from a conversation.
GET /conversations.history?channel=C123ABC&limit=50Returns 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=U123ABCReturns user.real_name, user.profile.display_name, user.profile.email.
users.list
List all workspace members.
GET /users.list?limit=200Paginate with cursor. Filter out bots and deleted users.
File Upload
Upload files using Send to Slack with a
filePath argument. The code handles the 3-step upload process automatically.
Supported File Types
Slack accepts all file types and automatically detects format:
- Images: jpg, png, gif, svg, webp, bmp, tiff
- Documents: pdf, doc, docx, xls, xlsx, ppt, pptx
- Text/Code: txt, md, csv, json, xml, html, js, ts, py
- Archives: zip, rar, tar, gz, 7z
- Audio: mp3, wav, ogg, m4a
- Video: mp4, mov, avi, wmv, webm, mkv
Upload API Methods
The upload uses Slack's 3-step external upload process:
- Get upload URL -
files.getUploadURLExternalwith filename and size - Upload contents - POST file binary to the returned URL
- Complete upload -
files.completeUploadExternalto share to channel
Slack scans files for malware before making them available. Large files may take longer to appear.
Channel ID Patterns
Cprefix: public channelsGprefix: private channels and multi-party DMsDprefix: direct messages (1:1)Uprefix: 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 |
missing_scope |
App needs additional permissions (e.g., files:write) |