Skip to main content

Setup

Put them in your environment or .env; Data APIs covers the other ways.

Notes

  • Slack answers HTTP 200 even on failure: check the ok field, and read error when it is false (not_in_channel, missing_scope, channel_not_found…).
  • A bot only reads channels it is a member of, and only with the scopes the app was granted; the error names the missing scope.
  • Ids, not names: channels are C…, users U… Message ts values are strings like 1700000000.000100 and identify a message.
  • Lists page by cursor: pass response_metadata.next_cursor back as cursor. Set limit; Slack recommends at most 200.
  • Rate limits are per method (tiers 1 to 4, about 1 to 100 or more calls a minute); a 429 carries Retry-After.

Endpoints

List channels

  • Tier 2 rate limit.

Get a channel

Read channel messages

  • Replies inside threads are not included: use slack.conversations.replies.

Read a thread

List workspace members

  • Emails appear only with the users:read.email scope.

Get one user

Search messages

  • Needs a USER token with search:read; a bot token is refused. Slack lists this method as legacy in favour of its Real-time Search API.