https://linen.dev logo
Not able to create Slack bot trigger
# 🖥│support-forum
a
I created a
slackbot
toolkit using custom auth config. The tools are executing as expected. Now I tried to create trigger but I am facing issues. I firstly created [webhook_endpoint](https://docs.composio.dev/reference/api-reference/webhook-endpoints/postWebhookEndpoints) for
slackbot
toolkit slug and correct client id. I pasted that in the Slack App's Event Subscription tab. I verified that the scopes present in the auth config and the slack dashboard are exactly same - {im:read,channels:history,groups:history,im:history,mpim:history,team:read,users.profile:read,chat:write,im:write} When i authenticate a new user account, I correctly get these scopes when i try to extract it from connected account data. But I get error when I try to create trigger for this account
When i try to create trigger using
Copy code
const result = await composio.triggers.create(userId, triggerSlug, {
        connectedAccountId: composioAccountId,
      });
I get following error
Copy code
[2026-07-01 00:43:27.653] ERROR: Failed to create Composio trigger
    triggerSlug: "SLACKBOT_CHANNEL_MESSAGE_RECEIVED"
    composioAccountId: "ca_rgxnX6sumkem"
    userId: "1d44ce66-342f-4074-8a72-b9aea168d111"
    error: {
      "status": 400,
      "headers": {},
      "error": {
        "error": {
          "message": "Invalid webhook configuration for trigger \"SLACKBOT_CHANNEL_MESSAGE_RECEIVED\": Failed to get team info: {'ok': False, 'error': 'missing_scope', 'needed': 'team:read', 'provided': 'identify,channels:history,groups:history,im:history,mpim:history,channels:read,files:read,groups:read,im:read,mpim:read,reactions:read,search:read,users:read,users:read.email,users.profile:read,search:read.public'}",
          "code": 1212,
          "slug": "TriggerInstance_WebhookConfigInvalid",
          "status": 400,
          "request_id": "5a7b3bc5-3c86-45fe-ad08-b664f30f58d0",
          "suggested_fix": "Verify the trigger configuration is valid and the connected account has the required permissions. Check the error details above."
        }
      },
      "errorId": "d5fba2a9-4eaf-4c7b-b489-0f22975f173c"
    }
The error is quite weird because the
provided
scopes doesn't match what I get from composio or the slack / composio dashboard.
@Uday please let me know if there is a bug here or if i am missing anything. This is a real blocker I am facing for quite a while now
@Abhishek ?
Ok I just tried it using the composio managed auth config, and I still got the same issue
Please let me know what the issue could be... I checked the
triggerConfig
as well, and that is also fine. There seems to be some issue from your end
a
hi @assasin, checking this.
@assasin i think i found the issue, trying to reproduce this once on my end to confirm. Will update in sometime
a
Thanks @Abhishek pls keep me posted
b
Hi there, Thanks for your patience, and sorry for the run-around here. We found the cause. When the trigger sets up, Composio verifies your workspace by calling Slack's
team.info
, and Slack runs that check against your user token, not the bot token. A Slackbot auth config has two separate scope buckets: bot scopes and user token scopes. The single scope list you passed was stored as bot scopes, so your user token only got our default user scopes, which do not include
team:read
. That is exactly the
provided
list in the error (defaults plus
identify
), which is why
team:read
looked "missing" even though it is on the bot side. Since you are on a custom auth config, you can fix this yourself: • Update (or recreate) your custom Slackbot auth config and set a separate
user_scopes
list that includes
team:read
(plus the other user-token read scopes you need). • Re-connect the account so a fresh user token is issued with
team:read
. • Retry
composio.triggers.create
for that account. If it still returns
missing_scope
after re-authenticating, reply here with the auth config id and connected account id and we'll dig in. This response was generated automatically by Composio's AI support agent. If it doesn't fully resolve your issue, or you'd like to speak with a person, just reply here and a member of our team will take a look.
a
@assasin There is a Dashboard UI gap on our side: the current auth config UI does not expose Slackbot bot scopes and user-token scopes as two separate editable fields. So adding
team:read
from the Dashboard can still put it in the bot scope bucket, which does not fix this trigger setup path. Until we fix the UI/default-scope gap, please update the auth config through the API and explicitly add
team:read
to
credentials.user_scopes
. Keep the rest of the user-token scopes you already need in that same list, because an explicit
user_scopes
value is treated as the user-token scope list for the next OAuth connection:
Copy code
bash
curl --request PATCH "https://backend.composio.dev/api/v3/auth_configs/<auth_config_id>" \
  --header "x-api-key: <your_api_key>" \
  --header "content-type: application/json" \
  --data '{
    "type": "custom",
    "credentials": {
      "user_scopes": [
        "search:read",
        "search:read.public",
        "channels:read",
        "groups:read",
        "im:read",
        "mpim:read",
        "channels:history",
        "groups:history",
        "im:history",
        "mpim:history",
        "users:read",
        "users:read.email",
        "files:read",
        "reactions:read",
        "users.profile:read",
        "team:read"
      ]
    }
  }'
