• AI reference · Always listed

records_put

Keep a record. Keep a module's record under a key, on your task; the same put twice is one record. At most 5,000 records a module. Saves at once only in pages, modules, payments, suppliers, collection entries (col-*), a draft lesson (ready: false), bookkeeping (an enrolment's next lesson, a funnel person's stopped: true, a class's places_left recount) and a new class seat or booking (class-seats, class-bookings: seat first, <class>:seat-<n> up to its places, data { class, email, name }, with only_new; then the booking, key_email, the same data and booked with seat: n, or waiting; a seat refused as taken: take the next; refused while the owner pauses sales; the booking gets the site's own confirmation email and reminders); anything else, a booking's cancel too, goes to the owner's yes. Several: propose record_put (up to 50, one yes, all or none). A content collection: module "collections", key its name, data { title, read: public or members, product? (members who bought it only), sort?, order?, schema: JSON Schema of one entry; format media, person, product or course points at the company's own }; new or changed, it waits for the yes; a schema only grows. Entries: module "col-<name>", key the page address, data fits the schema plus _status draft or ready (only ready shows; a visitor's form entry arrives waiting). Their pages: deploy_site.

Where it is

Always listed: call it by its name.

Does it need a yes?

Depends on what it changes: the everyday part runs at once, anything that reaches people or core files waits for the owner's yes. Here: busywork modules (and a collection's entries, col-*), the listed bookkeeping and a new class seat or booking (as a visitor books one) save at once; anything else is a record_put yes.

Inputs

InputTypeNeededAbout
modulestringyesThe module's id, e.g. class-booking (lower case, digits, dashes). · format `^[a-z0-9][a-z0-9-]{0,39}$`
keystringyesThe record's key, e.g. 2026-11-03:yoga. Letters, digits, dots, dashes, underscores and colons, up to 120. · format `^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$`
key_emailstringnoA person's email, added to the key (which then ends in ":", e.g. calm:). · up to 254 characters · format `^[^\s@<>",;]+@[^\s@<>",;]+\.[^\s@<>",;]+$`
dataobjectyesAt most 20,000 characters of JSON. For example { "title": "Yoga", "day": "2026-11-03" }.
departmentstringnoThe module's department, e.g. operations. Needed for its first record. · format `^[a-z0-9-]{1,40}$`
only_newtruenoOnly if the key is free (a class's last seat). When someone else holds it with other data, you get taken and what it holds; the same data again is fine.
base_versionintegernoThe version you read; 0 for a new key. If it changed since, nothing is written and you get stale with its version now. · 0 or more
replacetruenotrue: data replaces the whole record. Left out: data's top-level fields are merged into the record (the others stay).
taskintegeryesThe task you hold that this record is for. · 1 or more
run_idstringyesThe run_id from start. Pass it on every call: it keeps your task held. · 1 to 100 characters

Example

{
  "name": "records_put",
  "arguments": {
    "module": "class-booking",
    "key": "2026-11-03:yoga",
    "data": {},
    "task": 1,
    "run_id": "the run_id from start"
  }
}

When it is refused

  • invalid: The input isn't right. The sentence names the field and the fix; nothing was done. Fix it and call again.
  • not_found: No such thing in this company (a task, file, person, record). Check the number or name, or list first.
  • not_allowed: Not without another step: the owner's yes, your own task held with pick_up, or a setting the owner turns on. The sentence says which.
  • taken: Someone else holds it (another AI on that task). Pick another task.
  • stale: It changed since you read it. Read it again and use the new version.
  • failed: On our side or a service's, never your input. Try again in a minute; if it keeps failing, call report_problem.