---
title: "Acquire a project lock"
method: POST
path: "/locks/{key}/lease"
tags: ["Locks"]
---

# Acquire a project lock

`POST /locks/{key}/lease`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/locks/{key}/lease`
- Auth: HTTP bearer

Acquires a project-scoped lease using the project embedded in the service-role key.
The caller must hold the `locks.manage` permission. Repeating the request with the
same lock token is idempotent and resets that lease to the requested TTL. A different
live owner receives `409 lock_held`; a caller whose own lease already lapsed receives
`409 lock_ownership_lost`.

## Path parameters

- `key` string, required

## Headers

- `X-Volcano-Lock-Token` string, uuid, required
- `X-Volcano-Request-Id` string, uuid, required

## Request body

- ProjectLockLeaseRequest
  - `ttl_seconds` integer, required: Lease duration in seconds, from 5 seconds through 90 days, measured from when the request is served. Renew before it elapses. A renewal sets the new expiry outright, so a shorter TTL shortens the lease. Renewals cannot extend an acquisition beyond its absolute 90-day deadline.

## Response `201`

Lease acquired

- ProjectLockLease
  - `expires_at` string, date-time, required: Advisory lease expiry timestamp in UTC.
  - `fencing_token` integer, required: Monotonically increasing token for this acquisition. It rises whenever the lock changes hands and stays the same across renewals of one lease. Pass it to the resource you are protecting and reject any write carrying a token lower than the highest already seen; that is what stops a displaced holder from writing after its lease lapsed.

## Other responses

- `400`: Invalid lock key, token, or TTL
- `401`: Missing or invalid credentials
- `403`: A non-service credential was supplied or the service key lacks `locks.manage`
- `409`: The lock is held by another live lease (`lock_held`), or the caller's own lease lapsed and is not yet reclaimable (`lock_ownership_lost`).
- `429`: Project lock request limit exceeded
- `503`: Lock service unavailable

## Changes

- **2026-09-19** `3a6f365f3f35`: 6 breaking, 12 info
  - the response's body type changed from no type to `object` for status `400`
  - the response's body type changed from no type to `object` for status `401`
  - the response's body type changed from no type to `object` for status `403`
  - the response's body type changed from no type to `object` for status `409`
  - …14 more
- **2026-08-27** `bb44e98aba2e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/locks/:key/lease/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
