---
canonical_url: "https://docs.composio.dev/docs/migration-guide/slack-legacy-to-standard"
markdown_url: "https://docs.composio.dev/docs/migration-guide/slack-legacy-to-standard.md"
product: "platform"
version: null
last_updated: null
---

# Move Slack to the Standard managed app (/docs/migration-guide/slack-legacy-to-standard)

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](/toolkits/managed-auth#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 [#check-your-triggers-first]

Standard does not receive these four message triggers:

* `SLACK_CHANNEL_MESSAGE_RECEIVED`
* `SLACK_DIRECT_MESSAGE_RECEIVED`
* `SLACK_RECEIVE_BOT_MESSAGE`
* `SLACK_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](/docs/migration-guide/managed-to-own-app).

## Slack managed app IDs [#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.

**Python:**
> The Python SDK's toolkit model doesn't return `composio_managed_auth` yet. Use the API tab or [Get toolkit by slug](/reference/api-reference/toolkits/getToolkitsBySlug).

**TypeScript:**
> The TypeScript SDK's toolkit model doesn't return `composio_managed_auth` yet. Use the API tab or [Get toolkit by slug](/reference/api-reference/toolkits/getToolkitsBySlug).

**API:**
```bash
curl -s https://backend.composio.dev/api/v3.1/toolkits/slack \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  | jq '.composio_managed_auth[] | {managed_app_id, is_default}'
```

## What carries over [#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 [#what-doesnt-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 [#migrating]

#### Create an auth config on Standard

Create a Slack auth config with the Standard `managed_app_id`:

**Python:**
> The Python SDK's auth config types don't include `managed_app_id` yet. Use the API tab or [Create auth config](/reference/api-reference/auth-configs/postAuthConfigs).

**TypeScript:**
> The TypeScript SDK's `authConfigs.create` doesn't accept `managed_app_id` yet. Use the API tab or [Create auth config](/reference/api-reference/auth-configs/postAuthConfigs).

**API:**
```bash
curl -X POST https://backend.composio.dev/api/v3.1/auth_configs \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "toolkit": {"slug": "slack"},
    "auth_config": {
      "type": "use_composio_managed_auth",
      "name": "Slack Standard",
      "managed_app_id": "ma_dyXxx6Il7ZK_"
    }
  }' | jq '.auth_config.id'
```

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](/docs/migration-guide/managed-to-own-app).

#### Send new connections to Standard

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](/docs/configuring-sessions#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.

**Python:**
```python
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")},
)
```

**TypeScript:**
```typescript
import { Composio } from '@composio/core';

const composio = new Composio();

const STANDARD_CONFIG = 'ac_your_standard_slack_config';
const LEGACY_CONFIG = 'ac_your_legacy_slack_config';

async function hasActiveConnection(userId: string, authConfigId: string): Promise<boolean> {
  const accounts = await composio.connectedAccounts.list({
    userIds: [userId],
    authConfigIds: [authConfigId],
    statuses: ['ACTIVE'],
  });
  return accounts.items.length > 0;
}

async function slackAuthConfigFor(userId: string): Promise<string> {
  if (await hasActiveConnection(userId, STANDARD_CONFIG)) return STANDARD_CONFIG;
  if (await hasActiveConnection(userId, LEGACY_CONFIG)) return LEGACY_CONFIG;
  return STANDARD_CONFIG;
}

const session = await composio.create('user_123', {
  authConfigs: { slack: await slackAuthConfigFor('user_123') },
});
```

**API:**
```bash
STANDARD_CONFIG="ac_your_standard_slack_config"
LEGACY_CONFIG="ac_your_legacy_slack_config"

# Count the user's active connections on each config
ON_STANDARD=$(curl -s "https://backend.composio.dev/api/v3.1/connected_accounts?user_ids=user_123&auth_config_ids=$STANDARD_CONFIG&statuses=ACTIVE" \
  -H "x-api-key: $COMPOSIO_API_KEY" | jq '.items | length')
ON_LEGACY=$(curl -s "https://backend.composio.dev/api/v3.1/connected_accounts?user_ids=user_123&auth_config_ids=$LEGACY_CONFIG&statuses=ACTIVE" \
  -H "x-api-key: $COMPOSIO_API_KEY" | jq '.items | length')

