POST
/api/v1/storage/buckets/{bucket_name}/lock/object/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/storage/buckets/{bucket_name}/lock/object/?object_name=<OBJECT_NAME>&project_id=<PROJECT_ID>&location=<LOCATION>&version_id=<VERSION_ID>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "lock_mode": "GOVERNANCE", "retention_period": 3}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/storage/buckets/{bucket_name}/lock/object/", params={"object_name": "<OBJECT_NAME>", "project_id": "<PROJECT_ID>", "location": "<LOCATION>", "version_id": "<VERSION_ID>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "lock_mode": "GOVERNANCE", "retention_period": 3, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/storage/buckets/{bucket_name}/lock/object/");url.search = new URLSearchParams({ object_name: "<OBJECT_NAME>", project_id: "<PROJECT_ID>", location: "<LOCATION>", version_id: "<VERSION_ID>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "lock_mode": "GOVERNANCE", "retention_period": 3 }),});console.log(await response.json());This API allows users to apply governance lock to an object.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”bucket_name
required
string
Bucket Name
Query Parameters
Section titled “Query Parameters”object_name
required
string
Object Name with Directory.
project_id
required
integer
Project ID Find your project id here
location
required
string
Deployment region for the resource. Accepted values: Delhi, Chennai.
Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.
version_id
required
string
Example
740d0a130b0745ebb036bb866c87f847Version ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
lock_mode
string
Example
GOVERNANCEretention_period
integer
Example
3Responses
Section titled “Responses”Response indicating that object retention has been set
Media typeapplication/json
object
code
integer
data
object
bucket_name
string
object_name
string
version_id
string
lock_mode
string
retained_until
string format: date-time
errors
object
message
string
Example
{ "code": 200, "data": { "bucket_name": "example-bucket", "object_name": "example-object.png", "version_id": "abc123-version-id", "lock_mode": "GOVERNANCE", "retained_until": "2025-05-30T12:24:35.844118" }, "errors": {}, "message": "Success"}