sessions module route (requires sessions:lease:write)
const url = 'https://example.com/v1/m/sessions/work-items/example/lease/acquire?mode=validate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"changes_requested":true,"command":"example","decision_id":"example","evidence_ref":"example","fence":1,"force":true,"holder_agent_ref":"example","holder_run_ref":"example","holder_sid":"example","plan_hash":"example","reason":"example","ttl_seconds":1,"unblock":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://example.com/v1/m/sessions/work-items/example/lease/acquire?mode=validate' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "changes_requested": true, "command": "example", "decision_id": "example", "evidence_ref": "example", "fence": 1, "force": true, "holder_agent_ref": "example", "holder_run_ref": "example", "holder_sid": "example", "plan_hash": "example", "reason": "example", "ttl_seconds": 1, "unblock": true }'Acquires the lease of one work item as a validate, plan or apply command.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Path parameter id.
Header Parameters
Section titled “Header Parameters ”Target tenant id; required when the principal can act in more than one tenant.
UUID required when mode=apply; reuse it only for an exact retry.
Strong resource ETag required when mode=apply mutates an existing resource.
Optional SHA-256 plan hash that apply must reproduce.
Query Parameters
Section titled “Query Parameters ”Mandatory command phase. validate and plan are observational; apply revalidates and mutates.
Request Body required
Section titled “Request Body required ”Lease WorkCommand shared by validate, plan and apply. The WorkItem target is server-bound.
object
Example generated
{ "changes_requested": true, "command": "example", "decision_id": "example", "evidence_ref": "example", "fence": 1, "force": true, "holder_agent_ref": "example", "holder_run_ref": "example", "holder_sid": "example", "plan_hash": "example", "reason": "example", "ttl_seconds": 1, "unblock": true}Responses
Section titled “ Responses ”OK
object
Example generated
{}Bad request
object
Example generated
{}Unauthenticated
object
Example generated
{}Forbidden
object
Example generated
{}Not found
object
Example generated
{}Conflict / setup required
object
Example generated
{}ETag or plan precondition failed
object
Example generated
{}Domain invariant not satisfied
object
Example generated
{}Work is blocked
object
Example generated
{}Rate limited
object
Example generated
{}Required evidence, policy, clock or store is unavailable
object
Example generated
{}