You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何获取Slack私有频道成员?API调用遇channel_not_found错误求助

How to Retrieve Members of a Slack Private Channel (Fixing Your channel_not_found Error)

Let's break down how to fix that channel_not_found error first, then walk through the proper steps to get private channel members:

Why you're seeing channel_not_found

There are three common reasons for this error when calling conversations.members:

  • Incorrect channel ID: Private channel IDs start with C, but you can't just copy one from the browser URL if you're not a member of the channel. You'll need to fetch valid private channel IDs via the API instead.
  • Missing token scopes: Your API token needs specific permissions to access private channels. At minimum, you'll need channels:read, users:read, and conversations.members scopes.
  • Not a channel member: Slack blocks access to private channel data for anyone (or any bot) that isn't explicitly part of the channel. If your token's associated user/bot isn't in the private channel, you'll get this error no matter what.

Step-by-step to get private channel members

  1. Fetch valid private channel IDs
    Use the conversations.list endpoint to get all private channels your token can access. Make sure to set the types parameter to private_channel:

    https://slack.com/api/conversations.list?types=private_channel&token=[your-token]
    

    The response will include an array of channels, each with a valid id field you can use for the next step.

  2. Retrieve channel members
    Plug the valid channel ID into the conversations.members endpoint:

    https://slack.com/api/conversations.members?channel=[valid-private-channel-id]&token=[your-token]
    

    A successful response will give you an array of user IDs for all members in the private channel.

  3. Get detailed user info (optional)
    If you need more than just user IDs (like usernames, emails, or profile details), use the users.info endpoint with each user ID:

    https://slack.com/api/users.info?user=[user-id]&token=[your-token]
    

Key additional tips

  • Bot tokens: If you're using a bot token, you have to manually add the bot to the private channel (a channel member needs to invite it) before it can access any data for that channel.
  • Enterprise Grid: For Enterprise Grid workspaces, you might need extra scopes like team:read if you're accessing channels across multiple connected workspaces.

内容的提问来源于stack exchange,提问作者Viktor Bogutskii

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 22:17:51