v8

latestOpenAPI 3.1.1LicenseRef-Proprietaryraw.githubusercontent.com2026-05-19280916.6 KB
Assets

Create an asset upload

Creates an asset from an allowlisted source URL or reserves a signed upload URL. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.

post/assets

Request body

sourcestring required

Asset source URL or signed-url upload mode

workspace_idstring required

Workspace identifier

folderstring

Destination folder

content_typestring

Asset content type

file_namestring

Asset file name

Example request

{
  "source": "signed-url",
  "workspace_id": "ws_abc123",
  "folder": "campaign-assets",
  "content_type": "image/png",
  "file_name": "hero.png"
}

Response

Asset upload created.

asset_idstring required

Asset identifier

uploaded_via'url' | 'signed_url' required

Asset source

urlstring uri required

Asset URL

workspace_idstring required

Workspace identifier

visibility'workspace' required
status'pending_upload' | 'ready' | 'failed' required
upload_urlstring

Upload URL (serialized)

expires_atstring date-time

Expiration time for the upload URL

Example response

{
  "asset_id": "asset_abc123",
  "workspace_id": "ws_abc123",
  "upload_url": "https://upload.imagekit.io/api/v1/files/upload"
}