Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Object Storage
  • Pricing policy
  • Terraform reference
    • Authentication with the API
      • How to use the API
      • Signing requests
        • All services and methods
          • General multipart upload procedure
          • startUpload
          • uploadPart
          • copyPart
          • listParts
          • abortUpload
          • completeUpload
          • listUploads
        • Common request headers
        • Common response headers
        • Responses
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ

In this article:

  • Request
  • Path parameters
  • Request parameters
  • Headers
  • Response
  • Headers
  • Response codes
  • Data schema
  1. API reference
  2. REST (Amazon S3-compatible)
  3. REST
  4. Multipart upload
  5. copyPart

copyPart method

Written by
Yandex Cloud
Updated at March 19, 2025
  • Request
    • Path parameters
    • Request parameters
    • Headers
  • Response
    • Headers
    • Response codes
    • Data schema

Copies a part of an object.

This method works much the same as uploadPart method, except that it copies data from an existing object rather than providing it in the request body.

For more information on getting started with the API and the general request format, see How to use the S3 API.

RequestRequest

PUT /{bucket}/{key}?partNumber=PartNumber&uploadId=UploadId HTTP/2

Path parametersPath parameters

Parameter Description
bucket Name of the bucket.
key Key of the target object, which is the ID the object is saved with in Object Storage.

Request parametersRequest parameters

Parameter Description
partNumber ID that you assigned to the uploaded part.
uploadId ID of the multipart upload returned by Object Storage at startup.

HeadersHeaders

Use the appropriate common headers in your request.

The Content-Length header is required. The headers listed in the table below are also required.

Header Description
X-Amz-Copy-Source Name of the bucket and the object key whose data will be copied, separated by /.

For example, X-Amz-Copy-Source: /source_bucket/sourceObject.
X-Amz-Copy-Source-Range Byte range to copy from the source object. For example, if you specify X-Amz-Copy-Source-Range:bytes=10-36, then Object Storage will copy the 10th to the 36th bytes of the source object.

The Content-MD5 header is required if default object locks are configured in the bucket.

If you want to add copy conditions, use the headers listed in the table below.

Use the headers from the table below if you need to change the default behavior for the copy method.

Header Description
X-Amz-Copy-Source-If-Match Object copy condition.

If ETag of an object matches the one specified in the header, the object is copied.

If the condition is not met, Object Storage returns the 412 error.

You can use it with the X-Amz-Copy-Source-If-Unmodified-Since header.
X-Amz-Copy-Source-If-None-Match Object copy condition.

If ETag of an object does not match the one specified in the header, the object is copied.

If the condition is not met, Object Storage returns the 412 error.

You can use it with the X-Amz-Copy-Source-If-Modified-Since header.
X-Amz-Copy-Source-If-Unmodified-Since Object copy condition.

The object is copied if it has not been modified since the specified time.

If the condition is not met, Object Storage returns the 412 error.

You can use it with the X-Amz-Copy-Source-If-Match header.
X-Amz-Copy-Source-If-Modified-Since Object copy condition.

The object is copied if it has been modified since the specified time.

If the condition is not met, Object Storage returns the 412 error.

You can use it with the X-Amz-Copy-Source-If-None-Match header.

ResponseResponse

HeadersHeaders

Responses can only contain common headers.

Response codesResponse codes

For a list of possible responses, see Responses.

Additionally, Object Storage may return errors described in the table below.

Error Description HTTP code
NoSuchUpload The specified upload does not exist. This may happen if you specify a wrong upload ID or the upload was completed or deleted. 404 Not Found
EntityTooSmall The part is too small.

The part to upload must be at least 5 MB.
400 Bad Request

Data schemaData schema

<CopyObjectResult>
   <LastModified>2019-02-15T14:32:00</LastModified>
   <ETag>"9bgh7535f2734ec974343yuc93985328"</ETag>
</CopyObjectResult>
Element Description
CopyObjectResult It contains response elements.

Path: /CopyObjectResult.
ETag ETag of the uploaded part of a multipart upload.

Path: /CopyObjectResult/ETag.
LastModified Date when a part of a multipart upload was last modified.

Path: /CopyObjectResult/LastModified.

See alsoSee also

  • Debugging requests using the AWS CLI
  • Example of sending a signed request using curl
  • Code example for generating a signature

Was the article helpful?

Previous
uploadPart
Next
listParts
Yandex project
© 2025 Yandex.Cloud LLC