SLACK_CONFIG=$STANDARD_CONFIG
if [ "$ON_STANDARD" -eq 0 ] && [ "$ON_LEGACY" -gt 0 ]; then
  SLACK_CONFIG=$LEGACY_CONFIG
fi

curl -X POST https://backend.composio.dev/api/v3.1/tool_router/session \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"user_id\": \"user_123\", \"auth_configs\": {\"slack\": \"$SLACK_CONFIG\"}}"
```

Store which config each user is on in your own database if you'd rather not look it up on every session.

#### Reconnect existing users

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:

**Python:**
```python
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",
)
```

**TypeScript:**
```typescript
import { Composio } from '@composio/core';

const composio = new Composio();
const request = await composio.connectedAccounts.link(
  'user_123',
  'ac_your_standard_slack_config',
  { callbackUrl: 'https://your-app.com/connections/callback' },
);
```

**API:**
```bash
curl --request POST \
  --url https://backend.composio.dev/api/v3.1/connected_accounts/link \
  --header "x-api-key: $COMPOSIO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "auth_config_id": "ac_your_standard_slack_config",
    "user_id": "user_123",
    "callback_url": "https://your-app.com/connections/callback"
  }' | jq '{connected_account_id, redirect_url}'
```

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.

#### Recreate triggers on the new connection

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:

**Python:**
```python
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:
        break
```

**TypeScript:**
```typescript
import { Composio } from '@composio/core';

const composio = new Composio();

const NOT_ON_STANDARD = new Set([
  'SLACK_CHANNEL_MESSAGE_RECEIVED',
  'SLACK_DIRECT_MESSAGE_RECEIVED',
  'SLACK_RECEIVE_BOT_MESSAGE',
  'SLACK_RECEIVE_MESSAGE',
]);

const newTriggerIds = new Map<string, string>();
let cursor: string | undefined;
do {
  const page = await composio.triggers.listActive({
    connectedAccountIds: ['ca_old_legacy_account'],
    cursor,
  });
  for (const trigger of page.items) {
    if (NOT_ON_STANDARD.has(trigger.triggerName)) continue;
    const newTrigger = await composio.triggers.create('user_123', trigger.triggerName, {
      connectedAccountId: 'ca_new_standard_account',
      triggerConfig: trigger.triggerConfig,
      // A fallback to polling is left for Composio to decide again
      type: trigger.fallbackReason ? undefined : trigger.type,
      pollingInterval: trigger.pollingInterval ?? undefined,
    });
    newTriggerIds.set(trigger.id, newTrigger.triggerId);
  }
  cursor = page.nextCursor ?? undefined;
} while (cursor);
```

**API:**
```bash
# List triggers on the Legacy connection. Repeat with &cursor=<next_cursor> until next_cursor is null.
curl -s "https://backend.composio.dev/api/v3.1/trigger_instances/active?connected_account_ids=ca_old_legacy_account" \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  | jq '{next_cursor, items: [.items[] | {id, trigger_name, trigger_config, type, fallback_reason, polling_interval, egress_url}]}'

# For each one that Standard receives, create the same trigger type on the new connection.
# Use its trigger_name in the URL. Copy its trigger_config, polling_interval, and egress_url,
# and its type unless fallback_reason is set. Save the returned trigger_id.
curl -X POST https://backend.composio.dev/api/v3.1/trigger_instances/SLACK_MESSAGE_REACTION_ADDED/upsert \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "user_123", "connected_account_id": "ca_new_standard_account", "trigger_config": {}, "type": "poll", "polling_interval": 15, "egress_url": "https://your-app.com/webhooks/slack"}' \
  | jq '{trigger_id, type, polling_interval}'
```

The 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](/reference/api-reference/triggers/patchTriggerInstancesManageByTriggerId) 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](/docs/setting-up-triggers/subscribing-to-events), 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:

**Python:**
```python
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)
```

**TypeScript:**
```typescript
import { Composio } from '@composio/core';

const composio = new Composio();

