files

Start a resumable upload — for a file of any size up to 50 GiB [write]

Changed on

JSON {filename, size_bytes, mime_type?, expires_in_seconds?} (expires_in_seconds 3600–7776000; omitted, the file never expires). Send the bytes to upload_url as PUT requests carrying Content-Range: bytes <first>-<last>/<size_bytes>, chunk_size bytes at a time: each answers 308 with Range: bytes=0-<last received> until the final chunk answers 200. After a dropped connection, PUT with no body and Content-Range: bytes */<size_bytes> answers the same 308 or 200, and the upload continues from the byte after the Range. The session lasts a week. 413 file_too_large past 50 GiB.

post/files/uploads

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/files/uploads
  • Auth
    HTTP bearer

Request body

filenamestring required
size_bytesinteger required
mime_typestring
expires_in_secondsinteger

Response

OK

type'file_upload' required
idstring required

fupl_…; pass to /files/uploads/{upload_id}/complete

upload_urlstring required

Where the bytes go, in Content-Range chunks. Needs no credentials: the URL is the capability, so keep it private.

chunk_sizeinteger required

The chunk size to send; every chunk but the last must be exactly this long

size_bytesinteger required
filenamestring required
mime_typestring required
expires_atstring date-time required

When the upload session lapses; start a new one after

Changes