Documentation

Four calls take you from an empty account to a stored object with a retrievable version.

1. Signing key

Requests are signed with a project key sent as a bearer token. A key is bound to one project and can be rotated while the previous key stays valid for one hour.

Authorization: Bearer <PROJECT_KEY>

2. Create a bucket

curl -X PUT https://space.jdcity.cc/v1/buckets/assets \
  -H "authorization: Bearer $KEY" \
  -H "content-type: application/json" \
  -d '{"retention_days": 30}'

Bucket names are unique per project and cannot be renamed later.

3. Upload an object

Ask for a signed target, then send the body directly to it:

curl -X PUT "<signed-url-from-step-2>" \
  -H "content-type: image/svg+xml" \
  --data-binary @logo.svg

Confirm the upload so the object becomes listable:

curl -X POST https://space.jdcity.cc/v1/buckets/assets/uploads/confirm \
  -H "authorization: Bearer $KEY" \
  -H "content-type: application/json" \
  -d '{"id":"obj_9a41c2","checksum":"sha256:..."}'

4. Read and restore versions

# list versions of one object
curl https://space.jdcity.cc/v1/buckets/assets/objects/logo.svg/versions \
  -H "authorization: Bearer $KEY"

# download a specific version
curl -O "https://space.jdcity.cc/v1/buckets/assets/objects/logo.svg@v2"

Errors

StatusMeaningRetry
400Invalid bucket or object nameNo
403Key not allowed for this bucketNo
404Object or version not foundNo
409Checksum mismatch on confirmYes, re-upload
413Object exceeds the bucket limitNo

Limits

Next steps