Assets
Assets represent media files available to FLORA workflows. For user-supplied images or videos, create an asset, upload the bytes to the returned signed upload URL, then mark the asset complete. The source field must always be a string: either "signed-url" for direct upload, or a public HTTPS URL for server-side fetch.
Reserve a signed upload
Section titled “Reserve a signed upload”curl -X POST https://app.flora.ai/api/v1/assets \ -H "Authorization: Bearer ak_XXXX" \ -H "Content-Type: application/json" \ -d '{ "source": "signed-url", "workspace_id": "ws_XXXX", "file_name": "product.png", "content_type": "image/png", "folder": "api-uploads" }'Response:
{ "asset_id": "asset_...", "url": "https://ik.imagekit.io/flora/...", "status": "pending_upload", "upload": { "url": "https://...", "formFields": {}, "fileField": "file" }}Create from a public URL
Section titled “Create from a public URL”If your source file is already available at a public HTTPS URL, pass that URL as source:
curl -X POST https://app.flora.ai/api/v1/assets \ -H "Authorization: Bearer ak_XXXX" \ -H "Content-Type: application/json" \ -d '{ "source": "https://media.flora.ai/example.png", "workspace_id": "ws_XXXX" }'Do not pass objects such as { "url": "..." }, local file paths, data: URLs, or placeholder strings such as "upload", "file", or "local" as source.
Upload the file bytes
Section titled “Upload the file bytes”Submit the returned upload.formFields and file to upload.url as multipart form data. The upload target is external to the FLORA API, so do not include your FLORA authorization header in that request unless the returned upload instructions say to.
Complete the asset
Section titled “Complete the asset”After uploading bytes, complete the asset:
curl -X POST https://app.flora.ai/api/v1/assets/asset_XXXX/complete \ -H "Authorization: Bearer ak_XXXX"A completed asset has status: "ready" and can be passed to technique inputs or attached to projects.
Upload many files
Section titled “Upload many files”Every request counts against the workspace’s rate limit, so reserve and complete files in batches of up to 25 rather than one request per file. workspace_id, project_id and folder apply to every upload; an upload’s own folder overrides the shared one.
curl -X POST https://app.flora.ai/api/v1/assets/reserve \ -H "Authorization: Bearer ak_XXXX" \ -H "Content-Type: application/json" \ -d '{ "workspace_id": "ws_XXXX", "uploads": [ { "file_name": "front.png", "content_type": "image/png" }, { "file_name": "back.png", "content_type": "image/png" } ] }'Each entry in assets echoes its index and carries either the single reservation’s fields or ok: false with an error. A failed entry never stops the rest. A workspace your credential cannot write, or a project_id outside the workspace, fails the whole request. Upload each file with its own upload instructions, then complete the batch:
curl -X POST https://app.flora.ai/api/v1/assets/complete \ -H "Authorization: Bearer ak_XXXX" \ -H "Content-Type: application/json" \ -d '{ "asset_ids": ["asset_XXXX", "asset_YYYY"] }'Each entry reports status ready, or failed with failure_message, as a single completion does. An asset that is missing or outside your credential’s write access reports ok: false with not_found. Uploads reserved with a project_id land on that project’s canvas when they complete.
List assets
Section titled “List assets”curl "https://app.flora.ai/api/v1/assets?workspace_id=ws_XXXX&limit=10" \ -H "Authorization: Bearer ak_XXXX"Retrieve an asset
Section titled “Retrieve an asset”curl https://app.flora.ai/api/v1/assets/asset_XXXX \ -H "Authorization: Bearer ak_XXXX"Retry an upload
Section titled “Retry an upload”If a pending upload expires or fails, request fresh upload instructions:
curl -X POST https://app.flora.ai/api/v1/assets/asset_XXXX/retry \ -H "Authorization: Bearer ak_XXXX"Retry is only valid for supported asset lifecycle states. If the asset cannot be retried, the API returns a validation or lifecycle error.
Common endpoints
Section titled “Common endpoints”| Method | Path | Description |
|---|---|---|
| POST | /api/v1/assets |
Create an asset or reserve a signed upload |
| POST | /api/v1/assets/{asset_id}/complete |
Mark an uploaded asset complete |
| POST | /api/v1/assets/reserve |
Reserve up to 25 signed uploads |
| POST | /api/v1/assets/complete |
Mark up to 25 uploaded assets complete |
| GET | /api/v1/assets?workspace_id={workspace_id}&limit=10 |
List assets |
| GET | /api/v1/assets/{asset_id} |
Retrieve an asset |
| POST | /api/v1/assets/{asset_id}/retry |
Request new upload instructions |
| POST | /api/v1/projects/{project_id}/assets/{asset_id}/attach |
Attach an asset to a project |
Common validation issues
Section titled “Common validation issues”sourceis required and must be a string.- Use
"signed-url"when you need FLORA to reserve upload instructions for bytes you will upload yourself. - Server-side URL fetch only accepts public HTTPS URLs: no
http://, embedded credentials,localhost, or private IP addresses. If FLORA cannot fetch the URL (for example, the host blocks hotlinking or needs a login), use the signed upload flow. workspace_idis required and must start withws_.
- Technique input URLs must be HTTPS.
- Wait for
status: "ready"before using a newly uploaded asset as a workflow input. - Keep the final
urlif you need to pass the asset directly to animageUrlorvideoUrlinput.