apologize for the bad DX here, we'll work on fixing it ASAP & add a gotcha on our docs. Feel free to ping me here incase you have any more questions or need help with. Dropping my calendly incase you to get on a call to resolve this - https://calendly.com/d/dvzx-t4m-xqt
a
ok thanks @Abhishek that worked. I was wondering the same why the dashboard didn't had the scopes separately.
Can I know why when I now disconnect the slackbot from slack app, that I don't receive a
composio.connected_account.expired
webhook? I have created the webhook endpoint in the UI. What else do I need to do? The other integration (gmail) gave me the expired webhook.
a
Could you please share the slackbot connectionID?
a
This is the auth config of slackbot -- ac_fkqlz4bSwzpu. This is the connected account -- ca_YNyCsokSk4ZK
b
thanks checking
a
I am getting the
composio.trigger.message
webhook, but not the
composio.connected_account.expired
webhook
a
@assasin we found what happened here. We did see a token refresh failure for this Slackbot connected account after it was disconnected, but we do not mark a connection as expired immediately on the first failed refresh. The reason is that refresh attempts can sometimes fail because of transient provider-side issues, such as a 5xx response or a 429/rate-limit response. To avoid incorrectly expiring healthy connections, we retry the refresh before marking the connection as expired. The
composio.connected_account.expired
webhook is emitted only when the connected account actually transitions to the expired state, not on the first refresh failure. In this case, the connection had not crossed that retry threshold yet. If the refresh keeps failing across retries and the connection is marked expired, that is when the expired webhook will be delivered.
a
any idea how long it takes? how many refreshes ?
a
For transient refresh failures, such as 5xx errors, 429/rate-limit responses, or other non-permanent errors, we currently retry up to 200 times at a 25-minute interval before marking the connection as expired. For clear permanent auth failures, like most 400-level invalid-token cases, we expire the connection much sooner, after a few retries (3) In this Slack & Slackbot case, Slack returns HTTP 200 even though the response body indicated the token was invalid. Ideally, we should classify that more strictly and expire the connection faster. We’re tracking this internally so revoked Slackbot connections can transition to expired sooner and trigger the webhook more quickly.
a
Ok I will keep monitroing, but I think it still won't give the conection expired webhook because I created few connections yesterdaywhich are still shown as active in dashboard even tho I manually deleted them all from slack ui.
a
With 200 retries at a 25-minute interval, it can take roughly 3.5 days before the connection transitions to expired, assuming each refresh attempt continues to fail. IK this is longer than ideal. We recently increased the refresh interval to 25 minutes and are monitoring the impact. Once things are looking stable, we’ll reduce the number of retries so the connections gets marked expired sooner
a
yeah this seems excessive, there shouldn't be this many retries for something like expiration check. I doubt slack is having infra issue to give this many 5xx errors. Please have a way to configure this at the very least
a
Fair ask, i'll pass this feedback to team and update you once things progress. Thanks
a
thanks
2 Views