Skip to navigation

Upload a small file in one request

View as Markdown

Upload a file in one multipart/form-data request.

Request bodies over 4.5 MB are rejected at the platform edge before they reach this route. For larger files, create an upload URL and PUT the bytes to it instead; the SDK’s files.upload() does that for files of any size. The Upload files guide walks through both flows.

At least one of job_execution_id and instrument_id is required, except in a job script, whose uploads default to the running job’s execution. Pass a job_execution_id for an artifact of a job execution, which also records provenance linking the file to that execution, and pass an instrument_id for data captured off-platform by an instrument the Sync app cannot reach, which attaches the file to that instrument so instrument triggers and parsers pick it up.

Requires an API key with the write scope.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects a multipart form containing a file.
filefileRequired
job_execution_idstring or nullOptionalformat: "uuid"
instrument_idstring or nullOptionalformat: "uuid"

Response

OK
file_idstring
The ID of the uploaded file.
file_namestring
The original file name.
size_kilobytesinteger or null
File size in kilobytes.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
500
Internal Server Error