/v1/projects/{projectId}/branches/{branchId}/alchemy-state/leaseAcquire Alchemy deploy lease⚠️ Experimental endpoint: this API is in active development and may change at any time without notice. ⚠️
Acquires the deploy lease for a (branch, stack, stage). An expired lease is replaced atomically; a live lease fails fast with 409 naming the current holder — there is no queueing. Every Alchemy state operation requires a live deploy lease.
Parameters
projectIdstringpathrequiredbranchIdstringpathrequiredRequest body
application/json
holderDescriptionstringFree-form description of the acquiring deploy, echoed in the contention error so a blocked deploy can name who holds the lease.
stackstringrequiredAlchemy stack name (opaque wire value).
stagestringrequiredAlchemy stage name (opaque wire value).
ttlSecondsintegerRequested lease TTL in seconds. Default 60, clamped to [30, 300].
{
"holderDescription": "string",
"stack": "string",
"stage": "string",
"ttlSeconds": 0
}Responses
dataobjectrequiredShow child attributes
expiresAtstringrequiredLease expiry as an ISO-8601 timestamp.
leaseIdstringrequiredCapability token for the deploy lease. Send it in the Alchemy-State-Lease-Id header with every state operation; do not log it.
{
"data": {
"expiresAt": "string",
"leaseId": "string"
}
}errorobjectrequiredShow child attributes
codestringrequiredhintstringmessagestringrequired{
"error": {
"code": "string",
"hint": "string",
"message": "string"
}
}errorobjectrequiredShow child attributes
codestringrequiredhintstringmessagestringrequired{
"error": {
"code": "string",
"hint": "string",
"message": "string"
}
}errorobjectrequiredShow child attributes
codestringrequiredhintstringmessagestringrequired{
"error": {
"code": "string",
"hint": "string",
"message": "string"
}
}errorobjectrequiredShow child attributes
codestringrequiredhintstringmessagestringrequired{
"error": {
"code": "string",
"hint": "string",
"message": "string"
}
}