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

    Update a message

    Copy link

    Updates specific information on a message.


    HTTP request

    Copy link
    PUT https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/messages/{message_id}
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_type

    string

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

    channel_url

    string

    Specifies the URL of the target channel.

    message_id

    long

    Specifies the unique ID of the message to update.


    Request body

    Copy link

    The following tables list the properties of an HTTP request that this action supports for updating a text message, file message, and admin message.

    List of properties for updating a text message

    Copy link
    RequiredTypeDescription

    message_type

    string

    Specifies the type of the message. The value of MESG represents a text message.

    OptionalTypeDescription

    message

    string

    Specifies the content of the message.

    custom_type

    string

    Specifies a custom message type used for message grouping. The length is limited to 128 characters.

    * Custom types are also used to segment metrics within Sendbird's Advanced analytics, which enables the sub-classification of data views.

    data

    string

    Specifies additional message information such as custom font size, font type, or JSON formatted string.

    mention_type

    string

    Specifies whether to mention specific users or all users in the channel. Acceptable values are users and channel. If set to users, up to ten users in the mentioned_user_ids property below are notified of the mention. If set to channel, up to ten users in the channel are notified of the mention. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of IDs of the users to mention in the message. This property is used only when mention_type is users.

    List of properties for updating a file message

    Copy link
    Properties
    RequiredTypeDescription

    message_type

    string

    Specifies the type of the message. The value of FILE represents a file message.

    OptionalTypeDescription

    url

    string

    Specifies the URL of the file hosted on the server of your own or other third-party companies.

    custom_type

    string

    Specifies a custom message type used for message grouping. The length is limited to 128 characters.

    * Custom types are also used within Sendbird's Advanced analytics to segment metrics, which enables the sub-classification of data views.

    data

    string

    Specifies additional message information regarding the file in JSON format.

    mention_type

    string

    Specifies whether to mention specific users or all users in the channel. Acceptable values are users and channel. If set to users, up to ten users in the mentioned_user_ids property below are notified of the mention. If set to channel, up to ten users in the channel are notified of the mention. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of IDs of the users to mention in the message. This property is used only when mention_type is users.

    List of properties for updating an admin message

    Copy link
    Properties
    RequiredTypeDescription

    message_type

    string

    Specifies the type of the message. The value of ADMM represents an admin message.

    OptionalTypeDescription

    message

    string

    Specifies the content of the message.

    custom_type

    string

    Specifies a custom message type used for message grouping. The length is limited to 128 characters.

    * Custom types are also used within Sendbird's Advanced analytics to segment metrics, which enables the sub-classification of data views.

    data

    string

    Specifies additional message information such as custom font size, font type, or JSON formatted string.

    mention_type

    string

    Specifies whether to mention specific users or all users in the channel. Acceptable values are users and channel. If set to users, up to ten users in the mentioned_user_ids property below are notified of the mention. If set to channel, up to ten users in the channel are notified of the mention. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of IDs of the users to mention in the message. This property is used only when mention_type is users.

    {
        "message_type": "MESG",
        "mentioned_user_ids": ["joanna"]
    }
    

    Response

    Copy link

    If successful, this action returns an updated message resource in the response body.

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