Skip to content

Complete signed uploads in bulk

POST
/assets/complete
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const asset = await client.assets.completeUploads({
asset_ids: [
'asset_abc123',
],
});
console.log(asset);

Completes up to 25 signed uploads in one request — the batch counterpart of POST /assets/{assetId}/complete, counted once against the workspace’s rate limit instead of once per file. Every asset is verified and validated as the single completion does. Each entry echoes its index and asset_id and reports status ready, or failed with failure_message, exactly as the single completion would; ok is false with an error only when completion could not run for that asset — an id that is missing, deleted or outside this credential’s write access reports not_found, the single completion’s deliberate ambiguity. A failed entry never stops the rest, and a repeated id completes once and reports under each index. Static media reserved with project_id are surfaced on that project’s canvas without stacking on one another; GLB Model3D assets are associated with the project but are not auto-placed. A malformed asset_id rejects the whole request. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate, and a batch whose every entry was rejected releases its key (see the Idempotency guide).

Error responses use the standard error body.

Media type application/json
object
asset_ids
required

Signed-upload asset ids (asset_…) to complete, 1 to 25 per call

Array<string>
>= 1 items <= 25 items

Uploads completed; each entry reports its own outcome.

Media type application/json
object
assets
required

One entry per requested asset id, in request order: ok true with the single completion’s fields, or ok false with error

Array
<= 25 items
Any of:
object
asset_id
required

Asset identifier

string
/^asset_\S+$/
url
required
Any of:
string format: uri
workspace_id
required
Any of:

Workspace identifier

string
/^ws_\S+$/
visibility
required
Allowed value: workspace
status
required
string
Allowed values: pending_upload ready failed
failure_message
required
Any of:
string
index
required

Position of this entry in the request’s list

integer
ok
required

Completion ran; status reports ready or failed, as on the single completion

boolean
Example
{
"assets": [
{
"asset_id": "asset_abc123",
"workspace_id": "ws_abc123",
"visibility": "workspace",
"status": "pending_upload",
"ok": true
}
]
}