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

    Create metadata

    You can create items to add to the metadata of a user. Metadata stores additional user information such as phone number, email or a description of the 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"
        }
    }
    

    Responses

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

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

    Error

    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
    }