---
title: "How to Get a Slack API Key and Bot Token (2026 Guide)"
description: "A Slack API key isn't a single credential for your account. Create an app, set bot scopes, install it, and copy your Bot User OAuth Token."
url: https://www.activepieces.com/blog/how-to-get-a-slack-api-key-and-bot-token-2026-guide
updated: 2026-12-05
---

> Every page on www.activepieces.com is available as markdown: add `.md` to the URL, or send `Accept: text/markdown`. Site index: https://www.activepieces.com/llms.txt

# How to Get a Slack API Key and Bot Token (2026 Guide)

By Grace Muthoni Kariuki · December 5, 2026 · 20 min read · Filed under [Automation tutorials](https://www.activepieces.com/blog/category/automation-tutorials)

**Summary**

Slack has no account-wide API key; instead, bot tokens starting `xoxb-` are issued when you create an app, add scopes, and install it to a workspace.

- Tier 1 allows 1 request per minute; Tier 4 allows 100 per minute.
- conversations.history fell from 50 to 1 per minute for non-Marketplace apps, May 2025.
- chat.postMessage rate limit is roughly one message per second per channel.

**Slack has no account-wide API key**. You create an app at api.slack.com/apps, give it bot token scopes, install it to a workspace, and copy the `xoxb-` Bot User OAuth Token it issues.

![A printed app settings page for a Slack app, beside a bot token card with a long string of characters beginning xoxb-…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/a8d04a2b-df34-44c1-a31b-efdabb54a609/how-to-get-a-slack-api-key-and-bot-token-2026-gu-b88aed73.webp)

The result is one working `chat.postMessage` call from your own terminal, which is also the same token you would later paste into a [Activepieces](https://www.activepieces.com) connection or any other tool that posts on your behalf.

A Slack API token is a scoped credential, such as a bot token beginning `xoxb-`, that Slack issues to an app after it is installed to a workspace, and it authorizes that app to call Slack Web API methods within the permissions granted by its scopes.

If a button label has moved since, trust Slack's page over this one. Each stage follows Slack's documentation as checked on 5 December 2026.

Before you create anything, settle who owns the app, because the token belongs to the app, not to you, and the workspace that installed it controls it. The six steps, in order:

## Get a Slack API token in six steps

1. Create an app at api.slack.com/apps.
2. Open OAuth & Permissions.
3. Add the bot scope `chat:write`.
4. Install the app to your workspace.
5. Copy the `xoxb-` token.
6. Call `chat.postMessage`.

Take each stage in turn below, and check what its paragraph says before you move on.

Choose to create a new app, pick the "from scratch" option, name it, and select the workspace that'll own it. That workspace choice decides where the token works.

Another workspace rejects a token issued for this one, so pick the one whose messages you actually intend to send.

Open OAuth & Permissions, find the Bot Token Scopes section, and add `chat:write`. This is the scope that lets the bot post messages.

Add nothing else yet. Every extra scope widens what a leaked token can do, and a scope added later only requires a reinstall.

Use the install button on the same page and approve the prompt. Slack then shows the Bot User OAuth Token, which begins `xoxb-`.

Copy it into an environment variable such as `SLACK_BOT_TOKEN`, not into source code. If the prompt says an admin must approve, see the last subsection.

### Send a test Slack message with curl

Invite the bot to a channel, then send the request:

```bash
curl -X POST https://slack.com/api/chat.postMessage \
 -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
 -H "Content-type: application/json" \
 -d "{\"channel\": \"$SLACK_CHANNEL_ID\", \"text\": \"First message from the API\"}"
```

When a request exceeds a rate limit, [Slack](https://slack.com/blog/developers/celebrating-five-years-slack-platform) answers with HTTP 429 and a `Retry-After` header. Read the `ok` field in the JSON. `"ok": true` means the message posted. `not_in_channel` means the bot was never invited, and `missing_scope` means `chat:write` wasn't added before install.

### Account, plan and approval requirements

You need a Slack account in a workspace where the owners let you install apps. Workspace owners can restrict installs, in which case your install becomes a request to an admin and no token appears until the admin approves it.

![A workspace owner at a desk reviewing a printed install request form for an app with an approve stamp beside it, while a…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/99ac5b42-9c0a-48b4-bd5e-d790e7dba834/how-to-get-a-slack-api-key-and-bot-token-2026-gu-613a4c57.webp)

If that's your situation, ask for the exact scope list up front, because the admin is approving that list and nothing wider.

## Understand Slack token types and capabilities

Once the admin approves the scope list, it attaches to a token. Slack issues three kinds that each act as a different identity: the bot user, a human who authorised the app, or the app itself.

Per Slack's API documentation (checked December 2026), the prefix tells you which one you're holding.

### Bot, user and app-level tokens compared

Ask who owns the connection before you ask what it can do. A bot token belongs to the app, a user token belongs to the person who authorised it, and an app-level token belongs to the app but reaches no workspace data.

![Signing Keys management page in Activepieces showing a table with one secret key and a New Signing Key button.](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/016ee685-507b-49a7-91c2-f041c8189e41/activepieces-vs-windmill-pricing-and-features-20-c13af596.webp)

The table shows that split.

Pick the row whose identity you want in the audit log, then request only that token.

| Token | Prefix | Acts as | How obtained | Expiry by default / with rotation | Typical use |
|---|---|---|---|---|---|
| Bot | `xoxb-` | The app's bot user | Install the app to a workspace and copy the bot token from the app's OAuth settings | Does not expire / short-lived, renewed with a refresh token | Posting messages, reading channels the bot has joined, slash commands |
| User | `xoxp-` | The person who authorised the app | OAuth flow where that person approves user scopes | Does not expire / short-lived, renewed with a refresh token | Actions that must appear as a person, such as searching as that user |
| App-level | `xapp-` | The app itself, not a workspace member | Generated in the app's settings with chosen app-level scopes | Does not expire until revoked / not covered by rotation | Opening a Socket Mode connection, app-wide operations |

![Three differently shaped key tags laid side by side on a table, labelled only by distinct shapes and colours, each…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/c2115bc4-4744-4115-b1b6-1a06e1e6151f/how-to-get-a-slack-api-key-and-bot-token-2026-gu-cb6bb385.webp)

If the bot token is enough, use it. A user token carries one person's reach, and it stops working in the sense that matters when that person leaves.

### How scopes limit which methods a token can call

Without the right scopes, a call fails with a `missing_scope` error, which names the scope you lack. Each Slack API method names the scopes it requires, and a token can call it only if the app received those scopes at install.

![A workflow canvas showing an Instance Stopped trigger connected to a Revoke Token HTTP request step, with the right panel…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/6562aaca-2f20-4c5f-929c-5a24b3c9a908/linkedin-api-access-limits-and-errors-in-2026-sc-d387a7d6.webp)

When you add a scope later, you reinstall the app so the admin can approve the new grant. This is why the up-front scope list matters: widening it later goes back to the same admin.

You can grant the same scope name to a bot token and not to a user token, since scopes are separate for the two.

Don't reach for legacy tokens on a new app. They are the older per-user tokens that predate the app model, and Slack's documentation has deprecated them, so a new integration should create an app and install it.

![A workflow execution interface showing a completed two-step Square OAuth token revocation flow with HTTP configuration](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/ab58d76a-e150-4da2-b368-e9390d90658a/how-to-evaluate-telemetry-dev-llm-observability-bc2ee918.webp)

### Free versus paid workspace differences Slack documents

Before you build, know that Slack documents plan-based differences that affect what a valid token returns. Free workspaces restrict how much message history is visible, so a history call returns only what the plan exposes, however broad the scopes are.

Free plans also limit how many apps can be installed. Larger Enterprise Grid organisations add admin controls over installs and approvals.

Confirm the current limits on Slack's pricing and plan pages before you build on a free workspace. The token is valid either way, but the data behind it may not be there.

## Check Slack API rate limits and costs

**Even with a valid token, Slack meters you**: it limits each Web API method to one of four tiers, from 1 to 100 requests a minute per method, per app and workspace.

Its rate-limit documentation lists no per-call charge, which means the rate limit can't be exceeded through additional spending.

### Slack API rate limit tiers by method

Even with the right scope, a token can still be throttled on a method whose tier is too low for your loop.

Each method sits in one tier, and the table shows the four tiers as of 5 December 2026, so you can determine which tier applies to your use.

![Slack Web API rate limits by method tier](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/a99775fe-5ab7-49ea-bb1d-e80b8e2b3903/how-to-get-a-slack-api-key-and-bot-token-2026-gu-54c8434b.svg "Source: Slack")

| Tier | Requests per minute | Example method | Scope the example needs |
|---|---|---|---|
| Tier 1 | 1+ | Methods Slack marks for infrequent access | Set on each method's page |
| Tier 2 | 20+ | `users.list` | `users:read` |
| Tier 3 | 50+ | `conversations.history` (see the cut below) | `channels:history` for public channels |
| Tier 4 | 100+ | `users.info` | `users:read` |

Treat Tier 1 calls as rare in any script, since [Tier 1 allows 1 request a minute](https://docs.slack.dev/apis/web-api/rate-limits/), so batch operations stall for 60 seconds between calls. Tier 2 allows 20, enough to page through a user directory but not to poll it.

![Activepieces workflow builder showing a Send HTTP request step configured with Google Search RapidAPI credentials.](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/da977bec-9b3b-44ea-89dc-d64f009a35fe/opus-clip-integration-how-to-set-it-up-2026-guid-8ea5333c.webp)

Tier 3 allows 50 and Tier 4 allows 100, which suit routine lookups. Check the method's own page before you budget a loop.

### Slack chat.postMessage rate limit per channel

Then there is the one method outside the tiers: `chat.postMessage`. Slack documents roughly one message a second per channel, with short bursts tolerated.

A notifier that fans out to many channels is fine, but one that floods a single channel will be throttled even though its workspace-wide volume is low.

When you exceed any limit, Slack returns HTTP 429 with a `Retry-After` header giving the seconds to wait. Honour that value rather than a fixed sleep, or the retries themselves keep you throttled.

### The conversations.history cut for non-Marketplace apps

On 29 May 2025, [Slack's changelog](https://docs.slack.dev/changelog/2025/05/29/rate-limit-changes-for-non-marketplace-apps/) announced that `conversations.history` for non-Marketplace apps would **fall from 50 requests a minute to 1**, so applications previously polling at higher frequencies would need to be redesigned. The new figure applies to apps distributed commercially outside the Marketplace.

![Slack history access for non-Marketplace apps](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/122dfd3e-afe2-48a2-8ab0-1d991fedf204/how-to-get-a-slack-api-key-and-bot-token-2026-gu-340afb5a.svg "Source: Slack (2025)")

In practice, an exporter or summariser that read 50 pages a minute now reads one, so a backfill that took minutes takes hours. If you own the app and the workspace, confirm which category your app falls in before you design around either number.

### Is the Slack API free to call?

Yes, in the sense that matters for budgeting: Slack's documentation, as of 5 December 2026, expresses API access as rate limits and scopes, not a price per request. The cost you meet is the workspace plan behind the token, and the time lost to throttling.

Next, handle 429s correctly, because the limits, not a bill, are what constrain you. Queue requests per method, respect `Retry-After`, and cache results such as user lists instead of refetching them.

## Diagnose and fix Slack API errors

When something fails, Slack usually reports it as an error string in the response body, not as an HTTP failure. You diagnose by reading the `error` field, and the string almost always points to the token, the scope, the channel or the rate limit.

Because Slack Web API methods typically return HTTP 200 with `"ok": false` and an `error` value, a client that only checks the status code will treat a revoked token as a success and carry on silently.

Check `ok` on every response, and log the `error` string and the method name together, so you can tell which app's token failed and who owns that installation.

Read the string first: it tells you whether to fix the token, the app's configuration or your request rate, and only the last of those is a code change. The table sets each string against its usual cause and the change that clears it.

| String | Usual cause | Fix |
|---|---|---|
| `invalid_auth` | Token is malformed, truncated, or not valid for this workspace | Copy the token again from the app's install page and confirm the type |
| `not_authed` | No token was sent | Send the `Authorization: Bearer` header or the `token` parameter |
| `token_revoked` | The token was revoked or the app was uninstalled | Reinstall the app and store the new token |
| `account_inactive` | The user or bot that owns the token is deactivated | Reinstall under an active account, or reassign ownership |
| `missing_scope` | The token lacks a scope the method requires | Add the scope, then reinstall the app |
| `not_in_channel` | The bot is not a member of the target channel | Invite the bot, or add the scope that permits joining |
| `channel_not_found` | Wrong ID, or the channel is private and invisible to the token | Use the channel ID, and invite the bot to private channels |
| `ratelimited` (HTTP 429) | Too many calls to one method | Wait for `Retry-After` seconds, then retry |
| Wrong-workspace token | The token belongs to a different installation | Match the token to the workspace you are calling |

Once the direct call works, keeping it running doesn't need a developer: you describe the process to the Activepieces built-in chat ("post the nightly report to #ops using our Slack connection") and it publishes a live flow, the same one a builder would have wired by hand.

That flow takes this `xoxb-` token as its Slack connection and sits under the same RBAC and audit logs as every other flow, whoever built it.

Each run is recorded in a trace you can open in your account, so an `ok: false` shows up as a plain record with no Slack expertise needed to follow it. MoneyGram, Moneypenny, Alan and FundingSocieties run Activepieces in production, under those same controls.

### Fix Slack invalid_auth and not_authed errors

When no credential reaches Slack, you get `not_authed`; when one arrives but Slack doesn't accept it, you get `invalid_auth`. The first is usually a missing header or an unset environment variable.

The second is usually a pasted token with a trailing space, a truncated value, or a token from a different app. Check the prefix as well: bot tokens begin `xoxb-`, user tokens `xoxp-`, so confirm you're sending the type the method expects.

Then ask who owns the connection, since a token tied to a departed employee's user account fails when that account is deactivated. That surfaces as `account_inactive`. `token_revoked` has the same remedy: reinstall and replace the stored value.

### Missing_scope and not_in_channel

Nothing in your code causes `missing_scope`; it is a configuration fault, not a code fault. The response names the scope you lack, often in a `needed` field.

Add exactly that scope under the app's OAuth settings and reinstall, because existing tokens don't gain scopes until the app is reinstalled.

`not_in_channel` is different: the scope is fine, but the bot isn't a member. Invite it to the channel. `channel_not_found` often hides the same problem for private channels, so verify the channel ID and the bot's membership before assuming the ID is wrong.

One error that arrives as a real HTTP status is a 429, which carries a `Retry-After` header giving the seconds to wait. Honor that value rather than guessing a delay, because retrying early extends the penalty. The pattern is short:

1. Send the request and check the status and the `ok` field.
2. On a 429, read `Retry-After` and pause that method's queue for that long.
3. Retry the same request once the pause ends.
4. If it fails again, back off further and surface the error to an owner instead of looping.

Pausing only the affected method keeps other calls moving, since limits apply per method.

### Wrong workspace or reinstalled app tokens

Send workspace A's token to act on workspace B's channels and you get `channel_not_found` or `invalid_auth` rather than a clear message, because a token is bound to one installation in one workspace. If the app is installed in several workspaces, each has its own token.

When you reinstall the app, it issues a new token and invalidates assumptions about the old one, so update every store that holds it.

Record which workspace and which person installed each token, so the next failure starts with a named owner and not a search.

## Keep a Slack token safe in production

For a Slack token to stay safe, five practices must hold together.

It lives outside your code, it never reaches a browser or public repository, its scopes are the narrowest the app needs, it's rotated and reissued after exposure, and every incoming request is verified against the signing secret.

Each named owner from the install record should be able to confirm all five.

In the order an audit would check them, the five practices are:

- Keep the token in an environment variable or a secrets manager.
- Keep it out of client-side code and out of any public repository.
- Grant least-privilege scopes, only those the app's methods require.
- Rotate and reissue the token after any exposure.
- Verify request signatures with the signing secret.

Treat the list as a checklist, not a ranking: a token with narrow scopes that sits in a public repository is still exposed.

A well-stored token with broad scopes still does more damage than it should when it leaks. The sections below take the first, fourth and fifth in detail.

### Store the token outside your code

Load the bot token (the one beginning `xoxb-`) from an environment variable or a secrets manager at runtime. Never write it into source files, front-end bundles or a public repository.

Slack's security guidance says the same: a token is a credential, so treat it like a password.

For a single service, an environment variable is enough. A secrets manager is the better choice when several people deploy the app, because access to the token can then be granted, logged and withdrawn per person.

Either way, **the browser is never the place for it**: anything shipped to the client can be read by whoever loads the page. Calls to Slack should go through your own server, which holds the token.

Review scopes at the same time. A token that can only post messages and read the channels it was added to limits what a leak can do. Add a scope when a failing call demands it, not in advance.

### Rotate and revoke a leaked token

After any exposure, revoke the token and issue a new one; don't wait to see whether it was misused.

Slack scans public GitHub repositories and revokes tokens it finds there, so **a committed token may already be dead** when you notice, and your app will start returning authentication errors.

Treat that revocation as proof of exposure, not as a fault to work around.

Recover in this order:

1. Revoke the exposed token, or confirm that Slack already has.
2. Reinstall the app, or use token rotation if you have enabled it, to obtain a new token.
3. Put the new token in the secrets store and redeploy.
4. Remove the old value from the repository's history, not only its latest commit.
5. Record the new token's installer and workspace against the owner.

Do not skip step four, because a deleted line remains readable in earlier commits.

### Verify the Slack signing secret on requests

Check the signature on every request Slack sends to your endpoint, using the app's signing secret, and reject any request that fails. The secret is a separate credential from the token.

The token authorises your calls to Slack, while the signing secret proves that calls arriving at your server came from Slack.

Slack signs each request and sends the signature and a timestamp in headers. Your code recomputes the signature from the raw request body and the secret, then compares the two.

Without this check, anyone who finds your endpoint URL can send it fabricated events or slash commands. Store the signing secret exactly as you store the token, and rotate it on the same terms.

## Use a Slack token without code in Activepieces

Paste the bot token (the one beginning `xoxb-`) once into an Activepieces Slack connection. Every flow that uses that connection sends messages as your app without the token appearing in any step.

![Activepieces workflow builder with the Send HTTP request step selected, showing its configuration panel with HTTP method…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/58352882-31ce-42ab-9b0f-c4a0fe866a5c/deepseek-r1-vs-v3-for-business-ai-2026-guide-scr-ae99964b.webp)

Flows are unlimited on every plan, including free, so one connection can serve as many as you build.

The signing secret, as above, stays out of it; it verifies inbound requests and a send-message action doesn't need it.

### Create the Slack connection

Before you open Activepieces, settle who owns the token. The bot token belongs to the Slack app, and the app belongs to whoever installed it into the workspace.

If that person leaves, the installation and the connection can go with them, so record an owner and a backup in your handover notes.

Even the free plan allows up to 5 users, so a backup can be added to the account without paying for anything.

### Add the connection in the Slack step

In the Slack step of a flow, choose to create a new connection and paste the bot token when asked. Use the scopes the app already has; for posting, that means the `chat:write` scope.

The bot must also be a member of any channel it posts to unless it holds additional scopes you have deliberately granted.

Give the connection a name that states the workspace and purpose, so nobody reuses it for something unrelated.

### Choose a Slack connection at run time

Beyond the plain connection, Activepieces also offers a Connections integration with a "Read Connection" step, which reads a connection by its external ID.

The screenshot shows it as the second step of a three-step flow: a Catch Webhook trigger, then Read Connection (v0.4.1, "Read connections dynamically"), then a Slack step, "Send Message To A…".

In its configuration panel, a "Connection External ID" field carries the placeholder `YOUR_CONNECTION_EXTERNAL_ID`, alongside toggles for Continue on Failure and Retry on Failure. Take from this that one flow can choose its Slack connection at run time instead of hard-wiring one.

![Connections in Builder](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/d8d04b82-6618-463f-84b1-265c56fc6d0e/what-is-a-webhook-payload-structure-and-examples-b1415806.webp)

If you run several workspaces, run-time selection helps. It also means the ID you enter decides which workspace receives the message, so treat it as part of the access record.

The panel's own notes describe the advanced integration as being for retrieving connection external IDs; read them before using it.

With the connection in place, the next step is to prove it works.

### Run a first Slack Send Message action

Add the Slack integration's Send Message action to a flow, select the connection you just created, choose a test channel, and enter a short text. Run the test step.

Read any error by token and scope first. A missing-scope response means the app needs `chat:write` and a reinstall, and a not-in-channel response means the bot hasn't been invited. Neither is a fault in the flow.

Name only what you have confirmed. This section uses Send Message; check the integration's own trigger and action list in the editor before you plan anything else, because that list, not this article, is the record of what it supports.

Write code when you need control the integration doesn't expose. Examples are custom retry and backoff against Slack's rate-limit responses, handling of a specific method's tier, or verifying signed requests inside your own service.

![Activepieces workflow builder with HTTP request step selected and its settings panel open showing method, URL, headers, and…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/9e36e973-de4a-435f-8912-12e666216b2d/self-host-mistral-ai-enterprise-deployment-guide-3f7fe28d.webp)

Code is also the better home when the token must come from your existing secrets manager and not from a stored connection.

**Monday checklist**

1. Name the owner and backup of the Slack app and of the Activepieces connection.
2. Confirm the token type is the bot token and list its scopes.
3. Invite the bot to the test channel.
4. Run one Send Message and keep the result.
5. Set a rotation date for the token and the signing secret.

## Related reading

- [Slack Workflow Builder Alternatives (2026 Guide)](https://www.activepieces.com/blog/slack-workflow-builder-alternatives-2026-guide)
- [Slack AI Agents: Slackbot Skills by Plan (2026 Guide)](https://www.activepieces.com/blog/slack-ai-agents-slackbot-skills-by-plan-2026-guide)
- [Vercel Slack Integration: An Activepieces Setup Guide](https://www.activepieces.com/blog/vercel-slack-integration-an-activepieces-setup-guide)

## References

- [Slack](https://docs.slack.dev/apis/web-api/rate-limits/)
- [Slack](https://docs.slack.dev/changelog/2025/05/29/rate-limit-changes-for-non-marketplace-apps/)
