Files

Create an upload URL

Start an upload that sends the file bytes straight to storage.

Creates the file record and returns a signed URL that accepts the bytes as the body of an HTTP PUT for the next 15 minutes. Send exactly the returned headers on the PUT and no Authorization header, then confirm the upload to make the file visible. The URL only creates the object, never replaces one, and refuses bodies over 500 MB. Asking again for an instrument path whose upload was never confirmed returns a fresh URL for the same file, so a failed PUT can be retried. The SDK's files.upload() runs all three steps; the Upload files guide shows them with curl.

At least one of job_execution_id and instrument_id is required: pass a job_execution_id for an artifact of a job running in a sandbox, 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.

post/api/v1/files/upload-url

Request

  • Base URL: https://platform.labric.co
  • URL: https://platform.labric.co/api/v1/files/upload-url
  • Auth: HTTP bearer

Request body

file_namestring required

The file name to record, e.g. results.csv.

content_typestring nullable

MIME type of the file. Defaults to application/octet-stream, which is also substituted for types a browser could render as a page.

job_execution_idstring uuid nullable

The job execution producing the file, for a job artifact.

instrument_idstring uuid nullable

The instrument that captured the file, for off-platform data.

Response

OK

file_idstring required

The ID of the file record awaiting its bytes.

upload_urlstring required

Signed Google Cloud Storage URL. Send the file bytes as the body of an HTTP PUT to this URL with no Authorization header.

headersobject required

Headers the PUT must carry exactly as given; the URL is signed for them. They set the Content-Type, let the object be created but not replaced, and cap the body at the platform's file size limit.

expires_atstring required

When the upload URL stops working, as an ISO 8601 timestamp.

Changes

No recorded changes to this operation across all 1 revision of this API.