Mattermost Peer-to-Peer Forum

Add user to channel without being its user


#1

Hello,
Is there a possibility to add a user to a channel without being its user ? (using APIv4 endpoints, maybe with some special permissions?)


#2

Hi @LusCruz,

You can use this CLI command: https://docs.mattermost.com/administration/command-line-tools.html#mattermost-channel-add.

You can also use API: https://api.mattermost.com/#tag/channels%2Fpaths%2F~1channels~1{channel_id}~1members%2Fpost.


#3

I mean if I can add a user to a channel without being myself a user?
I have an application that uses a ‘bot’ which adds selected user to a channel (would like to add the users to a channel where the bot is not an owner nor a user)


#4

I believe at least the CLI command should work even if you’re not a member of the channel, but you’ll need to know the channel ID.