---
title: "Upload some content to the content repository."
method: POST
path: "/_matrix/media/v3/upload"
tags: ["Media"]
---

# Upload some content to the content repository.

`POST /_matrix/media/v3/upload`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/media/v3/upload`
- Auth: one of:
  - API key in query parameter `access_token`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/matrix/apis/matrix-client-server-api/docs/_matrix/media/v3/upload/post.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `filename` string

## Headers

- `Content-Type` string

## Request body `application/octet-stream`

- string: The content to be uploaded.

## Response `200`

The [`mxc://` URI](https://spec.matrix.org/v1.19/client-server-api/#matrix-content-mxc-uris) for the uploaded content.

- object
  - `content_uri` string, mx-mxc-uri, required: The [`mxc://` URI](https://spec.matrix.org/v1.19/client-server-api/#matrix-content-mxc-uris) to the uploaded content.

## Other responses

- `403`: The user does not have permission to upload the content. Some reasons for this error include: - The server does not permit the file type. - The user has reached a quota for uploaded content.
- `413`: The uploaded content is too large for the server.
- `429`: This request was rate-limited.

---

[API](https://skmtc.dev/matrix/apis/matrix-client-server-api.md) - [All operations](https://skmtc.dev/matrix/apis/matrix-client-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/matrix/apis/matrix-client-server-api/revisions/c7fe4072c681?raw)
