Channel Users
Last updated
Last updated
Using the Team Channel Users endpoint you are able to add and remove individual users from a channel. If you wish to set the entire list of users for a channel use the endpoint.
Get all users that belong to a specified channel
GET
/channels/{channel_id}/users
The maximum number of users that will be returned in a single request is 100. If there are more than 100 users you can specify a page
parameter great than 1 to get more data. The response will contain information about how many pages of data are available.
Parameter
Default
Description
page
1
Specifies which page of results to return
per_page
100
Specifies maximum number of channels to return in a given request. The maximum you can specify is 100.
A successful response will have an HTTP status of 200
Property
Description
page
Current page number of data returned
per_page
Maximum number of users returned per page
total_pages
Number of pages of data available
response_count
The number of users that were returned from the given request
total_count
Total number of users that are available
channel
Information about the specified channel
users
Collection of users
The sample response below indicates that you have received the second page of results. There are 2 pages available. The current page contains 21 of the total 121 channels.
PUT
/channels/{channel_id}/users
Parameter
Description
channel_id
Id of the channel you are adding a user to.
Parameter
Required
Description
id
Yes
Id of the user you are adding to the channel
A successful channel user add response will have an HTTP status of 200
. The payload of the response is the same as you will see when requesting information about a specific user.
If there was a problem creating the channel user you will receive a response that contains status and message properties.
Remove a specified user from a specified channel
DELETE
/channels/{channel_id}/users/{user_id}
Parameter
Description
channel_id
Id of the channel you are removing a user to.
user_id
Id of the user you wish to remove from the channel.
A successful channel creation response will have an HTTP status of 200
. The payload of the response is the same as you will see when requesting information about a specific user.
Use this endpoint to set a channel to include a specific set of users. Any current channel users that are not specified in your request body will be removed from the channel.
PUT
/channels/{channel_id}/users/replace
Parameter
Description
channel_id
Id of the channel in which you are replacing users on.
Parameter
Required
Description
users
Yes
Array of user objects. Each user object must contain and id. Example: [{id:123456}, {id: 98765}]
A successful channel user replace response will have an HTTP status of 200
. The payload of the response is the same as you will see when requesting information about a specific channel.
If there was a problem replacing the channel users you will receive a response that contains status and message properties.