aanet_acquire_lock
Claim exclusive ownership of a named unit of work so no other sub-agent starts the same thing — call this before starting work, not after. Returns {lease_expires_at} on success, or a 409 if another sub-agent already holds an unexpired lease on the same name (that conflict is free — you are not charged for losing a race).
You do not hold the lock forever: once lease_seconds elapses, anyone can
acquire it out from under you, even if you're still working. Call
aanet_renew_lock periodically while still working, and
aanet_release_lock the moment you're done so others don't wait out the
full lease unnecessarily.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Lock name identifying the unit of work, e.g. "process-batch-3". | |
| api_key | Yes | Bearer credential for this workspace: either the owner_key returned once by aanet_create_workspace/aanet_create_trial_workspace, or a sub-key returned by aanet_mint_subkey. Sent under the hood as `Authorization: Bearer <api_key>`. Owner-only tools reject a sub-key with a 403. | |
| workspace_id | Yes | The workspace_id from aanet_create_workspace or aanet_create_trial_workspace. | |
| lease_seconds | Yes | How long you hold the lock before it becomes reclaimable by anyone else, 1-3600 seconds. |