Upload File
box.upload_file
ActionFiles & storageconnection required
Calls the Box API with the connection's credentials.
Upload a new file into a folder, taking its content from 'body' as text or as a base64 blob from an upstream download node.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- OAuth 2.0
- Providers
- Box
- Secret shape
- {"client_id": "…", "client_secret": "…", "box_subject_type": "enterprise|user", "box_subject_id": "…"} for a server-authentication app, or {"client_id": "…", "client_secret": "…", "refresh_token": "…"} for OAuth2
- Resolved by
- config.connection_id, else node.connection_id
Configuration
5 fields, 3 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 |
|---|---|---|---|---|---|
parent_id The id of the folder to upload into. Use '0' for the account root. | string | Yes | — | — | 0 |
name The file name to store the upload under, including its extension. | string | Yes | — | — | — |
body The file content — plain text, or a base64 blob when content_encoding is 'base64'. | 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" | — |
content_type MIME type to send the part with, such as 'application/pdf'. Defaults to application/octet-stream for binary and the upstream type when known. | string | No | — | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"parent_id": "0"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
id The Box file id. | string | — |
type Always 'file'. | string | file |
name The file name, including its extension. | string | — |
size The file size in bytes. | number | — |
etag The file's etag, for optimistic concurrency. | string | — |
sha1 The SHA-1 checksum Box computed for the content. | string | — |
parent.id The id of the folder holding the file. | string | — |
modified_at When the file last changed (RFC 3339). | string | — |
{
"etag": "",
"id": "",
"modified_at": "",
"name": "",
"parent": {
"id": ""
},
"sha1": "",
"size": 0,
"type": "file"
}Notes
- Uploads go to upload.box.com and everything else to api.box.com; the nodes pick the right host for you.
- Use a Box server-authentication (Client Credentials) app for anything unattended: its credential can be exchanged for a token indefinitely. A plain OAuth2 refresh token is spent by its first use, so that connection needs re-authorising.
- The root folder always has the id '0'.
- This is Box's direct-upload endpoint, which caps a single file at 50 MB; larger files need Box's chunked-upload API.
See Upload File run in a workflow.
In a technical demo we add the Box connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.