[Yandex Cloud documentation](../../../../index.md) > [Yandex Object Storage](../../../index.md) > API reference > [AWS S3 REST](../../index.md) > [REST](../index.md) > Bucket > GetObjectLockConfiguration

# Object Storage API, Amazon S3-compatible REST: GetObjectLockConfiguration

Returns the settings of [object locks](../../../concepts/object-lock.md) for a [versioned bucket](../../../concepts/versioning.md).

For more information on getting started with the API and the general request format, see [How to use the S3 API](../../index.md).

## Request {#request}

```http
GET /{bucket}?object-lock HTTP/2
```

### Path parameters {#path-parameters}

Parameter | Description
----- | -----
`bucket` | Bucket name.


### Headers {#request-headers}
Use only [common headers](../common-request-headers.md) in your requests.


## Response {#response}

### Headers {#response-headers}

Responses can only contain [common headers](../common-response-headers.md).

### Response codes {#response-codes}

For a list of possible responses, see [Responses](../response-codes.md).


### Data schema {#request-scheme}

```xml
<ObjectLockConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <ObjectLockEnabled>string</ObjectLockEnabled>
   <Rule>
      <DefaultRetention>
         <Mode>string</Mode>
         <Days>integer</Days>
         <Years>integer</Years>
      </DefaultRetention>
   </Rule>
</ObjectLockConfiguration>
```

Element | Description
----- | -----
`ObjectLockEnabled` | <p>Object lock status:</p><ul><li>`Enabled`: You can use object locks.</li></ul><p>If the element is not specified, object locks are disabled.</p><p>Path: `ObjectLockConfiguration\ObjectLockEnabled`.</p>
`Rule` | <p>Lock settings.</p><p>Path: `ObjectLockConfiguration\Rule`.</p>
`DefaultRetention` | <p>Default lock settings.</p><p>Path: `ObjectLockConfiguration\Rule\DefaultRetention`.</p>
`Mode` | <p>Default retention [type](../../../concepts/object-lock.md#types):</p><ul><li>`GOVERNANCE`: Governance-mode retention.</li><li>`COMPLIANCE`: Compliance-mode retention.</li></ul><p>Path: `ObjectLockConfiguration\Rule\DefaultRetention\Mode`.</p>
`Days` | <p>Default retention period in days since the object version upload. It must be a positive integer.</p><p>Path: `ObjectLockConfiguration\Rule\DefaultRetention\Days`.</p>
`Years` | <p>Default retention period in years since the object version upload. It must be a positive integer.</p><p>Path: `ObjectLockConfiguration\Rule\DefaultRetention\Years`.</p>

#### Related articles {#related-articles}

* [Bucket in Object Storage](../../../concepts/bucket.md)

* [Object lock](../../../concepts/object-lock.md)

* [Managing object locks in a bucket](../../../operations/buckets/configure-object-lock.md)

#### Useful links {#see-also}

* [Getting started with the AWS S3 API in Yandex Object Storage](../../s3-api-quickstart.md)

* [Debugging requests using the AWS CLI](../../signing-requests.md#debugging)

* [Example of sending a signed request using curl](../../../api-ref/authentication.md#s3-api-example)

* [Code example for generating a signature](../../../concepts/pre-signed-urls.md#code-examples)