API reference

API reference · Account

Store a file

POST/api/studio/assetsSigned in session

The bytes are the body, its Content-Type one of image/png, image/jpeg, image/webp, audio/mpeg, audio/wav, audio/ogg, audio/webm, audio/mp4, audio/aac, video/mp4, video/quicktime, video/webm; the bytes must start the way that type does (415 content_mismatch otherwise), any other type is 415 unsupported_media_type, past the size cap or the account's bytes 413 asset_too_large, past its count of files 409 too_many_assets. 402 storage_unpaid while the account's newest storage day is short. With job_id the file is that studio job's take (the account's own job, 404 otherwise; a file not of the job's kind is 400): it fills the copy the account was making from the provider, and a take kept already answers 200 with its stored file and keeps nothing more, so one take is one stored file. A 404 with code storage_off while stored media is switched off (ANTIMATTER_STUDIO_STORAGE). The signed in account; same origin only.

Parameters

Path and query parameters
FieldTypeWhat it is
name (query)string
project_id (query)string
doc_asset_id (query)string
job_id (query)string

Request body

image/png, required

The document names no fields for this body.

Answer 201

The stored file.

Fields of the 201 answer
FieldTypeWhat it is
idstring
objectstringOne of "studio.asset".
kindstringOne of "picture", "audio", "clip".
sourcestringOne of "upload", "job".
statusstringOne of "ready", "awaiting", "failed".
project_idstring or null
job_idstring or null
doc_asset_idstring or nullThe editor Asset this file stands for.
namestring or null
content_typestring or null
bytesinteger
sha256string or null
errorstring or null
created_atinteger
updated_atinteger

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 402OpenAI shaped error.
  • 403OpenAI shaped error.
  • 404OpenAI shaped error.
  • 409OpenAI shaped error.
  • 413OpenAI shaped error.
  • 415OpenAI shaped error.
  • 429OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter