List channels that a user is "channel admin" in?

Is there any way to list all channels where a specific user is “Channel Admin”?

Hi,

only via the API or the database.
The API call for that would be:

# curl -sX GET -H "Authorization: Token <yourtoken>" "https://<yourdomain>/api/v4/users/<theusersid>/teams/<yourteamid>/channels/members" | jq -r '.[] | select (.roles == "channel_user channel_admin") | .channel_id'
ugbcjfsif3bmpgkz9yqqk818uy
1d8mcs6nkjg55kysaei3sdqmma
jitoep1mcfrtjjp8facxycqeec

Thanks!

And then, if someone else finds this and wonders, to translate channel_id to channel name:

curl -sX GET -H "Authorization: Token <yourtoken>" https://<yourdomain>/api/v4/channels/<channelid> | jq | grep -I name

It will list both Display Name and actual name

I uploaded a script for that now, thanks for the idea:

1 Like