Clatter LabsHelp Center

How do I upload a small file (up to 4 MiB) in one request?

How-toUpdated

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 optionally kind, target_path, visibility and content_type.
  • Optional X-Content-SHA256 header: a mismatch answers 400 checksum_mismatch.
  • Answers 201 with the stored object: ready, or processing for 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.xyz
For deleting your whole account or the data of one service.