How do I upload a small file (up to 4 MiB) in one request?
For files up to 4 MiB, you can skip the three-step flow:
curl -X POST "https://api.codebuckets.clatterlabs.xyz/v1/buckets/BUCKET_ID/objects?name=logo.png&visibility=public" \
-H "Authorization: Bearer $CLATTER_API_KEY" \
-H "X-Clatter-Account: $CLATTER_ACCOUNT_ID" \
-H "Content-Type: image/png" \
--data-binary @logo.png
- The request body is the file.
- Query parameters:
name(required, up to 255 characters, no slashes), and optionallykind,target_path,visibilityandcontent_type. - Optional
X-Content-SHA256header: a mismatch answers400 checksum_mismatch. - Answers
201with the stored object:ready, orprocessingfor a zip being unpacked. - Costs 1 token per request plus 1 per MiB, like chunk uploads.
Over 4 MiB answers 413 too_large: use the resumable upload flow instead.
Learn more#
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.