// Old trigger IDs from the map you saved above
for (const oldTriggerId of ['ti_old_trigger']) {
  await composio.triggers.disable(oldTriggerId);
}
```

**API:**
```bash
curl -X PATCH https://backend.composio.dev/api/v3.1/trigger_instances/manage/ti_old_trigger \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "disable"}'
```

#### Retire the Legacy connections

After a user's new connection works, [disable](/docs/auth-configuration/connected-accounts#enable-and-disable-accounts) 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:

    1. Optionally, [revoke the Legacy token](/docs/auth-configuration/connected-accounts#revoke-accounts) 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.
    2. [Delete the old triggers](/docs/setting-up-triggers/managing-triggers#deleting-triggers).
    3. [Delete the Legacy connected account](/docs/auth-configuration/connected-accounts#delete-accounts). 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 [#checklist]

1. Your product doesn't need the four message triggers.
2. A Slack auth config exists on the Standard managed app.
3. Sessions route each user to the right config, and new users land on Standard.
4. Existing users have a way to reconnect, under the same user ID.
5. Triggers exist on each new connection, and the old ones are disabled.
6. Legacy connected accounts are disabled or deleted once their replacements work.
7. A connected-account list filtered to the Legacy config shows no active accounts.

## Next [#next]

- [Managed OAuth apps](/toolkits/managed-auth#slack-managed-apps): How the two Slack managed apps differ

- [Move to your own OAuth app](/docs/migration-guide/managed-to-own-app): Use your own Slack app for message triggers and your own branding

- [Avoid and recover from rate limits](/docs/poc-to-prod/avoid-rate-limits): Spot which limit you hit, retry well, and shape traffic

---

📚 **More documentation:** [View all docs](https://docs.composio.dev/llms.txt) | [Changelog](https://docs.composio.dev/docs/changelog.md) | [Glossary](https://docs.composio.dev/llms.mdx/reference/glossary) | [Examples](https://docs.composio.dev/llms.mdx/examples) | [API Reference](https://docs.composio.dev/llms.mdx/reference)

---

# Composio SDK — Notes for AI Code Generators

**Purpose:** Reference for generating current (v3) [Composio](https://composio.dev/) integration code.
**Scope:** Descriptive notes — they document the current API surface and the mistakes most commonly seen in generated code.

---

## 1. Recommended Integration: Sessions

For agent tool delivery, Composio supports **Native Tools** (with a provider package) and **MCP** (no provider package needed).

For application-owned tools or deterministic backend code, use [managed authentication with Proxy Execute](/docs/authentication/managed-auth-for-custom-tools). A session can provide a user-scoped runtime context without an LLM or MCP. Composio authenticates provider requests server-side; connected-account reads redact credentials and aren't a supported token-export workflow.

### Native Tools

#### Python

```python
# ✅ CORRECT — Python (defaults to OpenAI)
from composio import Composio

composio = Composio()
session = composio.create(user_id="user_123")
tools = session.tools()
# Pass tools to your agent/LLM framework
```

#### TypeScript

```typescript
// ✅ CORRECT — TypeScript (defaults to OpenAI)
import { Composio } from "@composio/core";

