context.
All three require an API key. See Authentication.
Upload an asset
POST /v1/assets. The request body is the raw file, not JSON or multipart form data. Set Content-Type to the file’s
MIME type.
201 Created (values are illustrative):
The content is checked against
Content-Type. An unsupported type, or content that doesn’t match it (a PNG sent as
audio/wav), fails with 415 UNSUPPORTED_MIME_TYPE. A file over its size limit fails with 413 ASSET_TOO_LARGE. See
supported types and limits.
Get an asset
GET /v1/assets/{asset_id} returns the same object as the upload. It never returns the file’s content.
Delete an asset
DELETE /v1/assets/{asset_id} deletes the asset before it expires.
Retention and access
- Assets are kept for 24 hours by default, then expire. Referencing an expired asset fails with
410 ASSET_EXPIRED. - Assets are project-scoped: only the project that uploaded an asset can read, use or delete it. Other projects get
403 ASSET_FORBIDDEN. - An unknown id fails with
404 ASSET_NOT_FOUND.