Skip to content

Get an asset

GET
/assets/{assetId}
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const asset = await client.assets.retrieve({
assetId: '<assetId>',
});
console.log(asset);

Returns metadata for one asset when it is accessible to the authenticated public API key. Missing and inaccessible assets both return 404.

Error responses use the standard error body.

assetId
required

Asset identifier

string
/^asset_\S+$/

Asset identifier

Asset returned.

Media type application/json
object
asset_id
required

Asset identifier

string
/^asset_\S+$/
name
required
Any of:
string
description
required
Any of:
string
workspace_id
required
Any of:

Workspace identifier

string
/^ws_\S+$/
url
required
Any of:
string
content_type
required

Asset content type

string
upload_content_type
required
Any of:
string
size_bytes
required
Any of:
integer
uploaded_via
required

Asset source

string
created_at
required
Any of:
string format: date-time
status
required
string
Allowed values: pending_upload ready failed
failure_message
required
Any of:
string
width
required
Any of:
integer
height
required
Any of:
integer
Example
{
"asset_id": "asset_abc123",
"workspace_id": "ws_abc123",
"status": "pending_upload"
}