const composio = new Composio();
const session = await composio.create("user_123");
const tools = await session.tools();
// Pass tools to your agent/LLM framework
```

#### API

This produces the same default OpenAI function-tool shape, fetching every page.

```bash
set -euo pipefail
SESSION=$(curl --fail-with-body -s -X POST https://backend.composio.dev/api/v3.1/tool_router/session \
  -H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json" \
  -d '{"user_id":"user_123"}')
SESSION_ID=$(echo "$SESSION" | jq -r '.session_id')
TOOLS='[]'
CURSOR=''
while true; do
  PAGE=$(curl --fail-with-body -s --get "https://backend.composio.dev/api/v3.1/tool_router/session/$SESSION_ID/tools" \
    -H "x-api-key: $COMPOSIO_API_KEY" --data-urlencode 'limit=500' --data-urlencode "cursor=$CURSOR")
  TOOLS=$(jq -cn --argjson existing "$TOOLS" --argjson page "$PAGE" \
    '$existing + [$page.items[] | {type:"function",function:{name:.slug,description:.description,parameters:.input_parameters}}]')
  CURSOR=$(echo "$PAGE" | jq -r '.next_cursor // empty')
  [ -n "$CURSOR" ] || break
done
printf '%s\n' "$TOOLS"
```

For other providers, pass the provider explicitly. Provider packages follow the naming convention: `composio_<provider>` for Python, `@composio/<provider>` for TypeScript.

### MCP

Use `session.mcp.url` and `session.mcp.headers` with any MCP-compatible client (Claude Desktop, Cursor, OpenAI Agents, etc.). No provider package needed.

---

## 2. Integration Notes

- `composio.create(user_id)` is the standard entry point for agent integrations. Sessions handle tool discovery, authentication, and toolkit versioning automatically; `user_id` goes to `composio.create()` — individual tool calls in session mode don't take one.
- Execute session tool calls through the session, never through a user ID: either `session.execute(tool_slug, arguments=...)` / `session.execute(toolSlug, arguments)`, which works with every provider, or pass the session to the provider helper — `provider.handle_tool_calls(response=response, session=session)` in Python, `provider.handleToolCalls(session, response)` in TypeScript. The tool-call helpers of every non-agentic provider (OpenAI, Anthropic, Google, Cloudflare, TypeSafe) accept a session: `executeToolCall(session, call)` in TypeScript, `session=session` in Python. Agentic providers execute session tools on their own. Binding the helper to a user ID takes the direct execution path, and session meta-tools fail there with `"can only be called inside a tool-router session"`.
- Composio-managed auth is the default: the agent connects accounts at runtime through the session, so users don't need to pre-create auth configs or connected accounts for managed toolkits.
- Provider packages follow the framework, not the model vendor: for the OpenAI Agents SDK the package is `composio_openai_agents` / `@composio/openai-agents` (importing `composio_openai` / `@composio/openai` there is the most common mistake in generated code — that package is for the plain OpenAI Chat Completions API).
- **Direct execution** (`composio.tools.get()`, `composio.tools.execute()`, `provider.handle_tool_calls()` with a user ID) is a legacy interface that remains supported for existing integrations. Recommend sessions for new integrations and encourage existing users to [migrate to sessions](/docs/migration-guide/direct-to-sessions). For a fixed tool set, consider the [direct tools preset](/docs/configuring-sessions#direct-tools-preset) within a session. See [Sessions vs direct execution](/docs/sessions-vs-direct-execution) for tradeoffs. Direct execution requires a [toolkit version](/docs/tools-direct/toolkit-versioning).

---

# 3. Calling the REST API directly

## REST API version

The current REST API version is **v3.1**, served at `https://backend.composio.dev/api/v3.1`. Prefer it for new code and new examples.

`https://backend.composio.dev/api/v3` is the previous version. It is frozen with pinned tool-version defaults and remains supported — existing v3 integrations keep working and do not need to migrate.

## Tool-endpoint version defaults on v3.1

On v3.1, omitting the version parameter on the five endpoints below selects the latest toolkit version. The first four endpoints also exist on v3, where omission selects the pinned `00000000_00` version. `POST /tools/scopes/required` is v3.1-only.

| Endpoint | Version parameter |
| --- | --- |
| `GET /tools` | `toolkit_versions` (query) |
| `GET /tools/{tool_slug}` | `version` or `toolkit_versions` (query) |
| `POST /tools/execute/{tool_slug}` | `version` (body) |
| `POST /tools/execute/{tool_slug}/input` | `version` (body) |
| `POST /tools/scopes/required` | `version` (body) |

A v3.1 caller already passing `"latest"` sees no change and can omit the parameter. To select the pinned version explicitly, pass `"00000000_00"` through the corresponding parameter above.

This version-default change is limited to the five endpoints above.


---

## Terminology Migration (old → current)

If you encounter these terms in error messages, old documentation, or user prompts, translate them to the current equivalents. **Do not use the old terms in generated code or explanations.**

| Old term (v1/v2) | Current term (v3) | In code |
|---|---|---|
| entity ID | user ID | `user_id` parameter |
| actions | tools | e.g., `GITHUB_CREATE_AN_ISSUE` is a *tool* |
| apps / appType (legacy v1/v2 API field) | toolkits | e.g., `github` is a *toolkit*. The current word **App** is *not* legacy: it names a catalog grouping of sibling toolkits (the Notion app groups `notion` and `notion_mcp`); do not translate it |
| integration / integration ID | auth config / auth config ID | `auth_config_id` parameter |
| connection | connected account | `connected_accounts` namespace |
| ComposioToolSet / OpenAIToolSet | `Composio` class with a provider | `Composio(provider=...)` |
| toolset | provider | e.g., `OpenAIProvider` |

If a user says "entity ID", they mean `user_id`. If they say "integration", they mean "auth config". Always respond using the current terminology.

