Upload Media
matrix.upload_media
ActionChat & messagingconnection required
Calls the Matrix API with the connection's credentials.
Upload a file to the homeserver's content repository in one request.
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
4 fields, 1 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 |
|---|---|---|---|---|---|
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 | — | — | — |
Output
One shape.
result
| Field | Type | Example |
|---|---|---|
content_uri The mxc:// URI of the stored file. | string | mxc://x.io/AbC |
filename The file name sent with the upload. | string | — |
size Raw size in bytes of the uploaded content. | number | — |
{
"content_uri": "mxc://x.io/AbC",
"filename": "",
"size": 0
}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.
- The mxc:// URI this returns is what matrix.send_media_message posts; an upload nobody references is invisible in the room.
See Upload Media 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.