Migration

Switching from an in-house (or other) solution to SendBird? No problem! We got you covered. You can migrate your previous chat messages to SendBird using the Platform API.


Migrate messages

You can migrate your old messages into a target channel.

As this is one of SendBird's Premium Features, please contact our sales team for further assistance.

POST https://{region_identifier}.sendbird.com/v3/migration/{target_channel_url}

Note: If you want region_identifier for your app, sign in to the SendBird Dashboard, select the application, open the Overview, and see the App Credentials > API URL.

Text message
Property name Type Description
message_type string The type of the message: MESG. (Default: MESG)
messages[] list A list of messages you want to migrate into the channel.
messages[].user_id string The ID of the user sending the message. Note that this user must exist in the SendBird user database. or else an error is returned.
messages[].message string The message body.
messages[].custom_type (optional) string A field you can use to further subclassify your messages. The length is limited to 128 bytes. (Default: "")
messages[].data (optional) string Additional data contained within the message. This can be structured data such as a JSON object.
messages[].timestamp long The time in which the message was sent, Unix milliseconds format. You can later sort the messages based on the timestamp provided here.
File message
Property name Type Description
message_type string The type of the message: FILE.
messages[] list A list of messages you want to migrate into the channel.
messages[].user_id string The ID of the user sending the message. Note that this user must exist in the SendBird user database. or else an error is returned.
messages[].url string The URL of the file.
messages[].file_name (optional) string This field is not automatically generated, so you should specify the file name.
messages[].file_size (optional) string This field is not automatically generated, so you should specify the file size.
messages[].file_type (optional) string This field is not automatically generated, so you should specify the media type of the file.
messages[].custom_type (optional) string A field you can use to further subclassify your messages. The length is limited to 128 bytes. (Default: "")
messages[].custom_field (optional) string Additional data that you can store within your file resource.
messages[].timestamp long The time in which the message was sent, Unix milliseconds format. You can later sort the messages based on the timestamp provided here.
Admin message
Property name Type Description
message_type string The type of the message: ADMM.
message string The message body.
custom_type (optional) string A field you can use to further subclassify your messages. The length is limited to 128 bytes. (Default: "")
data (optional) string Additional data that can be embedded within a message.
is_silent (optional) boolean If true, then the channel's unread_message_count and last_message remains unchanged after the message has been sent. (Default: false)
{
    "messages": [
        {
            "user_id": "terry5",
            "message": "hi",
            "data": "",
            "custom_type": "sub_type1",
            "timestamp": 1484208033720
        },
        {
            "message_type": "MESG",
            "user_id": "terry5",
            "message": "i'm hungry",
            "data": "",
            "custom_type": "sub_type1",
            "timestamp": 1484208038411
        },
        {
            "message_type": "FILE",
            "user_id": "terry5",
            "url": "https://sendbird.com/main/img/profiles/profile_01_512px.png",
            "file_name": "duck.jpg",
            "file_size": 256,
            "custom_type": "sub_type2",
            "timestamp": 1484208041523
        },
        {
            "message_type": "ADMM",
            "message": "Jason has entered the room.",
            "data": "",
            "custom_type": "admin_type",
            "timestamp": 1484208047560
        }
    ]
}
Status: 200 OK
{}