Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Acquire Alchemy deploy lease

POST/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

projectIdstringpathrequired

pattern ^(proj_)?([cC][^\s-]{8,}|[a-z0-9]+)$

branchIdstringpathrequired

pattern ^(br_)?([cC][^\s-]{8,}|[a-z0-9]+)$

Request body

application/json
object
holderDescriptionstring

Free-form description of the acquiring deploy, echoed in the contention error so a blocked deploy can name who holds the lease.

maxLength 500 · minLength 1

stackstringrequired

Alchemy stack name (opaque wire value).

maxLength 200 · minLength 1

stagestringrequired

Alchemy stage name (opaque wire value).

maxLength 200 · minLength 1

ttlSecondsinteger

Requested lease TTL in seconds. Default 60, clamped to [30, 300].

exclusiveMinimum 0

Example request
{
  "holderDescription": "string",
  "stack": "string",
  "stage": "string",
  "ttlSeconds": 0
}

Responses

201Acquired the deploy lease.application/json
object
dataobjectrequired
Show child attributes
expiresAtstringrequired

Lease expiry as an ISO-8601 timestamp.

leaseIdstringrequired

Capability token for the deploy lease. Send it in the Alchemy-State-Lease-Id header with every state operation; do not log it.

Example response
{
  "data": {
    "expiresAt": "string",
    "leaseId": "string"
  }
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
404Project or branch not found.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
409The deploy lease is held by another deploy.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
413Request body exceeds this endpoint's size cap.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu