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

    Get metadata

    Copy link

    You can retrieve a specific or all 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
    // When retrieving all items of the user metadata.
    GET https://api-{application_id}.sendbird.com/v3/users/{user_id}/metadata
    
    // When retrieving a specific item by its key of the user metadata.
    GET https://api-{application_id}.sendbird.com/v3/users/{user_id}/metadata/{key}
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    user_id

    string

    Specifies the unique ID of a user.

    OptionalTypeDescription

    key

    string

    Specifies the key of a metadata item. If not specified, all items of the metadata are returned. If specified, only the item that has the specified value is returned. Urlencoding a key is recommended.

    keys

    array

    Specifies an array of one or more keys for items of the metadata. If not specified, all items of the metadata are returned. If specified, only the items that have the specified values are returned. Urlencoding each key is recommended.

    ../metadata?keys=font_preference,font_color
    

    Responses

    Copy link

    If successful, this action returns items of the metadata 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
    }