Skip to main content
POST
Upload file
Uploads a file to a workspace and pushes it to the computers that are running at that moment. Passing destPath switches the endpoint to a second mode. That mode drops the file into one exact folder on one computer and records nothing. The two modes return different bodies. See Folder-targeted upload.

Request

Send a multipart/form-data request.
file
required
The file to upload. Maximum 10MB. A larger file returns 400. The name is preserved as filename. The copy in object storage is keyed under a sanitised form of it.
string
required
Workspace ID to upload into. Omitting it returns 400.
string
Computer ID to associate the file with. When omitted, the file is recorded against the workspace with a desktop_id of null. Association does not change where the file is pushed. Every running computer in the workspace receives it either way. Required when destPath is set.
string
Absolute folder path on the computer. Must begin with /. When set, the file is placed at <destPath>/<file name> on the computer named by desktopId, and nothing else happens: no file record is written, no other computer receives it, and the response body is different. When omitted, the file is stored in the workspace and pushed to running computers.

Response

Without destPath, the whole stored row is returned under file.
object
The stored file record.
string
File ID. Pass it as id to the download and delete endpoints.
string
Workspace the file belongs to.
string | null
The desktopId you supplied, or null.
string
ID of the account that uploaded the file.
string
Original file name.
string
Internal object-storage key. It is not a URL and cannot be fetched directly. Use the download endpoint to get a signed URL.
integer
Size in bytes.
string
MIME type reported by the client, or application/octet-stream when the client sent none.
string
ISO 8601 creation timestamp.
string
Always upload for this endpoint.

Example

Response

How the file reaches a computer

The file is stored in the workspace and pushed to /root/Desktop on every computer that is running at the time of upload. Computers that are stopped, or created afterwards, do not receive it. Upload again to reach them. The push is best-effort and runs after the response is sent, so it does not affect the status you get back.
Each push sends the workspace’s full set of uploaded files. A computer skips any file whose name already exists in /root/Desktop rather than overwriting it.

Folder-targeted upload

Setting destPath places the file at one exact path on one computer. The response is a different shape and no file record is created. The file does not appear in the list endpoint, and it cannot be downloaded or deleted through this API.
boolean
true when the file was placed on the computer.
string
Full path the file was written to, formed as <destPath>/<file name>.
cURL

Errors

Every error carries the shape {"error": "<message>"}.

Authorizations

Authorization
string
header
required

API key authentication. Get your key at orgo.ai/workspaces

Body

multipart/form-data
file
file
required

File to upload (max 10MB)

workspaceId
string
required

Workspace ID. Required; omitting it is a 400.

desktopId
string

Computer to associate the file with. Omitted, the file belongs to the workspace and is synced to every running computer in it. Required when you send destPath.

destPath
string

Absolute folder on the computer to place the file in. Sending it changes what the endpoint does: no file record is written, nothing is synced, and the bytes are pulled straight into that folder on the computer named by desktopId. Must start with /. Omitted, the file is stored against the workspace and synced to its running computers.

Example:

"/root/Desktop"

Response

File uploaded. destPath requests answer with the placement result instead of a file record.

file
object