Skip to main content

Objects

Every upload declares its full size in bytes with x-caskkeep-size. A request without that header is 411. The size is checked against the space left on the plan before any bytes are stored. Replacing an existing object counts only the difference.

A file that does not fit is 413 with code plan_limit. If an upload was already open, Caskkeep deletes that unfinished upload: the job, its parts, the file row, and the staged bytes. A stopped upload does not keep a corrupt file or reserve the rest of the quota.

Store a small file​

PUT /api/s3/private/photos/a.bin HTTP/1.1
Host: caskkeep.com
Authorization: Bearer ck_live_your_secret
Content-Type: application/octet-stream
x-caskkeep-size: 12

hello world!

The response header x-ipfs-cid is the content identifier. The same header is returned by HEAD.

GET /api/s3/private/photos/a.bin returns the bytes. DELETE removes the object. Listing a prefix is GET /api/s3/private?prefix=photos/&max-keys=1000.

Store a large file​

A single PUT can store an object up to 24 GiB. Multipart is the better path for a large file, and the dashboard uses it above 16 MiB. Start a multipart upload with the full size:

POST /api/s3/private/photos/a.bin?uploads HTTP/1.1
Authorization: Bearer ck_live_your_secret
x-caskkeep-size: 104857600

The XML body contains UploadId. Send each part with Content-Length. Parts other than the last must be at least 5 MiB, unless the whole file is smaller than 5 MiB.

PUT /api/s3/private/photos/a.bin?uploadId=UPLOAD_ID&partNumber=1 HTTP/1.1
Authorization: Bearer ck_live_your_secret
Content-Length: 5242880

Finish with the part numbers and ETags:

POST /api/s3/private/photos/a.bin?uploadId=UPLOAD_ID HTTP/1.1
Authorization: Bearer ck_live_your_secret
Content-Type: application/json

{"parts":[{"partNumber":1,"etag":"ETAG"}]}

DELETE /api/s3/private/photos/a.bin?uploadId=UPLOAD_ID aborts an open upload.

Folders use the same multipart flow with x-caskkeep-kind: directory on the start request and x-caskkeep-path plus x-caskkeep-path-encoding: uri on each part.