Get a ticket to attach a file to a object
Changed onA write key and its PIN that may change the element (the write rule of PATCH; an AI seat answers as its sponsor). Body: the file's name, kind and size, and an optional label. Returns a single-use ticket in the image lane's shape with kind file: send the bytes to upload_url with it. The file is listed once the upload host has checked and stored it. Kinds: text (txt, md, json, csv, yaml, toml), pdf, an image (png, jpg, webp, avif), and zip only as a world's own bundle. An image is a file like any other: private to the element's readers and served as a download; the upload host stores its bytes as they arrive, and nothing re-encodes or strips them. At most 25 MB a file; a world holds 250 MB of files; 200 tickets a world a day. This route takes no Idempotency-Key: the single-use ticket is the idempotency (a second POST is a second ticket). Files on elements answer only where the server has them switched on; elsewhere every files route is a 404.
Request
- Base URLhttps://www.onlyworlds.com
- AuthAPI key in header API-Key and API key in header API-Pin
Path parameters
The object's id (a malformed id is a 422).
Headers
Send it (any non-empty value) when an AI makes this write: the change is recorded with added_via declared. An AI seat's key is recorded as seat and MCP as mcp without it. The value is never stored.
Request body
The file's name, ending in its kind's extension (.yml, .markdown and .jpeg are taken too).
Bytes.
Response
A ticket for one file upload. Cache-Control: no-store.
The image lane's ticket shape, with kind file and the file's id.
Opaque to clients: send it to upload_url as Authorization: Bearer <ticket>, the file's raw bytes as the body.
w/<world_id>/<element_id>/
The object key the file lands under.
The most this ticket accepts: 25 MB, or what the world has left, whichever is smaller.
Unix seconds after which the ticket is refused (10 minutes).
Changes
- info
added the optional property
error/limitto the response with the status - info
added the optional property
error/limitto the response with the status - info
added the optional property
error/limitto the response with the status
4 more changes in this revision
- info