Skip to content
BlokloDocumentation

Slack

Posting messages to Slack channels and reading channels, for example notifications about new requests or orders.

Connection type: For the app and the agent. Credentials: Bot token (Bot User OAuth Token).

How it works

The app and the agent never see the credentials. They call the Slack API through the Bloklo gateway, for example fetch("/gw/<connection id>/conversations.list"). The gateway appends the path to the address https://slack.com/api, adds an Authorization: Bearer … header with the key from the connection and the header Content-Type: application/json; charset=utf-8, and passes the service's response back to the app.

  • Reads (GET) go through at once. Writes (POST, PUT, PATCH, DELETE) go through at once only when the connection is set to Always allow; otherwise the gateway returns status 202 with an approval_id and the write waits for approval in the panel (see Agent permissions).
  • The Test button sends GET /auth.test and checks that the service accepted the credentials.

Web API: methods at /NAME.METHOD, JSON or form body. The response is HTTP 200 even on errors, so check the ok and error fields. Cursor pagination: cursor and response_metadata.next_cursor (empty = end). Bot scopes: chat:write, channels:read, channels:history, channels:join, reactions:write, users:read.email.

Before you start

  • An account with Slack with permission to create API keys or tokens.

Where to get the credentials

  1. Open the Slack apps page (api.slack.com/apps) and choose Create New App; enter a name and the workspace.
  2. Go to OAuth & Permissions and under Scopes → Bot Token Scopes add only the scopes you need: chat:write (posting), channels:read (channel list), channels:history (reading history). Private channels need groups:read and groups:history; posting to public channels without adding the bot: chat:write.public.
  3. Click Install to Workspace and approve.
  4. Copy the bot token (it starts with xoxb-) from the OAuth Tokens section of the same page.
  5. In Slack, add the bot to the channels it should read or post to (the /invite @app-name command in the channel).
Note

A bot token does not expire unless token rotation is enabled in the app (then it expires after 12 hours and this connector will not refresh it). Slack limits posting to about one message per second per channel.

Slack documentation

Connecting in Bloklo

  1. Open Connectors in the sidebar and find Slack.
  2. Click Connect and enter a connection name in Details.
  3. In Configure connection, fill in: Bot token (Bot User OAuth Token).
  4. Click Connect. Bloklo saves the credentials encrypted and sends a test request; the message shows whether the service responded.
  5. Attach the connection to a project: Attach to a project… on the connection page, or describe the task in the project chat and pick the connection the agent suggests.

Form fields

  • Bot token (Bot User OAuth Token): Starts with xoxb-. From the OAuth & Permissions page of the Slack app.
Important

Never paste credentials into the chat with the agent. Enter them only in the connection form.

Example prompts

Prompts to type in the chat of a project with the connection attached:

  • “After each new form submission, post a notification to the #requests channel.”
  • “Add a panel with the list of Slack channels and the latest messages of a chosen channel.”

API methods

The most commonly used Slack API methods. The path goes after /gw/<connection id>; parts in braces, such as {id}, are replaced with values. The gateway treats every request other than GET as a write, including queries sent with POST (such as search or GraphQL), so they need approval unless the connection is set to Always allow. The full list of methods is in the provider's documentation.

MethodPathWhat it doesIn the gateway
POST/chat.postMessagePost a message to a channelwrite (approval)
POST/chat.updateUpdate a sent messagewrite (approval)
GET/conversations.listList channelsread
GET/conversations.historyChannel message historyread
POST/conversations.joinJoin a channel as the botwrite (approval)
GET/users.lookupByEmailFind a user by emailread
POST/reactions.addAdd a reaction to a messagewrite (approval)
GET/auth.testCheck the token and workspaceread

Service limits

Limit tiers apply per method and workspace: Tier 1 at least 1 request/min, Tier 2 at least 20/min, Tier 3 at least 50/min. chat.postMessage: about 1 message per second per channel. conversations.list: Tier 2; users.lookupByEmail, conversations.history: Tier 3. Since 29 May 2025, new commercially distributed apps outside the Slack Marketplace have conversations.history and conversations.replies in Tier 1 (1 request/min, limit 15); internal and Marketplace apps keep 50+/min and 1,000. Exceeding: HTTP 429 with a Retry-After header. Pagination limit: 100–200 recommended, up to 1,000 (conversations.history up to 999; conversations.list below 1,000).

Slack API reference

Agent actions and permissions

ActionTypeWhat the agent uses it for
List channelsreadPicks the channel the app should post to.
Read messagesreadReads channel history, for example for summaries.
Send messagewritePosts a message, for example a test notification about a new request.
Upload filewriteAdds a file to a channel, for example a report.
Tip

By default, reads run without asking and writes need approval in the chat. Change this on the connector page or in Settings → Agent permissions (see Agent permissions).

Troubleshooting

The connection test shows “Invalid key” (HTTP 401)

The service did not recognise the credentials: the value is wrong, expired, revoked or was copied with a space. Create a new key at the provider and enter it on the connection page under Change credentials. Empty fields stay unchanged.

The connection test shows “Invalid key” (HTTP 403)

The credentials are rejected or lack the needed permissions, or the service only accepts requests from selected IP addresses. Check the key, extend its permissions at the provider or add the Bloklo gateway IP address (shown in Settings → Privacy & security) to the allowlist.

The test returns another HTTP code

The Test button sends the service a read request that requires valid credentials. A code other than 401 and 403 usually means a temporary problem at the service or a restriction on the account at the provider; include the error code shown with the result in a problem report.

Limits and security

  • One connection can make up to 1,000 requests per minute; the service's own limits also apply.
  • Credentials are encrypted and not shown in the browser after saving; only the names of stored fields are visible.
  • A published app works for every visitor: protect the data the connection gives access to with sign-in in the app.

Something unclear or out of date? Contact us