Slack

Slack Web API

Post, edit and thread messages, read history, react, look up users, upload files (v2 flow) and open modals with a bot token.

CommunicationGuided#chat#bots#messaging#block-kit#file-upload#modals

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

The Slack Web API is the HTTP interface behind Slack apps: post and edit messages, read channel history and threads, react to messages, look up users, upload files and open modals. Every method lives at https://slack.com/api/<method.name> and always answers HTTP 200 with a JSON body whose ok field tells you whether the call worked; on failure error holds a short code such as channel_not_found. This guided collection uses a bot token (xoxb-...).

Getting a bot token

  1. Open https://api.slack.com/apps and choose Create New App (from scratch or from a manifest), then pick a development workspace.
  2. Under OAuth & Permissions > Scopes > Bot Token Scopes add the scopes this collection uses: chat:write, channels:read, groups:read, channels:history, groups:history, reactions:write, users:read, files:write (add channels:join if you want the bot to join public channels itself).
  3. Click Install to Workspace and approve. Copy the Bot User OAuth Token into the botToken variable (secret).
  4. Invite the bot to a test channel (/invite @your-app) and put that channel's ID (starts with C; right-click the channel > View channel details) into channelId.
  5. For views.open, enable Interactivity & Shortcuts and add a slash command or shortcut; Slack sends a trigger_id to your request URL when someone uses it.

Docs: https://docs.slack.dev/authentication/tokens and https://docs.slack.dev/reference/scopes.

Authentication

Send the token as Authorization: Bearer xoxb-... (set once on the collection). Write methods in this collection send JSON bodies with Content-Type: application/json; charset=utf-8; read methods use query parameters. files.getUploadURLExternal only accepts form-encoded arguments, so that request uses a urlencoded body.

Base URL

https://slack.com/api. There is no sandbox host: use a free development workspace, or a Slack developer sandbox from the Slack developer program (https://api.slack.com/developer-program).

Run order

  1. auth.test to confirm the token, then conversations.list (saves the first channel into channelId if empty).
  2. chat.postMessage saves messageTs; then update, react, reply in a thread, read history and replies, and finally delete.
  3. Files: getUploadURLExternal (saves uploadUrl and fileId), upload the bytes, completeUploadExternal. The pre-request script computes the byte length of uploadText.
  4. views.open needs a fresh triggerId from a real interaction; triggers are single-use and short-lived.

Limits

Each method has a rate-limit tier (Tier 1 to Tier 4, or Special). chat.postMessage allows roughly one message per second per channel with short bursts. Over the limit you get HTTP 429 with a Retry-After header in seconds. See https://docs.slack.dev/apis/web-api/rate-limits.

Common errors

errorMeaningFix
not_authed / invalid_authNo or bad tokenCheck botToken and the Bearer header.
missing_scopeToken lacks a scopeAdd it under OAuth & Permissions and reinstall the app.
channel_not_foundWrong ID or the bot cannot see itUse the channel ID, not the name; invite the bot to private channels.
not_in_channelBot is not a member/invite the bot or call conversations.join.
ratelimited (HTTP 429)Too many callsWait for Retry-After.
expired_trigger_idTrigger too old or usedOpen the modal immediately after the interaction.

Links

  • Web API overview: https://docs.slack.dev/apis/web-api
  • Method reference: https://docs.slack.dev/reference/methods
  • Block Kit builder: https://app.slack.com/block-kit-builder

Endpoints 15

1. Start here

  • POSTauth.test: check the token/auth.testConfirms the bot token works and tells you who it is: workspace team and team_id, the bot's user_id and bot_id, and the workspace url. Run it first; an…
  • GETconversations.list: list channels/conversations.listLists conversations in the workspace. types picks what to include (public_channel, private_channel, mpim, im); private channels only appear when the bot is a…
  • POSTconversations.join: join a public channel/conversations.joinAdds the bot to the public channel in channelId so it can read history and post without being invited. Needs the channels:join scope and does not work for…

2. Messages

  • POSTchat.postMessage: post a message/chat.postMessagePosts a message to channelId. Always send text: it is the notification and screen-reader fallback even when you also send blocks. The response ts identifies…
  • POSTchat.postMessage: reply in a thread/chat.postMessagePosts a threaded reply under the message in messageTs by setting thread_ts. Add reply_broadcast: true to also show the reply in the channel. Use the parent's…
  • POSTchat.update: edit a message/chat.updateReplaces the text (and blocks, if sent) of the message identified by channel and ts. Bots can only edit their own messages; other messages fail with…
  • POSTreactions.add: react to a message/reactions.addAdds an emoji reaction to the message at timestamp in channel. name is the emoji name without colons (white_check_mark, eyes). Adding the same reaction twice…
  • POSTchat.delete: delete a message/chat.deleteDeletes the message at ts in channel. A bot token can delete only messages the bot posted. Run this last in the folder, after you have read the history and…

3. Reading history

  • GETconversations.history: read channel messages/conversations.historyReturns messages from channelId, newest first. Narrow the window with oldest and latest (Slack timestamps), set limit (200 or fewer recommended) and page with…
  • GETconversations.replies: read a thread/conversations.repliesReturns a thread: the parent message identified by ts followed by its replies, oldest first. Pass the parent ts (saved as messageTs). Supports the same limit,…
  • GETusers.info: look up a user/users.infoReturns the profile of the user in userId: names, time zone, is_bot, and profile fields. The email address is only included when the token also has…

4. Files

  • POSTfiles.getUploadURLExternal: get an upload URL/files.getUploadURLExternalStep 1. Asks Slack for a one-time upload URL for a file of length bytes named filename. The pre-request script sets uploadLength to the UTF-8 byte size of…
  • POSTUpload the file bytes to uploadUrl{{uploadUrl}}Step 2. Sends the file content to the uploadUrl from step 1 with a POST. Slack accepts raw bytes or a multipart form; this request sends uploadText as the raw…
  • POSTfiles.completeUploadExternal: finish and share/files.completeUploadExternalStep 3. Finalises the upload and shares the file in channel_id, optionally with an initial_comment or in a thread with thread_ts. files lists the uploaded IDs…

5. Modals

  • POSTviews.open: open a modal/views.openOpens a modal for the user who triggered an interaction (slash command, shortcut or button). Put the trigger_id from that interaction payload into triggerId…

API details

Base URL
https://slack.com/api
Authentication
A bearer token in the Authorization header
Operations
15 operations on 15 pathsPOST 11GET 4
Main resources
1. Start here 32. Messages 53. Reading history 34. Files 35. Modals 1
Description format
Swastik Codes guided collection, API version checked against the docs on 2026-11-18

How to test the Slack Web API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Slack Web API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “auth.test: check the token” (POST /auth.test), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Slack Web API?

Post, edit and thread messages, read history, react, look up users, upload files (v2 flow) and open modals with a bot token. It is listed under Communication and has 15 endpoints.

Who publishes the Slack Web API?

It is listed from Slack's public API description (an OpenAPI document), not published by Slack on Swastik Codes. Anyone who controls slack.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Slack Web API?

Requests go to https://slack.com/api. Endpoint paths are added to this base URL.

How do I authenticate with the Slack Web API?

With A bearer token in the Authorization header.

How many endpoints does the Slack Web API have?

15 operations on 15 paths (11 POST, 4 GET). The largest groups are 1. Start here, 2. Messages, 3. Reading history, 4. Files.

Is forking the Slack Web API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.