Acquire Path Lease
curl --request POST \
--url https://api.zerodrive.dev/v1/leases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"drive_id": "primary",
"branch_name": "main",
"holder_id": "<string>",
"holder_label": "<string>",
"ttl_seconds": 120
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
path: '<string>',
drive_id: 'primary',
branch_name: 'main',
holder_id: '<string>',
holder_label: '<string>',
ttl_seconds: 120
})
};
fetch('https://api.zerodrive.dev/v1/leases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerodrive.dev/v1/leases"
payload = {
"path": "<string>",
"drive_id": "primary",
"branch_name": "main",
"holder_id": "<string>",
"holder_label": "<string>",
"ttl_seconds": 120
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}Acquire Path Lease
Acquire (or re-enter as same holder) an advisory TTL-expiring coordination lease on a file path.
POST
https://api.zerodrive.dev
/
v1
/
leases
Acquire Path Lease
curl --request POST \
--url https://api.zerodrive.dev/v1/leases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"drive_id": "primary",
"branch_name": "main",
"holder_id": "<string>",
"holder_label": "<string>",
"ttl_seconds": 120
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
path: '<string>',
drive_id: 'primary',
branch_name: 'main',
holder_id: '<string>',
holder_label: '<string>',
ttl_seconds: 120
})
};
fetch('https://api.zerodrive.dev/v1/leases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerodrive.dev/v1/leases"
payload = {
"path": "<string>",
"drive_id": "primary",
"branch_name": "main",
"holder_id": "<string>",
"holder_label": "<string>",
"ttl_seconds": 120
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}Authorizations
Body
application/json
Response
Lease record
The response is of type object.

