Graphon API

S3 · Versioning & retention

PutObjectRetention

PUT/{bucket}/{key}?retention

Sets or extends the retention of one object version.

Storage keeps the version until the date that you send. You can add retention or move the date later. You cannot shorten it.

View as Markdown
Role
Editor or higher
Support
Partial
  • Needs versionId. COMPLIANCE only. Retention can be added or extended, never shortened.

Path parameters

bucketstringrequired

The bucket name.

keystringrequired

The object key. Keep each / as it is. Percent-encode the other reserved characters.

Query parameters

retentionflagrequired

Selects this operation. Send it with no value.

versionIdstringrequired

The version to retain.

Headers

The workspace ID that must own the bucket. Another owner returns 403 AccessDenied.

Request body

Retentionobjectrequired

The root element.

Modestringrequired

Send COMPLIANCE.

RetainUntilDatestringrequired

An ISO 8601 date in the future.

Responses

200OK

Storage saved the retention.

This response has no body.

Errors

Select an error in the response example to see its XML body. Any request can also get the common errors, such as SignatureDoesNotMatch.

400InvalidRequest

The request has no versionId, the mode is not COMPLIANCE, or the date is not in the future.

What to do: Send a versionId, COMPLIANCE mode, and a future RetainUntilDate.

403AccessDenied

The new date is earlier than the current one, or the key does not have the Editor role.

What to do: Send a date on or after the current RetainUntilDate.

404NoSuchKey

The bucket has no object at this key, or no version with this versionId.

What to do: Check the key and the versionId.

405MethodNotAllowed

The versionId names a delete marker, which has no bytes.

What to do: Use the versionId of a version that holds data. ListObjectVersions shows each one.

404NoSuchBucket

No bucket has this name, or the bucket was deleted.

What to do: Check the bucket name. ListBuckets shows the buckets of the workspace.

Was this page helpful?