One Slack app for many customer workspaces
Ship your own branded Slack app and route each customer's workspace to that customer's agent.
If you deploy an agent for each of your customers through partner deployments, you can give all of them one Slack app carrying your name and logo. Each customer installs that app into their own workspace, and Keiki sends every message from a workspace to the agent bound to it. Customer A's workspace talks to customer A's agent, and B's to B's, all through one app.
You register the app once, then bind each workspace to an agent: by its team ID if you know it, or through an install link made for that agent.
How routing works
A shared app has no agent of its own. Each workspace that installs it gets a binding from its Slack team ID to one of your organization's agents:
| Workspace | Agent |
|---|---|
T0AAA (Acme) | agt_acme |
T0BBB (Globex) | agt_globex |
T0CCC (just installed) | none yet |
Every Slack conversation is keyed by app, workspace, channel and thread, so two workspaces never share history, sandbox files or approval actions. A binding can only point at an agent in your own organization.
Someone writing in a workspace that has no agent yet gets a reply only they can see:
This workspace isn't connected to an agent yet. Ask whoever gave you this app to finish setting it up.
The install is still recorded, and last_unbound_event_at on the workspace shows when
someone last ran into this.
1. Create and register the app
Create a Slack app from the manifest on the dashboard's Slack channel page, or set it up
by hand with the values in Slack app settings. Then turn on
Manage Distribution → Activate Public Distribution in Slack's app settings so other
workspaces can install it. Install it in your own workspace and register it with an
org-wide key with the deployments:write scope:
POST /api/v1/developer/slack-apps
Authorization: Bearer <key>
Content-Type: application/json
{
"bot_token": "xoxb-…",
"signing_secret": "…",
"client_id": "…",
"client_secret": "…"
}{
"app": {
"id": "gw_…",
"app_id": "A0123",
"routing_status": "active",
"home_team_id": "T0HOME",
"oauth": "unverified",
"oauth_grant_app_id": null,
"slack_urls": { "events_url": "https://…/channels/slack/events", "…": "…" },
"install_url": "https://…/channels/slack/install/gw_…",
"workspace": { "team_id": "T0HOME", "name": "Your company" }
},
"converted": null
}You get 201 the first time and 200 if the app is already registered. Posting again
for a registered app replaces its signing secret, client ID and client secret with
the ones you send; installs and bindings stay. The bot token comes from your own
workspace, which becomes the app's home workspace (home_team_id). That workspace is
recorded as an install but has no agent until you bind one. Every route below takes
either id or the Slack app_id in :id.
Checking the OAuth client
Slack only says which app a client ID belongs to when a workspace actually installs, so
registration checks the bot token but can't check client_id and client_secret
against it. oauth on the app says what the last install proved:
oauth | Meaning |
|---|---|
unverified | No workspace has installed with this client ID yet. |
verified | An install with this client ID came back for this app. |
mismatch | An install came back for another Slack app, named in oauth_grant_app_id. Nothing was installed, and install links answer 409 until you send the right client ID and secret with PATCH. |
Install from the app's install_url once after registering to get verified before you
hand out links.
Update or remove the app
PATCH /api/v1/developer/slack-apps/:id replaces any of bot_token, signing_secret,
client_id and client_secret and keeps the rest. A bot token must belong to the same
Slack app (400, slack_app_mismatch otherwise). A new client ID goes back to
unverified.
DELETE /api/v1/developer/slack-apps/:id turns the app off. Every workspace install is
revoked and its token wiped, and the app's workspace bindings and operators are removed.
The response counts them:
{ "ok": true, "revoked_installs": 3, "removed_bindings": 2 }Conversation history stays. Registering the same Slack app again starts with no bindings.
Moving from a per-agent app
If the Slack app is already connected to one agent as its own channel, registering it
returns 409:
{
"error": "This Slack app is attached to agent Acme support. …",
"code": "slack_app_attached",
"agent": { "id": "agt_acme", "name": "Acme support", "external_ref": "acme" }
}Send the same body with "convert": true to share it without unbinding anyone. Every
workspace the app is installed in, including the home workspace, is bound to that agent.
Installs, tokens and conversation history are kept, and an agent's Slack escalation route
on that app gets the home team_id. converted in the response lists them:
{ "converted": { "agent_id": "agt_acme", "team_ids": ["T0AAA", "T0HOME"] } }After that, bind or move workspaces as described below.
Slack app settings
slack_urls on the app (POST and GET …/slack-apps/:id) has every value the Slack app
must be configured with. The dashboard manifest sets them for you.
| Slack setting | Value |
|---|---|
| Event Subscriptions → Request URL | events_url: https://<platform>/channels/slack/events |
| Interactivity & Shortcuts → Request URL | interactivity_url: https://<platform>/channels/slack/interactions |
| OAuth & Permissions → Redirect URLs | redirect_url: https://<platform>/channels/slack/oauth/callback |
Bot token scopes (bot_scopes) | app_mentions:read, assistant:write, channels:history, channels:read, chat:write, files:read, files:write, groups:history, groups:read, im:history, im:read, im:write, mpim:history, mpim:read, reactions:write, search:read.public, users:read, users:read.email |
Bot events (bot_events) | app_mention, assistant_thread_started, assistant_thread_context_changed, message.channels, message.groups, message.im, message.mpim, app_uninstalled, tokens_revoked |
Read the values from slack_urls rather than copying this table; they follow the
platform's own manifest.
2. Bind workspaces to agents
When you know the team ID
PUT /api/v1/developer/slack-apps/A0123/teams/T0AAA
Authorization: Bearer <key>
Content-Type: application/json
{ "external_ref": "acme" }Send exactly one of agent_id or external_ref, the ref you used when deploying the
agent. You can bind a workspace before it installs the app; its messages reach the agent
as soon as it does. Binding again with the same agent changes nothing. Binding to a
different agent moves the workspace: later messages go to the new agent, and pending
approval actions and tracked threads from the old agent are retired.
DELETE /api/v1/developer/slack-apps/:id/teams/:team_id removes the binding. The
workspace stays installed and gets the "not connected yet" reply.
With an install link
Customers rarely know their team ID. Make a link for their agent instead:
GET /api/v1/developer/slack-apps/A0123/install-link?external_ref=acme&team_id=T0AAA
Authorization: Bearer <key>{
"url": "https://…/channels/slack/install/gw_…?agent=agt_acme&team=T0AAA&exp=…&sig=…",
"expires_at": "2026-11-03T18:00:00.000Z"
}Send the URL to the customer. It opens Slack's install screen, and when the install
finishes, the workspace is bound to that agent. team_id is optional:
- Pinned (
team_idset): Slack opens that workspace, and the link binds nothing else. - Unpinned: the customer picks any workspace. Anyone holding the link can connect their own workspace to that agent, so pin it when you know the team ID.
A link never takes over a workspace that is already bound to an agent; use PUT to move
one.
Expiry and revocation
Links are signed and expire after expires_in seconds: 7 days by default, at least 60
and at most 90 days (7776000). An expired link shows an error and binds nothing.
POST /api/v1/developer/slack-apps/:id/install-links/revoke stops every link made
before the call. Installed workspaces and the signing secret are unaffected, and links
made afterwards work. Links made before expiry existed have no expiry and keep working
until you revoke.
Sending the installer back
Add return_url (https, or http on localhost) and the installer lands there after
Slack instead of on Slack's app page. It's signed into the link, so nobody can change
it. These query parameters are added:
| Parameter | Value |
|---|---|
status | installed or error |
agent_id | The link's agent. |
team_id | The workspace, when Slack named it. |
bound | true if the workspace is now bound to the link's agent, false if it was already bound to another one. Only with installed. |
error | A short code such as access_denied, exchange_failed or oauth_client_mismatch. Only with error. |
https://your.app/slack/done?status=installed&agent_id=agt_acme&team_id=T0AAA&bound=trueFrom a deployment
A deployment can bind the workspace in the same call that creates the agent:
{
"external_ref": "acme",
"agent": { "template": "support" },
"channels": [{ "type": "slack", "app": "A0123", "team_id": "T0AAA" }]
}Leave out team_id and the response includes an install link for the new agent
instead. app can't be combined with bot_token or signing_secret, and doesn't take
ref.
See what's installed
GET /api/v1/developer/slack-apps/:id/teams lists every workspace that installed the app
or has a binding:
{
"teams": [
{
"team_id": "T0AAA",
"agent_id": "agt_acme",
"external_ref": "acme",
"installed": true,
"workspace_name": "Acme",
"installed_at": "2026-10-26T18:00:00.000Z",
"last_unbound_event_at": null,
"bound_at": "2026-10-26T18:01:00.000Z"
}
]
}GET /api/v1/developer/slack-apps lists your shared apps with home_team_id and the
number of installed workspaces.
Manage workspaces from the dashboard
On the dashboard's Slack channel page, open Workspaces on the shared app. The table
shows the same workspaces as GET …/teams. Each row has the workspace name and team ID,
whether the app is installed there, the agent it's bound to, and Last unanswered: the
last time someone wrote there while it had no agent.
Organization owners and admins can:
- choose another agent in a row to move that workspace, or Unbind it;
- Revoke an install. This disconnects the app from that workspace but keeps the binding, so a reinstall goes back to the same agent;
- bind a workspace that hasn't installed yet, under Bind a workspace by team ID;
- make a link under Install link for an agent, optionally pinned to one team ID, with an expiry from 1 to 90 days, and copy it with Copy link;
- stop every link made so far with Revoke all links.
Members see the table but can't change it. If an install lacks permissions the app now asks for, its row lists them with a link to reinstall.
The dashboard follows the same rules as the API: a sandbox organization gets
plan_required when it binds a workspace or makes a link, and a binding can only point
at an agent in your organization. The same actions are tools on Keiki's MCP server:
get_identities_slack_teams, put_identities_slack_teams_by_teamId,
delete_identities_slack_teams_by_teamId, post_identities_slack_install_link (with
expiresInSeconds and returnUrl) and post_identities_slack_install_links_revoke.
Workspace events
Keiki can tell your system when a workspace installs the app, uninstalls it, or writes to it with no agent bound. Point the app at one of your organization's saved webhooks:
PUT /api/v1/developer/slack-apps/A0123/events-webhook
Authorization: Bearer <key>
Content-Type: application/json
{ "webhook_id": "wh_…" }Send null to stop events. The webhook must belong to your organization, and
GET /api/v1/developer/slack-apps/:id returns the current one as events_webhook_id. On
the dashboard, the same setting is Workspace events in the app's Workspaces
dialog, and the Code Mode tool is put_identities_slack_events_webhook. A webhook that a Slack
app sends events to can't be deleted (409) until you choose another one or stop events.
Each event is a JSON POST:
type | When | Extra fields |
|---|---|---|
slack.installed | A workspace finishes installing the app, including a reinstall. If the install came from an install link, it fires after the workspace is bound. | teamId, enterpriseId, workspaceName |
slack.uninstalled | Slack reports app_uninstalled for a workspace. | teamId |
slack.unbound_message | Someone writes to the app in a workspace with no agent bound. Sent at most once an hour per workspace; last_unbound_event_at still updates on every message. | teamId, channelId, userId |
{
"id": "evt_3f9c…",
"type": "slack.unbound_message",
"teamId": "T0CCC",
"channelId": "C0123",
"userId": "U0456",
"orgId": "org_…",
"slackApp": { "id": "gw_…", "appId": "A0123" },
"occurredAt": "2026-10-26T18:05:00.000Z"
}Every event has an id, also sent as the Keiki-Event-Id header with the type in
Keiki-Event-Type. A delivery that doesn't get a 2xx within 10 seconds is retried with
the same id after 1, 5 and 15 minutes, then 1, 3, 6 and 12 hours: 8 attempts over about
22 hours. Retries can arrive after later events and an event can arrive twice, so
deduplicate on id and treat GET …/teams as the source of truth.
What uninstalling keeps
When a workspace uninstalls the app, or Slack revokes its tokens:
- the install is marked revoked and its bot token is wiped, so the agent stops answering there;
- the binding survives:
GET …/teamsstill shows the workspace with itsagent_idandinstalled: false, and a reinstall goes straight back to the same agent; - its operators and conversation history are kept;
slack.uninstalledis sent.
To forget the workspace, DELETE …/teams/:team_id as well.
Who approves actions
When an agent asks for approval in Slack, these people can approve inside a customer's workspace:
- that workspace's own Slack admins and owners;
- whoever installed the app there;
- people you add for that workspace:
PUT /api/v1/developer/slack-apps/:id/teams/:team_id/operators/:slack_user_id, with an optional{ "label": "…" }.GETon…/operatorslists them andDELETEremoves one; - your organization's owners and admins, in every workspace, matched by their Slack email.
The operator list for the whole app on the dashboard counts only in your home workspace. Slack member IDs are only unique within a workspace, so a grant from one workspace never carries over to another.
Escalations
On a shared app, an agent's escalations to Slack
must name a team_id (a dedicated single-workspace app can leave it out). It can only be the agent's own bound workspace or your home workspace.
This is checked when the route is saved and again before each handoff is posted, so
moving a workspace to another agent stops the old agent from posting there.
Errors
| Status | When |
|---|---|
400 | Malformed team_id or slack_user_id, or not exactly one of agent_id / external_ref. |
402 | plan_required: sandbox organizations can't register apps, bind or make links. |
403 | The key is scoped to one agent, or lacks deployments:write (reads accept deployments:read). |
404 | The app, agent, binding or operator isn't in your organization. |
409 | slack_app_attached when registering an app attached to an agent (see Moving from a per-agent app); or the app has no OAuth client ID and secret, or its client ID belongs to another Slack app, so it can't make install links. |
503 | billing_unavailable: billing couldn't confirm the plan right now. Nothing changed; retry. |
Slack agents
How an agent behaves in Slack — when it answers, who it thinks is talking, how it handles bursts of messages, and how you stop it.
Migrate a bespoke Slack agent
Move a Slack assistant you built yourself onto Keiki — one agent per customer organization, your tools and rules, Keiki's runtime.