patch method
Written by
Updated at March 19, 2025
Partially updates and appends object data in Yandex Object Storage.
Note
Basic S3 API operations do not include partial object update. This feature is supported for buckets with versioning disabled.
The request includes the updated object range and the new data.
Objects can be updated concurrently with multiple requests.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
PATCH /{bucket}/{key} HTTP/2
Path parameters
Parameter | Description |
---|---|
bucket |
Bucket name. |
key |
Object key, which is the ID the object is saved with in Object Storage. |
Headers
Use common headers in your request, as well as the headers below:
Header | Description |
---|---|
Content-Range |
This is a required parameter. It takes the bytes {<start_byte>}-{<end_byte>}/* value.Range boundaries are included. The maximum range length is 5 GB. The Content-Length header must be equal to the Content-Range length.To append data to an object, specify the end byte value larger than the object size. The start byte value cannot exceed the object size. The header format complies with RFC 9110
|
X-Yc-S3-Patch-Append-Part-Size |
This is an optional parameter. It takes the {size_of_new_part} value.It defines the size (in bytes) of new parts of an object uploaded in parts, if appending to the end of the object. If the object's last part has reached the specified size, the next append will be saved as a new part. The default value is 25 MB. |
If-Match |
This is an optional parameter. It defines the condition for partial object update. If ETag of an object matches the one specified in the header, the object is updated.If the condition is not met, Object Storage returns the 412 Precondition Failed error.You can use it with the If-Unmodified-Since header. |
If-Unmodified-Since |
This is an optional parameter. It defines the condition for partial object update. The objest is updated if it has not been modified since the specified time. If the condition is not met, Object Storage returns the 412 Precondition Failed error.You can use it with the If-Match header. |
Response
Headers
Responses can only contain common headers.
Response codes
For a list of possible responses, see Responses.
In addition, Object Storage can return other errors described in the table below.
Error | Description |
---|---|
MissingContentRange |
The Content-Range header is missing from the request. |
MalformedPatchAppendPartSize |
The X-Yc-S3-Patch-Append-Part-Size header in the request is invalid. |
ObjectVersionPatchConflict |
During the partial update, the object was overwritten with a new version. |
ConcurrentUpdatesPatchConflict |
The conflict could not be resolved due to a high number of concurrent requests. |
Data schema
<?xml version="1.0" encoding="UTF-8"?>
<PatchObjectResult>
<Object>
<LastModified>2023-07-21T11:46:16.357Z</LastModified>
<ETag>"daebcb5e72f14b690c18018c9f92af05-2"</ETag>
</Object>
</PatchObjectResult>
Tag | Description |
---|---|
PatchObjectResult |
Root element. |
Object |
Parent tag for update results. |
LastModified |
Date and time when the object was last modified. In case of the partial object update, the tag does not change. |
ETag |
ETag of the updated object. For more details, see common headers. |