> ## 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 Files to Room

> Upload files to an Omnichannel room.

## OpenAPI

````json POST /api/v1/livechat/upload/{rid}
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Omnichannel"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "Omnichannel Users"
    },
    {
      "name": "Omnichannel Agents"
    },
    {
      "name": "Omnichannel Monitors"
    },
    {
      "name": "Omnichannel Visitors"
    },
    {
      "name": "Omnichannel Contacts"
    },
    {
      "name": "Omnichannel Rooms"
    },
    {
      "name": "Omnichannel Departments"
    },
    {
      "name": "Omnichannel Custom Fields"
    },
    {
      "name": "Omnichannel Business Hours"
    },
    {
      "name": "Omnichannel Priorities"
    },
    {
      "name": "Omnichannel Tags"
    },
    {
      "name": "Omnichannel Units"
    },
    {
      "name": "SLA Policies"
    },
    {
      "name": "Canned Responses"
    },
    {
      "name": "Omnichannel Transcript"
    },
    {
      "name": "Omnichannel Statistics"
    },
    {
      "name": "Omnichannel Agent Stats"
    },
    {
      "name": "Omnichannel Dashboards"
    },
    {
      "name": "Reports"
    },
    {
      "name": "Omnichannel Inquiries"
    },
    {
      "name": "Omnichannel Webhooks"
    },
    {
      "name": "Livechat"
    },
    {
      "name": "Livechat Appearance"
    },
    {
      "name": "Livechat Triggers"
    },
    {
      "name": "Livechat Messages"
    },
    {
      "name": "Livechat Page Visited"
    }
  ],
  "paths": {
    "/api/v1/livechat/upload/{rid}": {
      "post": {
        "summary": "Upload Files to Room",
        "description": "Upload files to an Omnichannel room.",
        "operationId": "post-api-v1-livechat-upload",
        "parameters": [
          {
            "name": "x-visitor-token",
            "in": "header",
            "description": "The visitor token",
            "required": "true",
            "schema": {
              "type": "string"
            },
            "example": "iNKE8a6k6cjyPyOyI"
          },
          {
            "name": "rid",
            "in": "path",
            "description": "The room ID.",
            "required": "true",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "The file to be uploaded."
                  },
                  "description": {
                    "type": "string",
                    "description": "The file description."
                  }
                },
                "required": [
                  "file"
                ]
              },
              "examples": {
                "Example 1": {
                  "value": {
                    "file": "/home/rodriq/Desktop/cod.png",
                    "description": "image file description here"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "rid": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    },
                    "file": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ts": {
                            "type": "string"
                          },
                          "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"
                          },
                          "description": {
                            "type": "string"
                          },
                          "descriptionMd": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "alias": {
                      "type": "string"
                    },
                    "ts": {
                      "type": "string"
                    },
                    "u": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "_updatedAt": {
                      "type": "string"
                    },
                    "urls": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "mentions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "newRoom": {
                      "type": "boolean"
                    },
                    "showConnecting": {
                      "type": "boolean"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success Example": {
                    "value": {
                      "_id": "CeswhhAKTQMsnEbc8",
                      "rid": "cbjQCtywHbuTYzmLx",
                      "msg": "",
                      "token": "932a1c3019aeeaa9b687bb04b979d",
                      "file": {
                        "_id": "uredcLri4GdehDQnD",
                        "name": "globe.png",
                        "type": "image/png"
                      },
                      "attachments": [
                        {
                          "ts": "1970-01-01T00:00:00Z",
                          "title": "globe.png",
                          "title_link": "/file-upload/uredcLri4GdehDQnD/globe.png",
                          "title_link_download": "true",
                          "image_dimensions": {
                            "width": "1746",
                            "height": "1624"
                          },
                          "image_preview": "/9j/2wBDAAYEBQYFBAYGzMKHSdwCQf2EhyBetVviuOVGrulRJ9NsHpQPgQH/9k=",
                          "image_url": "/file-upload/uredcLri4GdehDQnD/globe.png",
                          "image_type": "image/png",
                          "image_size": "562975",
                          "type": "file",
                          "description": "Here is the file",
                          "descriptionMd": [
                            {
                              "type": "PARAGRAPH",
                              "value": [
                                {
                                  "type": "PLAIN_TEXT",
                                  "value": "Here is the file"
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "alias": "James",
                      "ts": "2023-03-21T16:21:39.131Z",
                      "u": {
                        "_id": "6410766605957d866e0fcf37",
                        "username": "guest-3",
                        "name": "James"
                      },
                      "_updatedAt": "2023-03-21T16:21:39.173Z",
                      "urls": [],
                      "mentions": [],
                      "channels": [],
                      "newRoom": "false",
                      "showConnecting": "false",
                      "success": "true"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "success": "false",
                      "error": "unauthorized"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Omnichannel Rooms"
        ]
      }
    }
  }
}
````

