Skip to content
FLORA DocsGo to app

Assets

Asset upload and retrieval endpoints.

Create an asset upload
client.assets.create(AssetCreateParams { source, workspace_id, content_type, 2 more } body, RequestOptionsoptions?): AssetCreateResponse { asset_id, status, uploaded_via, 6 more }
POST/assets
Complete a signed asset upload
client.assets.complete(stringassetID, RequestOptionsoptions?): AssetCompleteResponse { asset_id, status, url, 6 more }
POST/assets/{assetId}/complete
Retry a signed asset upload
client.assets.retry(stringassetID, RequestOptionsoptions?): AssetRetryResponse { asset_id, status, url, 6 more }
POST/assets/{assetId}/retry
List assets
client.assets.list(AssetListParams { cursor, limit, project_id, 2 more } query?, RequestOptionsoptions?): AssetsCursorPage<AssetListResponse { asset_id, content_type, created_at, 12 more } >
GET/assets
Get an asset
client.assets.retrieve(stringassetID, RequestOptionsoptions?): AssetRetrieveResponse { asset_id, content_type, created_at, 11 more }
GET/assets/{assetId}
ModelsExpand Collapse
AssetCreateResponse { asset_id, status, uploaded_via, 6 more }
asset_id: string

Asset identifier

status: "pending_upload" | "ready" | "failed"
One of the following:
"pending_upload"
"ready"
"failed"
uploaded_via: "url" | "signed_url"

Asset source

One of the following:
"url"
"signed_url"
url: string

Asset URL

formaturi
visibility: "workspace"
workspace_id: string

Workspace identifier

expires_at?: string

Expiration time for the upload URL

formatdate-time
upload?: Upload { content_type, file_field, form_fields, 2 more }
content_type: "multipart/form-data"
file_field: "file"
form_fields: Record<string, string>

Upload form fields

method: "POST"
url: string

Upload URL

formaturi
upload_url?: string

Upload URL (serialized)

AssetCompleteResponse { asset_id, status, url, 6 more }
asset_id: string

Asset identifier

status: "pending_upload" | "ready" | "failed"
One of the following:
"pending_upload"
"ready"
"failed"
url: string | null

Asset URL

formaturi
visibility: "workspace"
workspace_id: string | null

Workspace identifier

expires_at?: string

Expiration time for the upload URL

formatdate-time
failure_message?: string | null

Failure message when the asset is in failed status

upload?: Upload { content_type, file_field, form_fields, 2 more }
content_type: "multipart/form-data"
file_field: "file"
form_fields: Record<string, string>

Upload form fields

method: "POST"
url: string

Upload URL

formaturi
upload_url?: string

Upload URL (serialized)

AssetRetryResponse { asset_id, status, url, 6 more }
asset_id: string

Asset identifier

status: "pending_upload" | "ready" | "failed"
One of the following:
"pending_upload"
"ready"
"failed"
url: string | null

Asset URL

formaturi
visibility: "workspace"
workspace_id: string | null

Workspace identifier

expires_at?: string

Expiration time for the upload URL

formatdate-time
failure_message?: string | null

Failure message when the asset is in failed status

upload?: Upload { content_type, file_field, form_fields, 2 more }
content_type: "multipart/form-data"
file_field: "file"
form_fields: Record<string, string>

Upload form fields

method: "POST"
url: string

Upload URL

formaturi
upload_url?: string

Upload URL (serialized)

AssetListResponse { asset_id, content_type, created_at, 12 more }
asset_id: string | null

Asset identifier

content_type: string

Asset content type

created_at: number | null
description: string | null

Asset description

height: number | null
name: string | null

Asset name

size_bytes: number | null
status: "pending_upload" | "ready" | "failed"
One of the following:
"pending_upload"
"ready"
"failed"
upload_content_type: string | null

Content type provided at upload time

uploaded_via: string

Asset source

url: string | null

Asset URL

formaturi
width: number | null
workspace_id: string | null

Workspace identifier

node_id?: string | null

Associated node identifier

project_id?: string | null

Project identifier

AssetRetrieveResponse { asset_id, content_type, created_at, 11 more }
asset_id: string

Asset identifier

content_type: string

Asset content type

created_at: string | null

Asset creation time (ISO 8601 datetime)

formatdate-time
description: string | null

Asset description

failure_message: string | null

Failure message when the asset is in failed status

height: number | null
name: string | null

Asset name

size_bytes: number | null
status: "pending_upload" | "ready" | "failed"
One of the following:
"pending_upload"
"ready"
"failed"
upload_content_type: string | null

Content type provided at upload time

uploaded_via: string

Asset source

url: string | null

Asset URL

formaturi
width: number | null
workspace_id: string | null

Workspace identifier