# Brain Dump > Brain Dump is a multi-tenant knowledge base: people and software agents keep structured notes in projects, and every change is recorded as a numbered transaction. This file is the entry point for an agent that works with the HTTP API directly. Start with the guide. ## Work in a project 1. Sign in: [the guide](https://eu.brndmp.com/agents.md) says how; every call after it carries `Authorization: Bearer `. 2. Read the project first: `GET /projects/{p}` and `GET /projects/{p}/schemas` (in a large project, one schema: `GET /projects/{p}/schemas/{s}`). The `description` of the project, of each schema and of each property is the instruction of the people who own the project: what it means and what to put in it. Read them before you write a value or change a property; when a request disagrees with one, say so and ask. See [Read the project first](https://eu.brndmp.com/agents.md#3-read-the-project-first) in the guide. 3. Preview: `POST /projects/{p}/transactions/preview` with the same body as the write, and read its `descriptions`: the descriptions of every schema and property the write touches, at the top of the answer (print the answer whole, or keep `descriptions` in your filter). When one disagrees with what you are about to do, say so and ask. 4. Write: `POST /projects/{p}/transactions` with `base`, `operations` and an `Idempotency-Key` header. 5. Decide on `errors[].code` of a rejection, never on its text. Read the guide whole before your first write. The API's description is `https://eu.brndmp.com/openapi.json`. ## Start here - [The guide for agents](https://eu.brndmp.com/agents.md): register a key, sign in, write with transactions (retry keys, base, local names, conflicts), read with QUERY, rejections and limits. Every example in it is tested. - Saved views: the guide's "Saved views" section lists the views of a schema, runs one with `{"view": "viw_N"}` in the dumps query, and saves a personal one. - A shared view keeps a change log: `GET /projects/{p}/views/{v}/history` answers `{entries: [{id: "vev_N", at, by, change: saved|renamed|restored, restored?, before: {revision, name, query, layout}}], actors}`, newest first, capped per view (`ViewEventsPerView` in the guide's limits; the oldest go first). Creating, moving and a save that changes nothing write none; a personal view keeps none. `POST /projects/{p}/views/{v}/history/{e}/restore` with `{revision}` saves an entry's `before` again, with the checks of `PATCH` (`view_changed`, the query and layout against the schema now; who may change the view); it is an entry of its own; person or reference lanes of that version that went stale since are dropped first. An entry that is not the view's, or was pruned, is `view_event_not_found`. The log goes with its view. `views.list`, `views.query`, `views.get`, and the answers of `views.create`, `views.update` and the restore carry `actors` for `saved_by`. - A board view's `group_by` is a single-select, a multi-select, or a to-one person or reference; for the last two, `lanes` and `hidden` name `usr_N` people of the project or dump keys of the target type (at most `ViewBoardLanes` distinct entries in the guide's limits, together; reads answer current keys). `rows_by` (a second single-select) adds swimlanes; a calendar's `span` is `month` or `week`. A saved entry that went stale is kept and ignored, but refused when sent again. - [The OpenAPI description](https://eu.brndmp.com/openapi.json): every operation with its inputs, outputs and rejections. ## Find out what you may do - [What the signed-in account may do](https://eu.brndmp.com/capabilities): needs a bearer token. `GET /projects/{p}/capabilities` says it per project. - [This server's configuration](https://eu.brndmp.com/config.json): the public URL, which is the `audience` of a sign-in statement, and `presence_heartbeat_seconds`, how often the app sends the presence heartbeat. ## In short - Agents sign in with their own Ed25519 key: `POST /agent-keys` (one-time code and public key, once), then `POST /agent-sign-ins` (a signed statement) for a bearer token that lasts an hour. Send it as `Authorization: Bearer `. `GET /me/keys` lists your keys, each with its `fingerprint` (from the public key; the person who manages you sees the same one) and `last_used_at` (moved by a sign-in only, never by an ordinary request). - An agent has a `description` (at most 2,000 characters) beside its name; the people who manage agents set it (`POST` and `PATCH` on `/me/agents` and `/organizations/{o}/agents`). Their reads give each key's `fingerprint`, `last_used_at` and `in_use` (a live session made with it), and the agent's `last_used_at` (its newest sign-in with any key). A person has at most 50 enabled User Agents and 200 in all, disabled ones included (`too_many_user_agents`). - `GET /me/agents` also gives each of your User Agents a `last_change`: the newest change it sent (never a background recalculation) in a project you can open now, as `project`, `dump` and `schema` (keys), `property` and `at`; absent when it changed nothing in one. Other reads of an agent do not have it. - `GET /organizations/{o}/agents` (the Owner and Organization Administrators) has `actors` for `created_by`, `added_by` and `granted_by`, and each agent's `can_remove` (whether the caller may remove it from the organization, `DELETE /organizations/{o}/members/{account}`). `?include=grants` gives each agent `grants`: its personal grants on the projects the caller can open, `{project, tier, granted_by, granted_at, can_change, can_remove, tiers}` (who gave the present tier and when; whether the caller may change or remove it, and every tier it may set it to, by the rule of `PATCH` and `DELETE /projects/{p}/grants/{account}`), and the list `group_invites`: `{project, tier}` for each project's group invite for Organization Agents, once for all agents; a project the caller cannot open is never listed. `?include=activity` gives each agent `activity: {transactions, days}`: the transactions it sent in the last 30 days, one total over every project of the organization, also ones the caller cannot open. - Every write to project content is `POST /projects/{p}/transactions` with `base`, `operations` and an `Idempotency-Key` header. Repeat a request with the same key to get the same answer. - `POST /projects/{p}/transactions/preview` is a dry run of the same body: the results and what the transaction would do (values converted, dumps errored, rules failing, groups that need a resolution), or the refusal the write would get. Nothing is stored; no retry key. Dumps errored before and after (`errored_before`, `errored`); each rule counted on its own. `"statuses": false` is the light preview: nothing settled, `checked: false`. A large one is `checked: false` too. - Search: `QUERY /projects/{p}/search` with `{q, schemas?, limit?, cursor?}` finds live dumps by the words of their current plain-text and rich-text values (nested objects included): every word in one value, the last as a prefix, ignoring case. It answers `{results: [{dump, schema, matches: [{property, text, marks}]}], transaction, cursor?}`: keys, a plain-text snippet (never HTML) and `[start, end)` character offsets of the matched words; best first, and a `q` that is exactly a key answers that dump first. At least 2 characters of words, at most 8 words and 200 characters (`search_text_invalid`). It reads the project as it is now: `transaction` and `at` are `member_not_allowed`. Example: `{"q": "invoice acm"}`. The filter operator `matches` (plain text and rich text) reads text the same way: every word of the value is in the property's text, the last as a prefix; a value without words matches nothing. - Reads of lists use the HTTP method QUERY with a JSON body. Where a client cannot send QUERY, POST to the same path plus `/query` does the same. - Counts are asked for: `"counts": true` on the dumps query adds `counts` (`matched`, `errored`, `recalculating`) to every page; on `QUERY /projects/{p}/schemas` it adds `dumps` and `last_number` to each schema and `count` to the answer. `GET /projects/{p}/schemas/{s}?include=issues` gives each live property `issues`: `checked`, and when checked `errored` (with `reasons`, dumps by reason code) and `recalculating`, counted in live dumps; above 10,000 live dumps `checked` is `false` with no numbers. A schema list never has them. `?include=used_by` (combinable: `include=issues,used_by`) gives each live property `used_by`: `[{schema, path?, property, in}]`, every live property of the project whose formula (`in: "formula"`) or one of whose rules (`in: "rule"`) reads it, directly or through a reference or a nested object (`supplier.rate` lists the reader under `supplier` and under `rate`); `schema` is the reader's dump schema key, `path` the nested properties down to its schema. One entry per reader and `in`; a property's own rules and saved views are not listed; `[]` when nothing reads it. - Every project carries `members: {humans, agents?}`: the people who can open it (everyone who can open it sees this) and, for its administrators and the Owner only, the Organization Agents that can. `GET /me` for a person adds `invites: {pending}` and `agents: {live}`; an agent gets neither. A person also gets `preferences: {theme, units}`: `theme` is `system`, `day`, `dusk`, `night`, `contrast-day` or `contrast-night`; `units` is `{show, system, domains}` (`show` `as_entered` or `converted`, `system` `metric`, `us` or `imperial`, `domains` a fixed unit code per domain code; defaults `as_entered`, `metric`, `{}`), which only the app uses for display: quantity values are always answered as entered. `PATCH /me` changes them together with their name (people only; agents are refused); `units` is partial, and `null` for a domain removes its fixed unit. - Consent: `GET /me` has `consent: {needed, documents}`. While a person's `needed` is true (only people who signed up after consent was recorded, until they agree), every operation but `GET /me`, `POST /me/consents` and signing out answers `consent_needed` (with the documents' addresses in `expected.allowed`), for them and for their User Agents. `POST /me/consents` (people only) takes `{terms, privacy}`, the addresses of the current documents, which `/config.json` also lists under `documents`. An agent's own `needed` is always false. - A project has a `description` (at most 2,000 characters, `""` when empty; everyone who can open the project reads it). `POST /organizations/{o}/projects` takes it with the name, and `PATCH /projects/{p}` (`{name?, description?}`, Project Administrators and the Owner; below that `tier_too_low`) changes either. `GET /me` gives each organization `personal` (true while it is the private one made at sign-up: a second person has never joined it; it never turns true again) and `people` (its human members). - `QUERY /projects` with `"include": ["summary"]` gives each project `summary`: `schema_keys` (the keys of its live dump schemas, oldest first, at most 6) and `schemas` (how many), `dumps` (not deleted, now), `last_activity` (`{at, by, kind, dump?, schema?: {key, name}}`: its newest caller transaction, never background work; `kind` is `dump_created`, `dump_changed`, `dump_deleted`, `dump_restored`, `dump_moved`, `schema_created`, `schema_changed`, `schema_removed` or `other`; absent when no caller wrote), `people` (up to 5 accounts most recently active, newest first) and `my_agents` (`{id, name, level}`: the caller's own User Agents that can open it). `by`, `people` and `my_agents` point into the page's `actors`. Every field goes to everyone who can open the project. The cursor carries the include. `QUERY /projects` also takes `q` (in the name or description, ignoring case), `organization` (`org_N`; one with nothing of the caller's gives an empty page), `writable: true` (writer or above), `with_my_agents: true` and `sort` (`created`, the default; `name`; `last_activity`, the newest caller transaction first, a project without one last); every project list has `totals: {projects, organizations, by_organization: [{organization: {id, name}, projects}]}`, what the query matches over all pages. The cursor carries the filters and the sort; one sent with a cursor must be the one it carries (`cursor_invalid`). `GET /me/invites` gives each invite `invited_by` (a key of the answer's `actors`, named as for an invitation: a User Agent as its person's agent), `inviter_address_hint` (the sender's address redacted, `an***@example.com`; a User Agent's person's; never the full address) and `created_at`. - `GET /organizations/{o}` has `members`, `people` (the people among them) and `projects` (how many of its projects the caller can open: the length of `GET /organizations/{o}/projects`) for every member, and `agents` and `pending_invites` for the Owner and Organization Administrators only. `QUERY /organizations/{o}/invites` with `"include": ["projects"]` adds the pending invites to the organization's projects where the caller is a Project Administrator (the Owner: all), each with `project`, `tier` and `outside` (no member has that address; it says nothing about whether the address has an account); `pending_invites` counts that list. Revoke such an invite with `DELETE /projects/{p}/invites/{i}`. The organization's and a project's invites lists have `actors` for `invited_by`. - `GET /organizations/{o}/events` (and `QUERY` with `limit` or a `cursor`) lists what happened to an organization, newest first, for its Owner and Organization Administrators: `events` of `{id, kind, actor, at, details}` (kinds `transfer_started`, `transfer_canceled`, `transfer_declined`, `transfer_lapsed`, `transfer_accepted`) and `actors`, which names every account an event or its details mention; someone who left the organization has no name. An event is never changed or removed. - Ownership moves in two steps, both for people only (`humans_only` for every agent, the Owner's User Agent included): the Owner starts a transfer to a person who is a member (`POST /organizations/{o}/ownership` with `{account}`, 201; one at a time, `transfer_pending`), and that person accepts it (`POST /me/ownership-transfers/{t}/accept`), at once if they like, or declines it (`POST /me/ownership-transfers/{t}/decline`, 204); it lapses after 14 days. `GET /me/ownership-transfers` lists the caller's pending ones: `transfers` of `{id, organization: {id, name}, owner, owner_address_hint, started_at, expires_at}` and `actors`. A transfer is not an invite (`GET /me/invites` leaves it out), but `invites.pending` of `GET /me` counts it. Nothing changes before acceptance. The Owner cancels with `DELETE /organizations/{o}/ownership`; `GET /organizations/{o}/ownership/preview` says which of the Owner's User Agents would drop from the Owner level and which Organization Agents' keys the Owner added would be removed. While one is pending, `GET /organizations/{o}` has `transfer: {id, owner, target, owner_address_hint, target_address_hint, started_at, expires_at}` and `actors` for the Owner, the target and administrators; the hints are redacted addresses (`an***@example.com`), never full ones. A step on a transfer that ended is `transfer_not_pending`, with how it ended in `actual`. - `DELETE /me/sessions` (people only; agents are refused) ends every session of the caller but the one that sends it, and answers `{ended}`, how many. The person's agents keep their sessions. - Every option of a select has a `color` (`gray`, `blue`, `teal`, `green`, `yellow`, `orange`, `red` or `purple`; `wrong_type` otherwise, with the eight in `expected.allowed`). `options`, `add_options` and `change_options` take it; a new option without one gets the first of `blue`, `teal`, `green`, `yellow`, `orange`, `red`, `purple`, `gray` that no live option of the property has (else the one the fewest have). Options from before colors are `gray`. A color change is a schema change: in history, in the preview, and it conflicts like a relabel. - A dump schema has `singular` (the name for one dump, `Vessel` for `Vessels`; absent when none, never derived) and `title` (its title property: a live, top-level `plain_text` property without a formula; `property_not_in_schema` or `wrong_type` at `/title` otherwise). `schema.create` and `schema.update` take both; `""` removes one. The server stores them; only the `label` of the linked-from read labels a dump by `title`, and no filter or sort does. Removing the title property, or making it another type or computed, removes the choice in the same transaction; a restore does not bring it back. Both are schema changes. - A property has `card`: `always`, `detail` (default; only in the dump's detail) or `never`, whether it shows on cards. `NewProperty` and `PropertyChange` take it, a schema read always shows it (as of the read), and another value is `wrong_type` with `expected.allowed`. A new board, calendar or map view starts its card from the `always` properties; a saved view's own choice wins. A change is a schema change. - A property also has the layout of a dump's page: `placement`, `table` (in the property table) or `body` (a body section; the default for `rich_text` and `nested`, `table` otherwise); `when_empty`, `show` (default) or `hide`, whether Read shows it without a value; and `group`, the name of its group in the property table (at most `GroupNameRunes` characters; absent or `""` for none). A group is the properties that share a name, ordered by their first property; renaming one is a `change_properties` entry per property. `NewProperty` and `PropertyChange` take them, a schema read always shows `placement` and `when_empty` (and `group` when set), another value is `wrong_type` with `expected.allowed`, and a change is a schema change. Only a top-level property's layout has an effect; a type change leaves the placement as it is. - A dump schema read has `sections`: the page sections `linked_from` and `recent_changes`, fixed parts of every dump's page, in page order, each `{section, placement, group?, when_empty? (linked_from only, default hide), after}`, `after` the live top-level property it follows (`""`: first). `schema.update` places them with `change_sections: [{section, placement?, group?, when_empty?, after?}]`, applied after the property changes; `after` puts a section right after that property, ahead of any section already there. They are not properties (no values, not in `order`); a change is a schema change. - A `quantity` property (a number with a unit) has a required `domain` (`length`, `mass`, `temperature`, ...) and a `unit`, the case-sensitive code of a unit of that domain (`km`, `m2`, `degC`, `gal_us`; the domain's base unit when left out), both shown by a schema read and by the history. Its value is `{"amount": 1250, "unit": "ft"}`, in any unit of the domain, stored and read back as written; a symbol, a name or a unit of another domain is `value_not_representable`, and `expected.allowed` names the codes meant (`gal` gives `gal_us` and `gal_imp`). Filters, sorts and aggregations compare by size, in the base unit (`60 in` equals `5 ft`); `sum` and `average` answer in the property's unit, `sum` of a `temperature` is `wrong_type`. A formula reads a quantity only through `in_unit(q, "cm")`, `unit_of(q)` and `quantity(n, "m2")`. A type change or a move converts between numbers, plain text and quantities, but never between domains. The guide's "Quantities" section has the rules, tested examples and the catalog of all units. - A `date` property has a `precision`, fixed per property: `year` (`"2026"`), `quarter` (`"2026-Q4"`), `month` (`"2026-11"`), `week` (`"2026-W48"`, ISO 8601), `day` (the default, `"2026-11-25"`) or `time` (`"2026-11-25T14:00:00+01:00"`); a value of another form is `value_not_representable`, and there is no `datetime` type. A filter value may be coarser and then means "falls in": on a day column `eq "2026"` is every day of 2026, `lt "2026"` before it, `lte "2026"` in it or before; a moment is compared in UTC. A change of precision is a type change (resolution `start`). The guide's "Dates" section has the table and tested examples. - A property added to a dump schema (`add_properties` of `schema.create` or `schema.update`) takes `fill`: a value written as `set` takes it (a list of identifiers for a multi-select or a to-many property), which every live dump of the schema gets in the same transaction; deleted dumps and dumps created by a later operation do not. Not for a computed, nested or attachment property, or one of a nested schema (`member_not_allowed`). The hard limits of a write refuse it at `/fill` (and a reference to a dump of another schema than the target), as do more values and list items than one type change may migrate (`too_many_values`); a rule never does: a filled value that fails one is errored. The preview counts the dumps in `properties[].filled`. - The type changes to or from text, the fills of a text property and the moves of one transaction write at most 300,000 values together (`TextValuesPerTransaction`), so that the search index stays quick to update; above that the change that goes over is `too_many_values`. Send it in a transaction of its own. - A type change from `plain_text` to `single_select` or `multi_select` converts each text that, trimmed, equals the label of a live option the property has after the operation (`add_options` included), ignoring case, and is not longer than `ConvertibleTextRunes` in the guide's limits: a multi-select gets that one option, a text is never split on commas. The rest is a `resolution_required` group, whose `find` uses `not_convertible_to` with `{"type": "single_select", "labels": [...]}` (at most `FilterListValues` labels). - History: `QUERY /projects/{p}/transactions` with `schema` gives the changes to a schema's definition; add `"include_dumps": true` for the changes to the dumps that were in it at the time too (a moved dump's changes follow it from the move on). - Version numbers: every schema read has `version`, the type's version as of the read: 1 when created, one more per transaction that changed it or anything inside it (properties, options, nested schemas, removal, restore). It is derived, not stored, and equals the number of transactions the history's `schema` filter finds. In the history, each entry of `schemas` and `properties` has the `version` its transaction made; the preview has `versions: [{schema, version}]`, the version a write would make now, per dump schema it changes. - A read of one dump (`GET /projects/{p}/dumps/{d}`, not the dumps of a query) has `version`: how many transactions a caller sent that changed the dump (its creation is 1, a move counts, a recalculation never does), so it equals the number of entries the dump's history (`dump` filter) lists; and `created: {transaction, at, by}`, the transaction that created it, `by` a key of `actors`. Both are as of the read. - What a schema change changed: each history entry of `schemas` and `properties` has `kind` (`added`, `removed`, `restored`, `changed`) and `fields: [{field, before?, after?}]` (a schema: `key`, `name`, `description`, `singular`, `title`; a property: `name`, `type`, `required`, `description`, `formula`, `rules`, `card`, `target`, `many`, `shape`, `domain`, `unit`, `{field: "option", option, before?, after?}` with `{label, color, removed}`, and `order` for a move). Above 8 KB per entry, fields lose `before`/`after` from the last one backward and get `omitted: true`. - What links to a dump: `GET /projects/{p}/dumps/{d}/linked-from` (`transaction` or `at` pins it) answers `{transaction, dumps: [{key, label?, schema}], more}`: the live dumps that link to it through a to-one or to-many reference (at any depth) or a rich text link, each once, by schema key, then number, at most `LinkedFromPage` of the guide's limits. `label` is the text of the title property, else of the first plain-text property. - Who acted: a dump of the dumps query and of `GET /projects/{p}/dumps/{d}` has `changed: {transaction, at, by}` (the latest transaction a caller sent that touched it; a recalculation never counts), and each transaction of the history has `by` (its account, or `system` for background work). `by` is a key of the response's `actors` map: `{account, kind, name?, owner?}`. A User Agent's `name` is given to its owner alone; everyone else gets its `owner` only ("their agent"). Ids (`account`, `by`) are never hidden. - `POST /projects/{p}/presence` (`{schema?, view?}`) is the heartbeat of the app's project pages, for people: it answers `{transaction, by, recalculating, present: [{by, schema?, view?, since}], actors}` (the project's latest transaction of any kind, the account of its latest caller transaction, how many dumps are recalculating, and who else is here: people whose page sent one in the last minute, then agents that wrote in the last 5 minutes). An agent may call it and gets the same answer, but its call is not recorded: an agent shows in `present` by writing. It counts as a read. `transaction` is not a base: send the transaction your own read was made at. - Geo shapes that cross the antimeridian (±180°) take the RFC 7946 form. A `path` that crosses it is a `MultiLineString`, cut there into lines that meet at longitude 180 and -180 at the same latitude (§3.1.9), the positions on either side of each cut more than 180° of longitude apart; a `LineString` whose longitude jumps more than 180° is `value_not_representable`, and so is any other multi-geometry. An `area` that crosses it is a `MultiPolygon` of one-ring polygons, each with an edge along 180 or -180, that joined along those edges make one ring: `[[[[170,-10],[180,-10],[180,10],[170,10],[170,-10]]],[[[-180,-10],[-170,-10],[-170,10],[-180,10],[-180,-10]]]]`; a crossing `Polygon` is refused the same way. A `within` box whose west is greater than its east crosses the antimeridian (§5.2): `[170, -10, -170, 10]`. - A rejection has the content type application/problem+json and lists every problem of its stage in `errors[]`. Decide on `errors[].code`, never on the text. Each kind of rejection has a page at its `type` address (https://eu.brndmp.com/problems/). ## Also - [Health](https://eu.brndmp.com/healthz) - [Kinds of rejection](https://eu.brndmp.com/problems/)