Skip to content
Get started

Labric Upload File Api

tools.upload_file(ToolUploadFileParams**kwargs) -> ToolUploadFileResponse
post/api/v1/tools/upload-file

Upload a job artifact file.

Intended for use by jobs running in sandboxes. Accepts a multipart/form-data file upload, stores it in GCS, and returns the created file record. When a job_execution_id is provided, records provenance linking the file to that execution.

ParametersExpand Collapse
file: FileTypes
formatbinary
job_execution_id: Optional[str]
formatuuid
ReturnsExpand Collapse
class ToolUploadFileResponse:
file_id: str

The ID of the uploaded file.

file_name: str

The original file name.

size_kilobytes: Optional[int]

File size in kilobytes.

Labric Upload File Api
from labric import Labric

client = Labric(
    api_key="My API Key",
)
response = client.tools.upload_file(
    file=b"raw file contents",
)
print(response.file_id)
{
  "file_id": "file_id",
  "file_name": "file_name",
  "size_kilobytes": 0
}
Returns Examples
{
  "file_id": "file_id",
  "file_name": "file_name",
  "size_kilobytes": 0
}