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

    Create metadata

    Creates items to add to the metadata of a user.


    HTTP request

    POST https://api-{application_id}.sendbird.com/v3/users/{user_id}/metadata
    

    Parameters

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    user_id

    string

    Specifies the unique ID of a user.


    Request body

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

    Required
    Property nameTypeDescription

    metadata

    nested object

    Specifies a JSON object that stores key-value items. The key must not have a comma (,) and its length is limited to 128 characters. The value must be a string and its length is limited to 190 characters. This property can have up to 5 items.

    {
        "metadata": {
            "location": "Washington",
            "marriage": "N",
            "likesChocolateMuffin": "Y"
        }
    }
    

    Response

    If successful, this action returns a metadata added to a user in the response body.

    {
        "location": "Washington",
        "marriage": "N",
        "likesChocolateMuffin": "Y"
    }
    

    In the case of an error, an error object is returned. A detailed list of error codes is available here.