Moves an object within a bucket.
This operation moves a source object to a destination object in the same bucket by renaming the object. The move itself is an atomic transaction, ensuring all steps either complete successfully or no changes are made.
The move operation performs the following actions:
- The source object is deleted as follows: - No early deletion fee is incurred.
- Soft delete retention period is not applied.
- Audit logs and notification messages are generated for the object.
 
- The destination object is created with the same data and metadata as the source object except for the following changes: - A new object name
- A new generation number
- A new metageneration number, set to1
- New createandupdatetimestamps
- The destination object is moved to Standard storage if the bucket has Autoclass enabled
 
- A new object 
- If a destination folder doesn't exist, the move operation creates the folder along with the destination object. The move operation also automatically creates any necessary parent folders.
Consider the following points when using the move 
method:
- The source and destination must have different object names.
- The source object must exist. You can only move existing objects.
- If an object already exists at the destination, the move operation replaces the existing object. The replaced object will become noncurrent or soft-deleted depending on whether Object Versioning or soft delete is enabled. You can disable the replacement behavior using preconditions on the request.
Request
HTTP request
POST https://storage.googleapis.com/storage/v1/b/ bucket /o/ sourceObject /moveTo/o/ destinationObject
In addition to standard query parameters , the following query parameters apply to this method.
To see an example of how to include query parameters in a request, see the JSON API Overview page.
Parameters
bucket 
string 
sourceObject 
string 
destinationObject 
string 
name 
value, if any. For information about how
          to URL encode object names to be path safe, see Encoding URI path parts 
.ifGenerationMatch 
long 
ifGenerationMatch 
to 0 
makes the
          operation succeed only if there is no live destination object.ifGenerationNotMatch 
long 
ifGenerationNotMatch 
to 0 
makes the operation
          succeed if there is a live version of the object. The ifGenerationMatch 
and ifGenerationNotMatch 
parameters are mutually exclusive.
          Specifying both parameters in a single request results in an error.ifMetagenerationMatch 
long 
ifMetagenerationNotMatch 
long 
ifMetagenerationMatch 
and ifMetagenerationNotMatch 
parameters are mutually exclusive.
          Specifying both parameters in a single request result in an error.ifSourceGenerationMatch 
long 
ifSourceGenerationNotMatch 
long 
ifSourceGenerationMatch 
and ifSourceGenerationNotMatch 
parameters are mutually exclusive.
          Specifying both parameters in a single request result in an error.ifSourceMetagenerationMatch 
long 
ifSourceMetagenerationNotMatch 
long 
ifSourceMetagenerationMatch 
and ifSourceMetagenerationNotMatch 
parameters are mutually exclusive.
          Specifying both parameters in a single request result in an error.projection 
string 
noAcl 
.Acceptable values are:
-  full: Include all properties.
-  noAcl: Omit theowner,aclproperty.
Request body
Do not supply a request body with this method.
Response
If successful, this method returns the destination object's resource in the response body.
The following errors could occur:
- If the source object is subject to either an object retention policy 
or bucket retention policy 
, the request fails with a 403 Forbidden errorwith the reasonretentionPolicyNotMet.
- Likewise, if a live object already exists at the destination and it is subject to either an object retention policy 
or bucket retention policy 
, the request fails with a 403 Forbiddenerror with the reasonretentionPolicyNotMet.
For information about status and error codes returned by this API, see the reference page .
Try it!
Use the APIs Explorer below to call this method on live data and see the response.

