Skip to main content
POST
Copy or Move a Blob Object
Copies a blob object to a new path in the same account, or moves it when move is true. A move keeps the object id and changes only path, so it doesn’t add to storage. A copy creates a new object with a new id, and its bytes count toward the quota. Scope: blob:write.
string
required
ID of the object to copy or move.
string
required
Destination path, with the same rules as Upload in one request.
boolean
true moves the object and keeps its ID. Default false: copy.
boolean
Replace an object already at path. Default false.
boolean
Insert a random suffix before the extension. Default false.
boolean
Copy only: when path is taken, including by the source itself, save the copy as name-1.ext, name-2.ext and so on instead of returning BLOB_OBJECT_ALREADY_EXISTS. Default false. Can’t be combined with overwrite, and is ignored on a move.
string
public or private for the new object. Default: the visibility of the source object.
string
The workspace ID, when the blob belongs to a workspace. The call acts on the blob of the workspace owner and needs the blob:read workspace permission (blob:manage on routes that change data). Leave it out to act on your own blob.

Example request

Response

object
The object at its new path.

Error Responses

string
The error code indicating the reason for failure. Possible values:
  • AUTH_TOKEN_MISSING (401): No Authorization header was sent.
  • API_KEY_INVALID (401): The API key doesn’t exist, was revoked, or its secret doesn’t match.
  • API_KEY_SCOPE_DENIED (403): The key lacks the scope this route needs (blob:read or blob:write); details.required names it.
  • WORKSPACE_PERMISSION_DENIED (403): Only with workspace_id: you’re not a member, or your role lacks the blob permission.
  • WORKSPACE_NOT_FOUND (404): Only with workspace_id: no workspace with that ID, or you’re not a member.
  • BLOB_NAMESPACE_SUSPENDED (403): The account’s blob storage is suspended, or its plan expired. Uploads and other writes are refused from the start of the 72-hour grace period.
  • VALIDATION_ERROR (400): A parameter or body field failed validation. details.path names the field.
  • BLOB_OBJECT_NOT_FOUND (404): The source doesn’t exist in this account.
  • BLOB_OBJECT_ALREADY_EXISTS (409): path is taken and overwrite is not true.
  • STORAGE_QUOTA_EXCEEDED (403): A copy would exceed the plan’s blob quota. Moves don’t add storage, so they’re not blocked by it.
  • BLOCKED_FILE_TYPE (422): The destination extension is blocked or not allowed by the folder rule.