/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Update a group channel

    Copy link

    You can update information about a group channel or a Supergroup channel using this API. You can't make any changes to the members of a channel with this API. To change members, see invite as members instead. See this page to learn more about channel types.


    HTTP request

    Copy link
    PUT https://api-{application_id}.sendbird.com/v3/group_channels/{channel_url}
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_url

    string

    Specifies the URL of the channel.


    Request body

    Copy link

    The following table lists the properties of an HTTP request that this action supports.

    Note: If you convert a group channel to a Supergroup channel by changing a value of is_super to true, you won't be able to change it back to a group channel.

    Optional
    Property nameTypeDescription

    name

    string

    Specifies the name of the channel or the channel topic. The length is limited to 191 characters.

    cover_url

    string

    Specifies the unique URL of the channel's cover image. The length is limited to 2,048 characters.

    cover_file

    file

    Uploads the file for the channel cover image.

    custom_type

    string

    Specifies the custom channel type which is used for channel grouping. The length is limited to 128 characters.

    * Custom types are also used within Sendbird's Advanced analytics to segment metrics as channel metrics can be grouped by channel custom type.

    data

    string

    Specifies additional channel information such as a long description of the channel or JSON formatted string.

    is_distinct

    boolean

    Determines whether to reuse an existing channel or create a new channel when creating a channel with the same group of members. If set to true, returns an existing channel with the same members or creates a new channel if no such channel exists. The Sendbird server can also use the custom channel type in the custom_type property if specified along with the users. If set to false, the Sendbird server always creates a new channel with a combination of the users as well as the channel custom type if specified. (Default: false)

    * Under this property, the Sendbird server doesn't distinguish channels based on other properties such as channel URL or channel name.

    is_public

    boolean

    Determines whether to allow a user to join the channel without an invitation. (Default: false)

    is_super

    boolean

    Determines whether to allow the channel to accommodate 100 or more members. If set to true, creates a Supergroup channel. (Default: false)

    * Supergroup channels are not supported with the is_distinct property and the is_distinct property is set to false by default.

    access_code

    string

    This parameter can only be used when the channel operator creates a public group channel. If the channel operator uses an access code for the corresponding type of channel, users will be required to enter the access code to join the channel. If specified, the is_access_code_required property of the channel resource is automatically set to true.

    operator_ids[]

    array of strings

    Specifies an array of one or more IDs of users to register as operators of the channel. Users can be registered as operators regardless of whether they are channel members. The maximum allowed number of operators per channel is 100.

    Note: If you want to upload a profile picture by passing an image file instead of a URL, see Multipart requests.


    Responses

    Copy link

    If successful, this action returns an updated group channel resource in the response body.

    {
        "name": "Saturday soccer members",
        "channel_url": "private_chat_room_424",
        "cover_url": "https://sendbird.com/main/img/cover/cover_08.jpg",
        "custom_type": "sports",
        "unread_message_count": 0,
        "data": "",
        "is_distinct": true,
        "is_public": false,
        "is_super": false,
        "is_ephemeral": false,
        "is_access_code_required": false,
        "member_count": 4,
        "joined_member_count": 0,
        "members": [
            {
                "user_id": "James",
                "nickname": "Knight",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_08_512px.png",
                "is_active": true,
                "is_online": false,
                "last_seen_at": 1530237133254,
                "state": "invited",
                "role": "",             // Either 'operator' or null. The value of null indicates that this user is a normal channel member.
                "metadata": {
                    "font_preference": "times new roman",
                    "font_color": "black"
                }
            },
            {
                "user_id": "Jay",
                "nickname": "Rooster",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_17_512px.png",
                "is_active": true,
                "is_online": false,
                "friend_discovery_key": ["543-098-4567", "010-4567-6543"],
                "last_seen_at": 1530232836311,
                "state": "joined",
                "role": "",         // Either 'operator' or null. The value of null indicates that this user is a normal channel member.
                "metadata": {
                    "font_preference": "times new roman",
                    "font_color": "black"
                }
            },
            {
                "user_id": "Jeff",
                "nickname": "OldBoy",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_22_512px.png",
                "is_active": true,
                "is_online": true,
                "last_seen_at": 0,
                "state": "",
                "role": "operator",     // Either 'operator' or null. The value of null indicates that this user is a normal channel member.
                "metadata": {
                    "font_preference": "times new roman",
                    "font_color": "black"
                }
            },
            {
                "user_id": "Young",
                "nickname": "Sportsman",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_23_512px.png",
                "is_active": true,
                "is_online": true,
                "last_seen_at": 0,
                "state": "invited",
                "role": "",             // Either 'operator' or null. The value of null indicates that this user is a normal channel member.
                "metadata": {
                    "font_preference": "times new roman",
                    "font_color": "black"
                }
            }
        ],
        "operators": [
            {
                "user_id": "Jeff",
                "nickname": "OldBoy",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_22_512px.png",
                "is_active": true,
                "is_online": true,
                "last_seen_at": 0,
                "state": "",
                "metadata": {}
            }
        ],
        "max_length_message": 500,
        "last_message": null,
        "created_at": 1543468122,
        "freeze": false,
        "channel": {
            ...  # This key has been deprecated and only exists for backward compatibility.
        }
    }
    

    In the case of an error, an error object like below is returned. See the error codes section for more details.

    {
        "message": "\"Channel\" not found.",
        "code": 400201,
        "error": true
    }