---
title: "Upload Media Files to a Room"
slug: "upload-media-files-to-a-room"
updated: 2026-06-01T06:32:04Z
published: 2026-06-01T06:32:04Z
stale: true
---

> ## 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

Post/api/v1/rooms.media/{rid}

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, we will need this to send the file in the next step.
2. To send the file to a room, use the [Confirm Uploaded File](https://developer.rocket.chat/apidocs/check-uploaded-file) endpoint.

Header parametersX-Auth-TokenstringRequired

The `authToken` of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-IdstringRequired

The `userId` of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ

Path parametersridstringRequired

The room ID.

Example674eca3e43725ce31dd9a2e8

Body parameters<select class='api-response-data' aria-label='Media type'><option value='b4c37929-d6f8-4495-a560-3b69eccb792e'>multipart/form-data</option>
</select>object  filestring  (binary)    Required

The file to upload.

Responses200

OK

<select class='api-response-data' aria-label='Media type'><option value='fb3c4b49-a0c8-4818-ab63-6dbac85ce6a8'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='abe0831b-4b4b-4bd0-8de6-409c2bb388c7'>Example</option>
</select>Example

```json
{
  "file": {
    "_id": "67109d6c25682c7469486008",
    "url": "/file-upload/67109d6c25682c7469486008/Screenshot%202024-10-15%20at%2010.17.39.png"
  },
  "success": true
}
```

Expand Allobject  fileobject  _idstring    
urlstring    

successboolean
