Use this endpoint to send an uploaded file to a room. You can use this endpoint only after calling the Upload Media Files to a Room endpoint and getting the file ID.
Call it within 24 hours of the upload, using the same user account and room that uploaded the file. Otherwise, the request fails with invalid-file.
The authToken of the authenticated user.
The userId of the authenticated user.
The ID of the room where the file will be sent.
{
"alias": "test",
"avatar": "https://picsum.photos/200",
"description": "file upload description parameter",
"groupable": false,
"msg": "file upload message parameter",
"customFields": "{\"priority\": \"low\"}",
"emoji": ":one:",
"tmid": "ZSnsznbWKqppnRny5"
}Enter a file description.
Overrides the file name stored during upload.
Overrides the file content stored during upload.
The emoji you enter will be displayed as the avatar when the message is sent.
Whether or not multiple messages can be grouped.
Enter a message to be sent with the file.
If you want to send the file to a thread, enter the thread ID here.
Enter the avatar that will be displayed when the message is sent. You need the message-impersonate permission.
Enter the alias that will be used instead of your username when sending the message. You need the message-impersonate permission.
Enter custom fields if you have defined them in the Message settings.
OK
{
"message": {
"_id": "2ZABtFgt89fYYSw3Q",
"rid": "GENERAL",
"ts": "2025-12-17T05:49:55.825Z",
"msg": "",
"file": {
"_id": "69424442ddfe6ceaf280f93f",
"name": "44.jpg",
"type": "image/jpeg",
"size": 71224,
"format": "jpeg"
},
"files": [
{
"_id": "69424442ddfe6ceaf280f93f",
"name": "44.jpg",
"type": "image/jpeg",
"size": 71224,
"format": "jpeg"
},
{
"_id": "69424483ddfe6ceaf280f941",
"name": "thumb-44.jpg",
"type": "image/jpeg",
"size": 13473,
"format": "jpeg"
}
],
"attachments": [
{
"title": "44.jpg",
"title_link": "/file-upload/69424442ddfe6ceaf280f93f/44.jpg",
"title_link_download": true,
"image_dimensions": {
"width": 368,
"height": 360
},
"image_preview": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQgsW+OGY6OKR5o3hGJfr6n3n5JkvPdSpXal1BmuoReom//Z",
"image_url": "/file-upload/69424483ddfe6ceaf280f941/44.jpg",
"image_type": "image/jpeg",
"image_size": 71224,
"type": "file"
}
],
"u": {
"_id": "C38WSSzrGd2NCjzqJ",
"username": "test.cat",
"name": "test cat"
},
"_updatedAt": "2025-12-17T05:49:55.959Z",
"urls": []
},
"success": true
}Bad Request
{
"success": false,
"error": "[invalid-file]",
"errorType": "invalid-file"
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}