lock

LOCK: acquire a distributed lock/lease, scoped to YOUR wallet.

LOCK: acquire a distributed lock/lease, scoped to YOUR wallet. Returns { acquired:true, token } if you got it, or { acquired:false, retryInSeconds } if someone else holds it. The lock auto-expires after ttlSeconds (so a crashed holder can't wedge it). Keep the token — you need it to renew or release. Use it to make sure only one copy of your agent runs a critical section. No account or API key — pay per call with x402.

post/api/lock/acquire

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/lock/acquire
  • Auth: API key in header PAYMENT-SIGNATURE

Request body

keystring required

Lock name, up to 256 chars of [A-Za-z0-9._:/-]. e.g. "nightly-report".

ttlSecondsinteger required

Auto-release after this many seconds (1-86400). Set it above your critical section's worst-case runtime.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.