Take a work lease

Takes a work lease on the records an agent works on: subjects (each vendor:<id> or bank_line:<id>, a supplier and its bank lines together, at most 50), holder_label and optionally minutes (15 by default, at most 60) and lease_id (send your own again to renew it). Answers lease_id, subjects, holder_label and expires_at. While it is held, another agent's write that touches a held record is refused 409 leased_by_other_agent: the supplier, its bank lines, its bills and vendor credits, and a booking, reconciliation proposal or question, or transfer on a held bank line; send lease_id with your own writes. A REST integration's writes are never refused by a lease, but its claim is: 409 leased_by_other_agent (subject, holder_label, expires_at in error.fields) when another holder already holds one of the records, the supplier of a held bank line or a bank line of a held supplier, 403 subject_not_viewable without view_vendors or view_bank_accounts for a record, 409 agents_stopped for an agent while the company is stopped. Writes no record. Requires an Idempotency-Key. Requires the agents:action OAuth scope with view_dashboard.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Fields accepted to take a work lease. The schema identifies required and optional values.

A work lease an agent takes before it writes (Brain foundation G2): a
supplier and its bank lines together, each vendor:<id> or
bank_line:<id>.

string
required
length ≤ 80

What the agent is called, shown to another agent its lease refuses

integer
1 to 60

How long to hold them, in minutes: 15 by default, at most 60

uuid

Renew a lease you hold: its lease_id

subjects
array of strings
required
length between 1 and 50

The records to hold, each vendor:<id> or bank_line:<id>: a supplier and its bank lines together

subjects*
Headers
string
required
length ≤ 191

Required unique key whose request hash and terminal response are stored durably for 24 hours.

Responses

Language
Credentials
OAuth2
Missing 1 required scope
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*