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
| Status | Meaning | Retry |
|---|---|---|
| 400 | Invalid bucket or object name | No |
| 403 | Key not allowed for this bucket | No |
| 404 | Object or version not found | No |
| 409 | Checksum mismatch on confirm | Yes, re-upload |
| 413 | Object exceeds the bucket limit | No |
Limits
- Object size: 5 GiB per upload.
- Bucket name: 3–48 characters, lowercase.
- Signed URL lifetime: 10 minutes.
- Versions kept per object: 100.