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

    Create metadata

    Copy link

    You can create items to add to the metadata of a user. Metadata stores additional user information such as their preference settings.

    Note: Do not use PII (Personally Identifiable Information) such as user email address, legal name, or phone number for data security and privacy reason.


    HTTP request

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

    Parameters

    Copy link

    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

    Copy link

    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.

    * Do not use PII (Personally Identifiable Information) such as user email address, legal name, or phone number as it could jeopardize data security and privacy.

    {
        "metadata": {
            "font_preference": "times new roman",
            "font_color": "black"
        }
    }
    

    Responses

    Copy link

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

    {
        "font_preference": "times new roman",
        "font_color": "gray" 
    }
    

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

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