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_idand the write waits for approval in the panel (see Agent permissions). - The Test button sends
GET /auth.testand 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
- Open the Slack apps page (
api.slack.com/apps) and choose Create New App; enter a name and the workspace. - 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 needgroups:readandgroups:history; posting to public channels without adding the bot:chat:write.public. - Click Install to Workspace and approve.
- Copy the bot token (it starts with
xoxb-) from the OAuth Tokens section of the same page. - In Slack, add the bot to the channels it should read or post to (the
/invite @app-namecommand in the channel).
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.
Connecting in Bloklo
- Open Connectors in the sidebar and find Slack.
- Click Connect and enter a connection name in Details.
- In Configure connection, fill in: Bot token (Bot User OAuth Token).
- Click Connect. Bloklo saves the credentials encrypted and sends a test request; the message shows whether the service responded.
- 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.
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.
| Method | Path | What it does | In the gateway |
|---|---|---|---|
POST | /chat.postMessage | Post a message to a channel | write (approval) |
POST | /chat.update | Update a sent message | write (approval) |
GET | /conversations.list | List channels | read |
GET | /conversations.history | Channel message history | read |
POST | /conversations.join | Join a channel as the bot | write (approval) |
GET | /users.lookupByEmail | Find a user by email | read |
POST | /reactions.add | Add a reaction to a message | write (approval) |
GET | /auth.test | Check the token and workspace | read |
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).
Agent actions and permissions
| Action | Type | What the agent uses it for |
|---|---|---|
| List channels | read | Picks the channel the app should post to. |
| Read messages | read | Reads channel history, for example for summaries. |
| Send message | write | Posts a message, for example a test notification about a new request. |
| Upload file | write | Adds a file to a channel, for example a report. |
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