> ## Documentation Index
> Fetch the complete documentation index at: https://sariva.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Scopes & secrets

> The seven bot scopes and the three tokens the Sariva platform needs.

## Bot token scopes (all 7)

If you created the app **from the manifest**, these seven are **already set** — just **verify** them under **OAuth & Permissions → Scopes → Bot Token Scopes**. If you did the **manual** setup instead, add all seven there now:

| Scope | What it enables |
| - | - |
| `chat:write` | Post as `@sariva-platform` — agent responses, approval prompts, alerts |
| `commands` | Receive slash commands (reserved for a future release; harmless now) |
| `app_mentions:read` | Receive `app_mention` events |
| `im:history` | Read DM contents (the `message.im` payload is empty without it) |
| `im:read` | Receive `message.im` events — DMs carry growth operations |
| `users:read` | Look up Slack profiles via `users.info` |
| `users:read.email` | Include **email** in `users.info` — required to map Slack identity → Sariva platform user + RBAC role. Without it, every request runs as the default role. |

ⓘINFO

**Why all 7, not 3?** With only `chat:write` / `commands` / `users:read`, events can't be saved, DM payloads arrive empty, and `users.info` returns no email — so RBAC mapping silently fails.

⚠WARNING

Two scope gotchas:

* **`calls:write` vs `chat:write`** — typing `chat:` also surfaces `calls:write` in autocomplete. The wrong one installs fine but every `chat.postMessage` returns `missing_scope`. Verify it reads exactly `chat:write`.
* **`app_mention` silently fails** if you subscribe to the event without adding `app_mentions:read` first. Add the scope, save, then **reinstall**.

## Capture three secrets

The three secrets come from three different places in your app's settings. Save them in a password manager — **never** commit to git. You supply them later at **install time**: on the Kubernetes paths the setup wizard's `setup-secret.sh` is where they get filled in; on the [Linux VM (Docker) path](https://sariva.mintlify.site/deploy/vm-docker-cc.md#5-fill-the-env) they are the `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN` lines in `.env`. Nothing to do with them now.

**1. Install to Workspace — this reveals the bot token**

Left sidebar → **OAuth & Permissions** → click **Install to Workspace** at the top → **Allow**. After it completes, the **Bot User OAuth Token** appears on that same page — copy it. It starts with `xoxb-`. This is your `SLACK_BOT_TOKEN`.

**2. Generate the app-level token — the manifest cannot set this**

Left sidebar → **Basic Information** → scroll to **App-Level Tokens** → **Generate Token and Scopes**. Name it anything (e.g. `socket`), click **Add Scope** and pick `connections:write`, then **Generate**. Copy it now — Slack shows it only once. It starts with `xapp-1-`. This is your `SLACK_APP_TOKEN`.

**3. Copy the signing secret**

Still on **Basic Information** → **App Credentials** → **Signing Secret** → click **Show** → copy the 32-character value. This is your `SLACK_SIGNING_SECRET`.

Quick reference:

| Variable | Format | Where | Used by |
| - | - | - | - |
| `SLACK_BOT_TOKEN` | `xoxb-…` | OAuth & Permissions → Bot User OAuth Token (after Install) | Slack Web API client |
| `SLACK_APP_TOKEN` | `xapp-1-…` | Basic Information → App-Level Tokens (scope `connections:write`) | Socket Mode client |
| `SLACK_SIGNING_SECRET` | 32-char hex | Basic Information → App Credentials → Signing Secret | Captured but unused in Socket Mode (forward compat) |

ⓘINFO

**Token gotchas:** the app-level (`xapp-1-`) and bot (`xoxb-`) tokens are shown once — mixing them up logs `invalid_auth` / `not_allowed_token_type` (`xoxb-` → `SLACK_BOT_TOKEN`, `xapp-1-` → `SLACK_APP_TOKEN`). The signing secret being unused at runtime is intentional — keep it alongside the other two secrets.

Next: [Channels & verify](https://sariva.mintlify.site/prerequisites/slack/channels-verify.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.