Media

Create a new `mxc://` URI without uploading the content.

Creates a new mxc:// URI, independently of the content being uploaded. The content must be provided later via PUT /_matrix/media/v3/upload/{serverName}/{mediaId}.

The server may optionally enforce a maximum age for unused IDs, and delete media IDs when the client doesn't start the upload in time, or when the upload was interrupted and not resumed in time. The server should include the maximum POSIX millisecond timestamp to complete the upload in the unused_expires_at field in the response JSON. The recommended default expiration is 24 hours which should be enough time to accommodate users on poor connection who find a better connection to complete the upload.

As well as limiting the rate of requests to create mxc:// URIs, the server should limit the number of concurrent pending media uploads a given user can have. A pending media upload is a created mxc:// URI where (a) the media has not yet been uploaded, and (b) has not yet expired (the unused_expires_at timestamp has not yet passed). In both cases, the server should respond with an HTTP 429 error with an errcode of M_LIMIT_EXCEEDED.

post/_matrix/media/v1/create

Request

Response

The mxc:// URI for the uploaded content.

content_uristring mx-mxc-uri required

The mxc:// URI at which the content will be available, once it is uploaded.

unused_expires_atinteger

The timestamp (in milliseconds since the unix epoch) when the generated media id will expire, if media is not uploaded.

Example response

{
  "content_uri": "mxc://example.com/AQwafuaFswefuhsfAFAgsw",
  "unused_expires_at": 1647257217083
}

Changes

No recorded changes to this operation across all 1 revision of this API.