Palbase Storage · API
/storage/buckets/{bucket}/copyCopy an object
Writes a new object at to with from's bytes and renditions. An object already at to is refused (409 object_exists) unless overwrite. Emits file.uploaded.
Called by your server, with the project's secret key.
Path
bucketstring · requiredThe bucket's name: a lowercase letter, then lowercase letters, digits and -, 2 to 63 characters.Headers
Idempotency-Keystring · optionalMakes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.Request body
fromstring · requiredThe object's path.overwriteboolean · optionalReplace an object already at to. Absent: false.tostring · requiredWhere it goes.curl -X POST "https://<your-ref>.palbase.studio/storage/buckets/<bucket>/copy" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"from":"string","to":"string"}'Responses
201The copy
400The request is malformed: a field, a path or a parameter is wrong
401No key, or not a key of this project (the edge's answer)
403Not the project's secret key; or, on a credential-less route, a private object or a link that is not valid for it
404No such bucket, object or variant
409The bucket still holds objects, an object is already at the destination, or a request with this Idempotency-Key is still running
422A picture this storage cannot decode, or an Idempotency-Key sent with a different request
429The project's request rate, or its storage quota for the period, is used up — or, slowed for its month's traffic, it has as many downloads under way as are paced at once; Retry-After says when to try again
503The platform could not answer now; retrying is safe (Retry-After)
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation CopyObject of storage's contract.