Upload to Reserved Media ID
matrix.upload_to_media_id
ActionChat & messagingconnection required
Calls the Matrix API with the connection's credentials.
Upload a file's bytes into an mxc:// URI reserved earlier.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- Bearer token
- Providers
- Matrix
- Secret shape
- the account access token, or {"access_token": "…"}
- Config it needs
- base_url, user_id, default_room_id
- Resolved by
- config.connection_id, else node.connection_id
Configuration
5 fields, 2 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
mxc_uri The mxc:// URI matrix.create_media_id reserved. | string | Yes | — | — | mxc://example.org/AbCdEf |
file_content The file's bytes: base64 when content_encoding is 'base64' (e.g. {{ $json.file_content }} from a download node), otherwise text. | string | Yes | — | — | — |
content_encoding Set to 'base64' when body is a base64 blob (e.g. from a download_archive node). Defaults to the upstream file's encoding, else text. | string | No | — | one of "text", "base64" | — |
filename File name stored with the upload and shown in the room. | string | No | — | — | — |
content_type MIME type sent with the upload; defaults to application/octet-stream. | string | No | — | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"mxc_uri": "mxc://example.org/AbCdEf"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
uploaded True once the bytes were stored. | boolean | — |
content_uri The mxc:// URI that now holds the file. | string | — |
size Raw size in bytes of the uploaded content. | number | — |
{
"content_uri": "",
"size": 0,
"uploaded": false
}Notes
- The connection's base_url is the homeserver (e.g. https://matrix.example.org), not the account's server name; the two differ whenever .well-known delegation is in use.
- Rooms are addressed by room id (!abc:server). Resolve a #alias:server with matrix.resolve_room_alias first, or set a default room on the connection.
- A reserved id accepts bytes once: a second upload to the same URI is refused with 409 and fails the step.
- The reserve-then-upload pair is Matrix 1.7 and later; an older homeserver answers 404 for it — use matrix.upload_media instead.
See Upload to Reserved Media ID run in a workflow.
In a technical demo we add the Matrix connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.