> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Send Uploaded File to a Room > 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`. ## OpenAPI ````json POST /api/v1/rooms.mediaConfirm/{rid}/{fileId} { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Rooms" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Channels" }, { "name": "Directory" }, { "name": "Groups" }, { "name": "Rooms" }, { "name": "Teams" }, { "name": "Room Invites" }, { "name": "Subscriptions" }, { "name": "ABAC" } ], "paths": { "/api/v1/rooms.mediaConfirm/{rid}/{fileId}": { "parameters": [ { "schema": { "type": "string", "example": "66cd971f6fcbb8e8b3cf8e69" }, "name": "rid", "in": "path", "required": true, "description": "The ID of the room where the file will be sent." }, { "schema": { "type": "string", "example": "69424442ddfe6ceaf280f93f" }, "name": "fileId", "in": "path", "required": true, "description": "The file ID you get from the Upload Files to a Room endpoint." } ], "post": { "summary": "Send Uploaded File to a Room", "tags": [ "Rooms" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "object", "properties": { "_id": { "type": "string" }, "rid": { "type": "string" }, "ts": { "type": "string" }, "msg": { "type": "string" }, "file": { "type": "object", "properties": { "_id": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string" }, "size": { "type": "integer" }, "format": { "type": "string" } } }, "files": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string" }, "size": { "type": "integer" }, "format": { "type": "string" } } } }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "title_link": { "type": "string" }, "title_link_download": { "type": "boolean" }, "image_dimensions": { "type": "object", "properties": { "width": { "type": "integer" }, "height": { "type": "integer" } } }, "image_preview": { "type": "string" }, "image_url": { "type": "string" }, "image_type": { "type": "string" }, "image_size": { "type": "integer" }, "type": { "type": "string" } } } }, "u": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" }, "name": { "type": "string" } } }, "_updatedAt": { "type": "string" }, "urls": { "type": "array", "items": { "type": "object", "properties": {} } } } }, "success": { "type": "boolean" } } }, "examples": { "Example 1": { "value": { "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 } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Example 1": { "value": { "success": false, "error": "[invalid-file]", "errorType": "invalid-file" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } }, "operationId": "post-api-v1-rooms.mediaConfirm-rid-fileId", "description": "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.\n\nCall 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`.", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "description": { "type": "string", "description": "Enter a file description.", "example": "file description" }, "fileName": { "type": "string", "description": "Overrides the file name stored during upload.", "example": "renamed-file.jpg" }, "fileContent": { "type": "object", "description": "Overrides the file content stored during upload." }, "emoji": { "type": "string", "description": "The emoji you enter will be displayed as the avatar when the message is sent.", "example": ":one:" }, "groupable": { "type": "boolean", "description": "Whether or not multiple messages can be grouped." }, "msg": { "type": "string", "description": "Enter a message to be sent with the file.", "example": "hello world" }, "tmid": { "type": "string", "description": "If you want to send the file to a thread, enter the thread ID here.", "example": "ZSnsznbWKqppnRny5" }, "avatar": { "type": "string", "description": "Enter the avatar that will be displayed when the message is sent. You need the `message-impersonate` permission.", "example": "https://picsum.photos/200" }, "alias": { "type": "string", "description": "Enter the alias that will be used instead of your username when sending the message. You need the `message-impersonate` permission.", "example": "test user" }, "customFields": { "type": "string", "description": "Enter custom fields if you have defined them in the Message settings.", "example": "{\\\"priority\\\": \\\"low\\\"}" } } }, "examples": { "Example": { "value": { "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" } } } } } } } } }, "components": { "responses": { "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Authorization Error": { "value": { "success": false, "error": "You must be logged in to do this." } } } } } } }, "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The `userId` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "rbAXPnMktTFbNpwtJ" } } } } ````