> ## 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. # Upload Media Files to a Room > Only users who have access to send messages in a room can upload files there. You can't upload any file that exceeds the configured [Maximum File Upload Size](https://docs.rocket.chat/docs/file-upload#general-file-upload-settings1). To upload media files to a room, follow these steps: 1. Call this endpoint first. This endpoint uploads the file to the database and returns a file object with the file ID and URL data. Save the file ID, you will need this to send the file in the next step. 2. To send the file to a room, use the Send Uploaded File to a Room endpoint. The upload is temporary and expires 24 hours after this call. If you don't confirm it within that window, it is discarded and never appears in the room. ## OpenAPI ````json POST /api/v1/rooms.media/{rid} { "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.media/{rid}": { "parameters": [ { "schema": { "type": "string", "example": "674eca3e43725ce31dd9a2e8" }, "name": "rid", "in": "path", "required": true, "description": "The ID of the room where the file will be uploaded." } ], "post": { "summary": "Upload Media Files to a Room", "tags": [ "Rooms" ], "responses": { "200": { "description": "OK", "headers": {}, "content": { "application/json": { "schema": { "type": "object", "properties": { "file": { "type": "object", "properties": { "_id": { "type": "string" }, "url": { "type": "string" } } }, "success": { "type": "boolean" } } }, "examples": { "Example": { "value": { "file": { "_id": "67109d6c25682c7469486008", "url": "/file-upload/67109d6c25682c7469486008/Screenshot%202024-10-15%20at%2010.17.39.png" }, "success": true } } } } } } }, "operationId": "post-api-v1-rooms.media", "description": "Only users who have access to send messages in a room can upload files there. \n\nYou can't upload any file that exceeds the configured [Maximum File Upload Size](https://docs.rocket.chat/docs/file-upload#general-file-upload-settings1).\n\nTo upload media files to a room, follow these steps:\n 1. Call this endpoint first. This endpoint uploads the file to the database and returns a file object with the file ID and URL data. Save the file ID, you will need this to send the file in the next step.\n 2. To send the file to a room, use the Send Uploaded File to a Room endpoint.\n\n The upload is temporary and expires 24 hours after this call. If you don't confirm it within that window, it is discarded and never appears in the room. ", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "file" ], "properties": { "file": { "type": "string", "format": "binary", "description": "The file to upload." }, "content": { "type": "string", "description": "A JSON-encoded object containing additional metadata for the uploaded file." } } } } } } } } }, "components": { "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" } } } } ````