Move Slack to the Standard managed app
Slack has two Composio managed apps. Slack has approved Standard, gives it higher rate limits, and shows no Marketplace warning when users connect. Legacy is not approved by Slack and gets lower rate limits, but it receives every Slack trigger. See Slack managed apps for the full comparison.
Use this guide to move your users from Legacy to Standard. Legacy connections keep working while you switch, so you can move users on your own schedule.
Check your triggers first
Standard does not receive these four message triggers:
SLACK_CHANNEL_MESSAGE_RECEIVEDSLACK_DIRECT_MESSAGE_RECEIVEDSLACK_RECEIVE_BOT_MESSAGESLACK_RECEIVE_MESSAGE
If your product depends on any of them, don't move to Standard. Stay on Legacy, or move to your own Slack app.
Slack managed app IDs
An auth config picks its managed app with managed_app_id.
| App | managed_app_id |
|---|---|
| Standard | ma_dyXxx6Il7ZK_ |
| Legacy | ma_aF51zqFNTs79 |
In your code, read the IDs from the API instead of hardcoding them. Fetch the Slack toolkit and read composio_managed_auth. It has one entry per managed app, with its managed_app_id, is_default flag, and the scopes it can request.
The Python SDK's toolkit model doesn't return composio_managed_auth yet. Use the API tab or Get toolkit by slug.
What carries over
- Your user IDs, sessions, and agent code. Only the Slack auth config your sessions use changes.
- Existing connected accounts. Legacy connections keep working and refreshing until you disable or delete them.
What doesn't carry over
Existing users must reconnect. Slack issues OAuth tokens to one app, so a token granted to Legacy doesn't work with Standard.
You can't switch an existing auth config to another managed app. You set managed_app_id when you create the auth config, so you create a new one for Standard.
Trigger instances belong to a connected account, so each reconnected user needs new triggers too.
Migrating
Create a Slack auth config with the Standard managed_app_id:
The Python SDK's auth config types don't include managed_app_id yet. Use the API tab or Create auth config.
Copy the returned auth config ID, for example ac_your_standard_slack_config.
If you set custom scopes on your Legacy config, pass them again in auth_config.credentials: bot scopes in scopes and user-token scopes in user_scopes. First check that Standard offers each one: its entry in composio_managed_auth lists the scopes it can request in scopes.available. If Standard doesn't offer a scope you need, stay on Legacy or move to your own Slack app.
A session uses an auth config only when you pass it in auth_configs (Python) or authConfigs (TypeScript), keyed by toolkit. The session then finds or creates the user's connection on that config. See Precedence.
A session pointed at Standard asks an existing Legacy user to connect again. To keep existing users working, choose the config per user: Standard for anyone with an active connection on it or no Legacy connection at all, and Legacy for everyone else.
from composio import Composio
composio = Composio()
STANDARD_CONFIG = "ac_your_standard_slack_config"
LEGACY_CONFIG = "ac_your_legacy_slack_config"
def has_active_connection(user_id: str, auth_config_id: str) -> bool:
accounts = composio.connected_accounts.list(
user_ids=[user_id],
auth_config_ids=[auth_config_id],
statuses=["ACTIVE"],
)
return len(accounts.items) > 0
def slack_auth_config_for(user_id: str) -> str:
if has_active_connection(user_id, STANDARD_CONFIG):
return STANDARD_CONFIG
if has_active_connection(user_id, LEGACY_CONFIG):
return LEGACY_CONFIG
return STANDARD_CONFIG
session = composio.create(
user_id="user_123",
auth_configs={"slack": slack_auth_config_for("user_123")},
)Store which config each user is on in your own database if you'd rather not look it up on every session.
Ask each existing user to connect again, for example with an in-app banner or at their next sign-in. Generate a Connect Link on the Standard config:
from composio import Composio
composio = Composio()
request = composio.connected_accounts.link(
user_id="user_123",
auth_config_id="ac_your_standard_slack_config",
callback_url="https://your-app.com/connections/callback",
)Send the browser to the returned redirect URL. Once the new connection is ACTIVE, the routing from the previous step sends that user's sessions to Standard.
Use the same user ID the Legacy connection has. A different user ID creates a connection that your sessions and triggers won't match to the existing user.
Triggers stay attached to the Legacy connected account. List them and create each one on the new connected account with the same trigger config, delivery type, and polling interval. Skip the four message triggers, because Standard doesn't receive them. The list is cursor-paginated, so the code reads every page. Keep a map from each old trigger ID to its new one, and leave the old triggers enabled for now:
from composio import Composio
composio = Composio()
NOT_ON_STANDARD = {
"SLACK_CHANNEL_MESSAGE_RECEIVED",
"SLACK_DIRECT_MESSAGE_RECEIVED",
"SLACK_RECEIVE_BOT_MESSAGE",
"SLACK_RECEIVE_MESSAGE",
}
new_trigger_ids = {}
cursor = None
while True:
page = composio.triggers.list_active(
connected_account_ids=["ca_old_legacy_account"],
cursor=cursor,
)
for trigger in page.items:
if trigger.trigger_name in NOT_ON_STANDARD:
continue
new_trigger = composio.triggers.create(
slug=trigger.trigger_name,
connected_account_id="ca_new_standard_account",
trigger_config=trigger.trigger_config,
# A fallback to polling is left for Composio to decide again
type=None if trigger.fallback_reason else trigger.type,
polling_interval=trigger.polling_interval,
)
new_trigger_ids[trigger.id] = new_trigger.trigger_id
cursor = page.next_cursor
if not cursor:
breakThe SDK create calls don't copy a per-trigger webhook URL (egress_url). If an old trigger has one, set it on the new trigger with Update trigger instance now, before any old trigger is disabled. The API tab passes it in the create call.
Events from the new triggers carry the new trigger ID and connected account ID. Update anything that matches on the old values: event subscriptions filtered by trigger ID, webhook handlers, and any stored links between a user and their trigger or connected account.
Expect duplicate events while both triggers are enabled. Once events arrive from each new trigger, disable the old one. Disable it rather than delete it, so you can switch back if something goes wrong:
from composio import Composio
composio = Composio()
# Old trigger IDs from the map you saved above
for old_trigger_id in ["ti_old_trigger"]:
composio.triggers.disable(trigger_id=old_trigger_id)After a user's new connection works, disable their Legacy connected account. Disabling an account also disables its triggers, and you can re-enable it if something goes wrong.
Once you're confident, clean up in this order:
- Optionally, revoke the Legacy token so Slack invalidates it. Revoking needs the connected account to still exist, so do it before you delete. Once you delete the account, you can't revoke its token through Composio.
- Delete the old triggers.
- Delete the Legacy connected account. This removes it from Composio and is permanent.
When no active connections remain on the Legacy config, every user is on Standard. You can then pass the Standard config in every session and drop the routing logic.
Checklist
- Your product doesn't need the four message triggers.
- A Slack auth config exists on the Standard managed app.
- Sessions route each user to the right config, and new users land on Standard.
- Existing users have a way to reconnect, under the same user ID.
- Triggers exist on each new connection, and the old ones are disabled.
- Legacy connected accounts are disabled or deleted once their replacements work.
- A connected-account list filtered to the Legacy config shows no active accounts.