slice icon Context Slice

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.

File Upload

Upload files using codeSend 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:

  1. Get upload URL - files.getUploadURLExternal with filename and size
  2. Upload contents - POST file binary to the returned URL
  3. Complete upload - files.completeUploadExternal to share to channel

Slack scans files for malware before making them available. Large files may take longer to appear.

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
missing_scope App needs additional permissions (e.g., files:write)