For the complete documentation index, see llms.txt. This page is also available as Markdown.

Assets and custom metadata

Upload durable assets, select a folder, apply tags, and replace custom metadata intentionally.

Outcome: Upload durable assets, select a folder, apply tags, and replace custom metadata intentionally.

result = client.assets.upload(
    "./images",
    folder="Raw data",
    tags=["incoming"],
    custom_metadata={"source": "camera-7", "shift": "night"},
)
asset = result.assets[0]
asset.update_custom_metadata({"source": "camera-7", "approved": True})

Use either folder or folder_id to select a destination. path can scope the upload path. AssetUploadResult exposes the folder, uploaded count, file failures, parsed Asset handles, and raw responses.

Custom metadata updates replace the metadata object; pass the complete intended object. Passing None clears custom metadata.

Operating contract

Concern
Required behavior

Execution surface

Pinned unitlab==3.0.0 application environment on Python 3.10+.

Identity

Least-privilege API key supplied through approved configuration.

Target resolution

Stable resource IDs and an explicitly bounded target set.

Success evidence

Typed return fields, server-side state, and downstream acceptance of the result.

Failure and recovery boundary

Condition
Response

Authentication or authorization fails

Stop, correct the service identity or access model, rotate exposed credentials, and rerun a read-only check.

Validation or entitlement rejects the operation

Correct the input or entitlement; do not retry an unchanged request.

A request times out

Inspect remote state before repeating a mutation because the server may have accepted it.

Asynchronous processing exceeds its deadline

Preserve the Batch Queue or release ID, continue bounded monitoring, and inspect item-level failures.

Only part of a batch succeeds

Keep successful identifiers, isolate failed rows, and retry only the corrected subset.


Continue with Unitlab: Unitlab’s data curation platform