GetBucketWorm is used to query the retention policy information of the specified bucket.

Note If the ID that identifies the retention policy information of the specified bucket does not exist, OSS returns 404.

Usage notes

OSS supports the Write Once Read Many (WORM) strategy that prevents an object from being deleted or overwritten for a specified period of time. You can configure a time-based retention policy for buckets. This policy has a protection period ranging from one day to 70 years.

When a retention policy is locked, you can read objects from or upload objects to buckets. However, the objects or retention policies within the retention period cannot be deleted. You can delete objects only after their retention period ends.

Response elements

Element Type Description
WormConfiguration Container The root node.

Child nodes: WormId, State, RetentionPeriodInDays, and CreationDate

WormId String The ID of the retention policy.
State String The status of the retention policy.

Valid values: InProgress and Locked

RetentionPeriodInDays Positive integer The number of days for which objects can be retained.
CreationDate String The time when the retention policy is created.


  • Sample requests
    GET /? worm HTTP/1.1
    Date: GMT Date
    Authorization: SignatureValue
  • Sample responses
    HTTP/1.1 200 OK
    x-oss-request-id: RequestId
    Date: Date
    Content-Type: application/xml
    Content-Length: length