Docs

Start here

Ask where to upload a file

POST/v1/studio/uploadson https://api.auray.ai/v1

A ticket for one file: PUT its bytes to upload_url with headers before expires_at — never through this API — then file it by naming upload_id (POST …/items, an element's files, a project's cover_up…

A ticket for one file: PUT its bytes to upload_url with headers before expires_at — never through this API — then file it by naming upload_id (POST …/items, an element's files, a project's cover_upload_id, or POST …/scripts for a script). The PUT is signed for the type and size declared; only what then landed is filed. A file that would take what a project's owner keeps past the room their plan gives — their studio.max_items times their studio.bytes_per_item (on GET /v1/plans) — is refused 409 studio_limit_reached with limit storage. Takes a key holding studio:write — Account offers it unticked — or the desktop's own session key. Spends nothing.

#Authentication

Authorization: Bearer auray_sk_… — studio:write — Account offers it unticked; the desktop's session key holds it.

#Request

#Body

application/json, required.

FieldTypeRequiredDefaultDescription
purposestringyes—An item of a project, a picture, clip or sound of an element, a project's cover, a frame of a clip as its poster (a picture of at most 2,000,000 bytes, filed by changing the item with poster_upload_id), or a script to read into the project (filed by POST …/scripts). One of "item", "element", "cover", "poster", "script".
project_idstringno—Required for an item, a cover and a poster.
content_typestringyes—A script is one of six types, one a format — fountain text/x-fountain, fdx application/xml, txt text/plain, md text/markdown, pdf application/pdf, docx application/vnd.openxmlformats-officedocument.wordprocessingml.document — of at most 10,000,000 bytes by default (the ticket's max_bytes says the bound in force), and takes no other purpose. One of "image/png", "image/jpeg", "image/webp", "video/mp4", "video/webm", "video/quicktime", "audio/mpeg", "audio/wav", "audio/x-wav", "audio/ogg", "audio/flac", "audio/mp4", "model/gltf-binary", "text/x-fountain", "application/xml", "text/plain", "text/markdown", "application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document".
bytesintegeryes—The file's exact size: the PUT is signed for it. The most a file of its kind may be is the bound in force, which the ticket answers in max_bytes and upload_too_large names. 1 to 2000000000.
namestringno—0 to 120 characters.

#Example request

curl -X POST https://api.auray.ai/v1/studio/uploads \
  -H "Authorization: Bearer $AURAY_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "purpose": "item",
  "project_id": "3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d",
  "content_type": "image/png",
  "bytes": 482113,
  "name": "plate.png"
}'

#Responses

#201 Created

Created.

FieldTypeRequiredDefaultDescription
objectstringyes—One of "upload".
upload_idstringyes—
upload_urlstringyes—A URL.
methodstringyes—One of "PUT".
headersobjectyes—Send these exactly: the PUT is signed for this type, and for the length declared.
expires_atstringyes—
max_bytesintegeryes—
kindstringyes—One of "image", "video", "audio", "model3d", "script".
request_idstringno—Mirrored in the X-Request-Id header.

Headers:

HeaderDescription
RateLimit-LimitBurst capacity.
RateLimit-Remaining
RateLimit-ResetSeconds until refill.
X-RateLimit-Limit
X-RateLimit-Remaining
X-RateLimit-ResetUnix seconds. The X- spelling is what client libraries read.
X-Request-Id

#400 Bad Request

#401 Unauthorized

#403 Forbidden

#404 Not Found

#409 Conflict

#413 Payload Too Large

#429 Too Many Requests

#500 Internal Server Error

#503 Service Unavailable

#Status codes

StatusMeaning
201Created.
400Bad Request
401Unauthorized
403Forbidden
404Not Found
409Conflict
413Payload Too Large
429Too Many Requests
500Internal Server Error
503Service Unavailable

Every refusal names its code, and every code is explained at Errors.

Start typing to search every page of the documentation.

Up arrow Down arrow to moveEnter to openEscape to close