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

    Create metadata

    Copy link

    This action creates key-value items you can use to store additional information about a channel.

    Note: See this page to learn more about differences among data properties.


    HTTP request

    Copy link
    POST https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/metadata
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_type

    string

    Specifies the type of a channel. Acceptable values are open_channels and group_channels.

    channel_url

    string

    Specifies the URL of a channel to store the metadata in.


    Request body

    Copy link

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

    Properties
    RequiredTypeDescription

    metadata

    nested object

    Specifies a JSON object that stores key-value items. The key can't contain a comma (,) and its length is limited to 128 characters. The value must be a string and its length is limited to 190 characters.

    OptionalTypeDescription

    include_ts

    boolean

    Determines whether to include the timestamp of when metadata has been created in the response. (Default: false)

    {
        "metadata": {
            "background_image": "https://sendbird.com/main/img/bg/theme_013.png",
            "text_size": "large",
            "description": "A chat room for discussing the upcoming project."
        },
        "include_ts": true
    }
    

    Responses

    Copy link

    If successful, this action returns the stored metadata in the response body.

    {
        "metadata": {
            "background_image": "https://sendbird.com/main/img/bg/theme_013.png",
            "text_size": "large",
            "description": "A chat room for discussing the upcoming project."
        },
        "include_ts": 1606110872558
    }
    

    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
    }