Send Uploaded File to a Room

Prev Next
Post
/api/v1/rooms.mediaConfirm/{rid}/{fileId}

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.

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Path parameters
rid
stringRequired

The ID of the room where the file will be sent.

Example66cd971f6fcbb8e8b3cf8e69
fileId
stringRequired

The file ID you get from the Upload Files to a Room endpoint.

Example69424442ddfe6ceaf280f93f
Body parameters
Example
{
  "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"
}
Expand All
object
description
string

Enter a file description.

Examplefile description
fileName
string

Overrides the file name stored during upload.

Examplerenamed-file.jpg
fileContent
object

Overrides the file content stored during upload.

emoji
string

The emoji you enter will be displayed as the avatar when the message is sent.

Example:one:
groupable
boolean

Whether or not multiple messages can be grouped.

msg
string

Enter a message to be sent with the file.

Examplehello world
tmid
string

If you want to send the file to a thread, enter the thread ID here.

ExampleZSnsznbWKqppnRny5
avatar
string

Enter the avatar that will be displayed when the message is sent. You need the message-impersonate permission.

Examplehttps://picsum.photos/200
alias
string

Enter the alias that will be used instead of your username when sending the message. You need the message-impersonate permission.

Exampletest user
customFields
string

Enter custom fields if you have defined them in the Message settings.

Example{\"priority\": \"low\"}
Responses
200

OK

Example 1
{
  "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
}
Expand All
object
message
object
_id
string
rid
string
ts
string
msg
string
file
object
_id
string
name
string
type
string
size
integer
format
string
files
Array of object
object
_id
string
name
string
type
string
size
integer
format
string
attachments
Array of object
object
title
string
title_link
string
title_link_download
boolean
image_dimensions
object
width
integer
height
integer
image_preview
string
image_url
string
image_type
string
image_size
integer
type
string
u
object
_id
string
username
string
name
string
_updatedAt
string
urls
Array of object
object
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "[invalid-file]",
  "errorType": "invalid-file"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string