Chat / Platform API
Current version: v3
    Chat Platform API v3
    Chat Platform API
    Chat
    Platform API
    Home
    /
    Chat
    /
    Platform API
    /
    Channel

    Create an open channel

    You can create an open channel that facilitates conversations for millions of users. Open channels allow a seamless chat experience possible for all participants by using dynamic partitioning which creates subchannels that each handle up to tens of thousands of participants.

    Because users don't need invitations to join open channels, short-lived live events like concerts or live streams that don't require a sustained membership are good use cases for open channels.


    HTTP request

    POST https://api-{application_id}.sendbird.com/v3/open_channels
    

    Request body

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

    Optional
    Property nameTypeDescription

    name

    string

    Specifies the channel topic, or the name of the channel. The length is limited to 191 characters. (Default: open channel)

    channel_url

    string

    Specifies the URL of the channel. Only numbers, letters, underscores, and hyphens are allowed. The allowed length is 4 to 100 characters, inclusive. If not specified, a URL is automatically generated.

    cover_url

    string

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

    cover_file

    file

    Uploads a file for the channel's 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_ephemeral

    boolean

    Determines whether to preserve messages in the channel to later retrieve the chat history. If set to true, messages in the channel aren't saved in the Sendbird database and chat history can't be retrieved. (Default: false)

    is_dynamic_partitioned

    boolean

    Determines whether the channel to be created is an open channel based on a dynamic partitioning structure. The value of true indicates that the open channel can create several subchannels in order to accommodate a massive number of users. This property is set to true by default for Sendbird applications created after December 15, 2020.

    operator_ids[]

    array of strings

    Specifies an array of user IDs to register as operators of the channel. The maximum number of operators allowed per channel is 100. Operators can delete any messages in the channel and receives all messages that have been throttled.

    * Operators can't view messages that have been moderated by the domain filter or profanity filter. Only the sender will be notified that the message has been blocked.

    operators[]

    array of strings

    (Deprecated) Specifies the string IDs of the users registered as channel operators. Operators can delete any messages in the channel and even receive all messages that have been throttled.

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

    {
        "name": "Live streaming show on channel 5!",
        "channel_url": "monday_channel_5_at_10_pm",
        "cover_url": "https://sendbird.com/main/img/cover/cover_02.jpg",
        "data": "{event_trigger:100,500,1000,2000}",
        "operator_ids": ["Alek", "Leslie"],
        "custom_type": "Live"
    }
    

    Responses

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

    {
        "name": "Live streaming show on channel 5!",
        "channel_url": "monday_channel5_at_10_pm",
        "custom_type": "live",
        "is_ephemeral": false,
        "participant_count": 0,
        "max_length_message": 5000,
        "created_at": 1484787758,
        "cover_url": "https://sendbird.com/main/img/cover/cover_02.jpg",
        "data": "{event_trigger:100,500,1000,2000}",
        "operators": [
            {
                "user_id": "Alek",
                "nickname": "Alexander the Great",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_26_512px.png"
            },
            {
                "user_id": "Leslie",
                "nickname": "Crystal",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_27_512px.png"
            }
        ],
        "freeze": false
    }
    

    Error

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

    {
        "message": "Invalid value: \"channel_url. It takes only alphabets, numbers, hyphen and underscore.\".",
        "code": 400111,
        "error": true
    }