{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/version":{"get":{"summary":"Api Version","description":"Version surface: api_version mirrors shared_config.VERSION (kept in lockstep\nin deps.py since the VPS tree deploys without shared_config); min_client_version\nis the LENIENT floor (advisory only — Core warns, never rejects, below it).","operationId":"api_version_api_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","description":"Liveness + DB-reachability probe.\n\nAcquires a pooled connection and runs `SELECT 1` under a short statement\ntimeout. Returns 200 only if the DB answers; 503 (degraded) otherwise.\nDesigned to be polled cheaply and to never crash the app when the DB is\ndown — every failure mode is caught and reported, not raised.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/enforcement/policy":{"get":{"summary":"Get Enforcement Policy","description":"The document every executor reads and caches whole: the phone's package -> thing map, the\neye's mode, the lock hosts, and what the phone no longer bans. The night is not here: it is the\njudge's sealed `fun` and the rulebook's `doctrine.night`.","operationId":"get_enforcement_policy_api_enforcement_policy_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/verdict":{"get":{"summary":"Get Verdict","operationId":"get_verdict_api_verdict_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Verdict","description":"The judge's verdict. `envelope` is the authority and is REQUIRED: Ed25519-sealed by the\njudge, chained to the decision before it, and the only thing a device trusts. Every column\nbeside it is a readable copy of its sealed body; nothing in the plain request body is\nstored. A POST with no envelope is refused and the refusal is a row.","operationId":"set_verdict_api_verdict_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/verdict/current":{"get":{"summary":"Get Current Verdict","operationId":"get_current_verdict_api_verdict_current_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/enforcement/blocks":{"put":{"summary":"Report Blocks","description":"A reporter's complete set of what it is blocking right now.\n\nBody: {reporter, machine_id?, blocks: [{thing, reason, detail?, lifts_at?}]}. Opens rows\nthat are new, closes open rows the set no longer has, refreshes detail/lifts_at on the rest,\nand records that this reporter was heard. An empty list is a real report: nothing blocked.","operationId":"report_blocks_api_enforcement_blocks_put","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Blocks","description":"What is blocked right now and who is reporting: the headline, one row per thing, and every\nreporter's health (enforcement.reporter_health).\n\nWithout `machine`, the rows are what is blocked for the person anywhere\n(enforcement.blocked_now). With it (a core.machines id or hostname), they are what THAT device\nblocks and why -- its own causes plus the judge's, never another device's\n(enforcement.blocked_on): the block page on a device asks for itself, so a phone's cause is\nnever said on Big-Ben's page.","operationId":"get_blocks_api_enforcement_blocks_get","parameters":[{"name":"machine","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/passes":{"post":{"summary":"Request Pass","description":"Request a sleep pass for one package. Accepted now, EFFECTIVE ONLY AFTER\nTHE SAME 12H TIME-LOCK every other loosening in this system obeys.\n\nThat delay is the feature, not an oversight. A pass used to be granted\ninstantly by a quick-settings tile on the phone, which made it a self-granted\nescape from enforcement, tappable at 21:35 by the person being enforced. This\nsystem assumes that person is the adversary (core/CLAUDE.md):\ntightening is instant, loosening is time-locked. A pass asked for tonight is\nusable tomorrow night, so it can be a plan but never an impulse.\n\nBody: {package, minutes?, reason?, cooldown_hours?}.","operationId":"request_pass_api_passes_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Passes","description":"The caller's passes: the ones in force RIGHT NOW, and the ones still waiting\nout their time-lock.\n\n`active` is what the phone enforces on; `pending` exists so the person can see\nthat the pass they asked for is real and when it opens - without that, a\ntime-locked grant is indistinguishable from one that silently failed.","operationId":"get_passes_api_passes_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events":{"post":{"summary":"Emit Event","operationId":"emit_event_api_events_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get All Events","operationId":"get_all_events_api_events_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events/unprocessed":{"get":{"summary":"Get Unprocessed Events","operationId":"get_unprocessed_events_api_events_unprocessed_get","parameters":[{"name":"handler","in":"query","required":true,"schema":{"type":"string","title":"Handler"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events/{event_id}/processed/{handler_id}":{"post":{"summary":"Mark Processed","operationId":"mark_processed_api_events__event_id__processed__handler_id__post","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}},{"name":"handler_id","in":"path","required":true,"schema":{"type":"string","title":"Handler Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/token":{"post":{"summary":"Set Device Token","operationId":"set_device_token_api_devices__device_id__token_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Device Token","description":"Stale-sweep: pc_agent calls this when ntfy confirms a topic is dead\n(404/410 on publish) so a device that has been re-registered or\nuninstalled stops being published to. Deleting an already-absent\ndevice_id is a no-op, not an error.","operationId":"delete_device_token_api_devices__device_id__token_delete","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/tokens":{"get":{"summary":"List Device Tokens","description":"List every registered device's ntfy topic. pc_agent's ntfy publisher\n(Task 11) reads this to know every topic to publish to — ntfy has no\nsingle owner token the way FCM did; each registered device gets its own\npush.\n\nDeliberately NOT filtered by the caller's person: this is the publisher's\naddress book, not a personal feed. The publisher runs under one key and\nhas to see every registered device, Mom's included, or her phone silently\nstops receiving. Person scoping is applied where it decides who gets a\ngiven notification — notify/adapters/push.py selects the devices belonging\nto the notification's own person — not here.","operationId":"list_device_tokens_api_devices_tokens_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/machines":{"get":{"summary":"List Machines","description":"Every device the household has -- computers, phones, the watch -- with whether it is on,\nwhen it was last heard, and its battery where the device reports one (core.devices). The\njudge's cross-machine watchdog (cloud_evaluator/main.py _check_watchdog) reads\nlast_heartbeat; the shell, the phone and Argus list devices from here. machine_id is the\nhostname (the old key); id is core.machines.id. The caller's household's devices only.","operationId":"list_machines_api_machines_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/machines/{machine_id}":{"get":{"summary":"Get Machine","operationId":"get_machine_api_machines__machine_id__get","parameters":[{"name":"machine_id","in":"path","required":true,"schema":{"type":"string","title":"Machine Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Update Machine","operationId":"update_machine_api_machines__machine_id__post","parameters":[{"name":"machine_id","in":"path","required":true,"schema":{"type":"string","title":"Machine Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/presence":{"post":{"summary":"Report Presence","description":"One device saying how long the person has been idle in front of it.","operationId":"report_presence_api_presence_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/machines/{machine_id}/code":{"post":{"summary":"Report Machine Code","operationId":"report_machine_code_api_machines__machine_id__code_post","parameters":[{"name":"machine_id","in":"path","required":true,"schema":{"type":"string","title":"Machine Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sleep/violation":{"post":{"summary":"Push Sleep Violation","operationId":"push_sleep_violation_api_sleep_violation_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sleep/enforcer_status":{"post":{"summary":"Push Sleep Enforcer Status","description":"Written by the phone's sleep enforcer. Read back via\nGET /api/machines/{id}, which merges this settings value into the\nresponse under the `enforcer_status` key (see get_machine above) — that's\nwhat SleepRepositoryImpl.observeEnforcerStatus polls. Deliberately GLOBAL\n(one core.settings row, person NULL): the phone reads it back out of a\nmachine route, which carries no person of its own.","operationId":"push_sleep_enforcer_status_api_sleep_enforcer_status_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/system/services":{"get":{"summary":"Get System Services","operationId":"get_system_services_api_system_services_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/slots":{"post":{"summary":"Post Slots","operationId":"post_slots_api_agents_slots_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Slots","description":"`hostname=` narrows to one machine's slots — the door a board daemon uses to\nfind its own rows after a restart.\n\nIt passes a hostname because a hostname is the only identity a machine knows\nabout itself; core.machines is what turns that into an id, and that mapping\nstays here. A caller filtering the full list itself has to compare Core's id\n('big-ben') against its own hostname ('Big-Ben-Yahu-Connection'), which is\nwhat the ADE did, and why no stale slot was ever closed.","operationId":"get_slots_api_agents_slots_get","parameters":[{"name":"include_ended","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Ended"}},{"name":"hostname","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/messages":{"post":{"summary":"Post Messages","description":"What this machine's sessions said since the daemon last posted: `{\"hostname\", \"messages\": [{\"slot_id\",\n\"session\", \"ref\", \"side\": person|agent|question, \"text\", \"at\"}]}`. Every text goes through\nsecret_shapes.scrub_out before it is stored; a message this machine posted before (same ref) is skipped, so\nthe daemon may post its newest page again after a restart. The person is the slot's, never the body's.","operationId":"post_messages_api_agents_messages_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/slots/{slot_id}/input":{"post":{"summary":"Post Input","description":"Queue one thing for a slot: `{\"text\": \"yes\", \"enter\": true}` or `{\"key\": \"escape\"}`.\n\nThe person's own hand only (deps.require_his_hand: signed in, his phone's key, his desktop face's key): what\nhe types into a coding session is his (D13), and Bram's key does not count. The slot's `person` column is the\nrest of the authorisation. The machine is taken from the slot's row, never from the caller: a slot_id is unique\nper machine, so the lookup is `this person's live slot with this id`, and two machines holding the same id is a\n409 rather than a guess.\n\nQueuing is not applying. The daemon drains this on its next poll and the slot's own state is\nstill telemetry.agent_slots — a 200 here means Core wrote it down, nothing more.","operationId":"post_input_api_agents_slots__slot_id__input_post","parameters":[{"name":"slot_id","in":"path","required":true,"schema":{"type":"string","title":"Slot Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/start":{"post":{"summary":"Post Start","description":"`{\"prompt\", \"name\"?, \"model\"?, \"effort\"?, \"machine\"?, \"card\"?}` -> `{\"session\", \"name\", \"machine\", \"id\", \"card\"}`:\na new coding session, queued for the ADE on that machine, working for that Skunk Works card. The person's own\nhand only, as for typing into one.","operationId":"post_start_api_agents_start_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/checks/run":{"post":{"summary":"Run Checks","description":"Run every Looking Glass session check that is due (telemetry.session_checks): look at its session and tell its\nperson in one message. aegis-session-checks.timer POSTs it every minute over localhost with the app key; running\nit twice in a minute does nothing twice (each check is claimed once).","operationId":"run_checks_api_agents_checks_run_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/commands/{command_id}/result":{"post":{"summary":"Post Result","description":"`{\"hostname\", \"ok\": bool, \"text\"}`: the daemon's answer to a read or diff it collected. The machine must be\nthe key's person's and the command this machine's, a read, diff or screen, delivered and not answered yet. The text\ngoes through secret_shapes.scrub_out before it is stored; a capture (a screen with a path) must be one PNG.","operationId":"post_result_api_agents_commands__command_id__result_post","parameters":[{"name":"command_id","in":"path","required":true,"schema":{"type":"integer","title":"Command Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/slots/{slot_id}/input/{command_id}":{"get":{"summary":"Get Input","description":"Has the machine taken what the phone queued? The phone's loader stops on `delivered`\n(the ADE drained it and typed it into the slot) and says it failed on `expired` (older than\nCOMMAND_TTL and never taken — the drain will not pick it up now). Person-scoped: another\nperson's command is a 404, the same as one that does not exist.","operationId":"get_input_api_agents_slots__slot_id__input__command_id__get","parameters":[{"name":"slot_id","in":"path","required":true,"schema":{"type":"string","title":"Slot Id"}},{"name":"command_id","in":"path","required":true,"schema":{"type":"integer","title":"Command Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/commands":{"get":{"summary":"Get Commands","description":"The board daemon's drain: take this machine's queued commands and mark them delivered.\n\nDelivering and returning are one statement, so a daemon that polls twice never gets the same\nkeystroke twice — at-most-once is the right guarantee here, because a dropped `y` is a\nquestion still waiting and a doubled `y` is an answer to something you never read.\n\nRows older than COMMAND_TTL are left behind for retention.py to sweep; they are not errors,\nthey are the expiry doing its job.","operationId":"get_commands_api_agents_commands_get","parameters":[{"name":"hostname","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/grades":{"get":{"summary":"Get Grades","operationId":"get_grades_api_grades_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/grades/snapshot":{"post":{"summary":"Set Grades Snapshot","description":"The complete-snapshot write path: `grades` is one page, scraped whole or\nnot at all, so this batch IS the entire current-grades truth. complete=True\nlets a class absent from the batch be deleted (the departed-class fix);\n`force` is the caller's declaration that a shrink is genuine, not a partial\nscrape — see schoolworx.py's `push_grades_snapshot` call for why it always\npasses force=True.\n\nschool.grades is keyed by a course id and has no person column of its own, so\ncompleteness is scoped to the set of this person's SchoolWorx course ids —\nanother person's grades can never be in range of this batch's deletions.","operationId":"set_grades_snapshot_api_grades_snapshot_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/grades/term":{"get":{"summary":"Get Grades Term","operationId":"get_grades_term_api_grades_term_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/grades/{class_name}":{"get":{"summary":"Get Grade","operationId":"get_grade_api_grades__class_name__get","parameters":[{"name":"class_name","in":"path","required":true,"schema":{"type":"string","title":"Class Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excusals":{"get":{"summary":"Get Excusals","description":"Every assignment currently excused for the caller. Read by the judge\n(cloud_evaluator.excusals.load_excused_assignments) each evaluation. A row ends by itself: the judge\ndeletes it once its work is turned in or graded, or aged out with its week over.","operationId":"get_excusals_api_excusals_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Excusal","description":"Stop the judge charging for ONE assignment. Body: source, ext_id, reason,\nexcused_by, and optionally title.\n\n`reason` and `excused_by` are REQUIRED and rejected when blank. This is a\nloosening of enforcement, and the whole point of the row is that a person\nreading the table months later can tell a granted extension from a mistake.\nAn excusal with no author is indistinguishable from a bug that wrote a row.\n\nBram's key (anything but the person, his phone or the judge) is refused unless the body names\nhis own message that says so, `desk: id` or `episodic: id`: Core checks it is the person's own\nand from the last half hour (his_word.find), and\nwrites `excused_by` itself from it, so the row says which message it rests on.\n\nFiling wakes the judge at once: the database does it (core.wake_judge, a trigger on this table), so\na row written by any route is heard.","operationId":"set_excusal_api_excusals_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excusals/{source}/{ext_id}":{"delete":{"summary":"Delete Excusal","description":"Withdraw an excusal — the assignment starts counting again, and the judge hears it at once\n(core.wake_judge). The judge itself calls this to end an excusal whose work is done\n(owed.spent_excusals). Scoped to the caller's own person, like every other write here.","operationId":"delete_excusal_api_excusals__source___ext_id__delete","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}},{"name":"ext_id","in":"path","required":true,"schema":{"type":"string","title":"Ext Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/assignments/{source}":{"get":{"summary":"Get Assignments","operationId":"get_assignments_api_assignments__source__get","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Assignments","description":"Batch-replace one source's assignments. Body: {\"assignments\": [...],\n\"force\": <bool, default false>} (or a bare list). complete=True always\nwithin scope={'person': caller.person, 'source': source}; guarded by ingest's\nshrink floor unless force=true.\n\nforce=true is EXPECTED on every call from the acquisition engine\n(acquisition/core_client.py's `assignments` entry) — the Aug-1\nschool-year rollover fix: the first scrape of a new school year is a\nlegitimate ~100% turnover of last year's rows, which the shrink guard\ncannot tell from a half-scrape wipe and would refuse forever (it did,\n2026-08-20, for classroom and msw). The engine's sources are\ncomplete-or-nothing for assignments (a failed course/class/page aborts\nthe run rather than shipping a partial batch), which is what makes the\nunconditional force safe from that caller. The guard still applies in\nfull to any OTHER caller that doesn't pass force.","operationId":"set_assignments_api_assignments__source__post","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/assignments/{source}/{ext_id}/late_policy":{"post":{"summary":"Set Late Policy","description":"Whether the teacher takes this assignment after its due date: {\"accepts_late\": bool}.\nWritten by the late-work check on Big-Ben (acquisition/late_check.py), which reads it off the\nClassroom page (the API has no such field) and copies it to the SchoolWorx row that mirrors\nit. 404 for an assignment the caller does not have. The scrape never touches the column.\n\nMACHINE ROLE ONLY: `false` swaps a miss's age steps (or SchoolWorx's lock-while-missing) for\na single day, so it is a loosening, and the person's own keys (phone, desk) must not be able\nto write it about his own misses (security review, 2026-10-06).","operationId":"set_late_policy_api_assignments__source___ext_id__late_policy_post","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}},{"name":"ext_id","in":"path","required":true,"schema":{"type":"string","title":"Ext Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mastery/{source}":{"get":{"summary":"Get Mastery","operationId":"get_mastery_api_mastery__source__get","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Mastery","description":"Mirrors set_assignments' shape (body {\"mastery\": [...], \"force\": bool}\nor a bare list). `source` is accepted/echoed on the broadcast for the same\nURL-shape symmetry as get_mastery — see that handler's comment — it is\nnever stored or used to scope the table.\n\nHIGH-WATER-MARK ENFORCEMENT (the invariant that stops a skill regressing\nand re-attaining a level from earning credit twice): enforced HERE, in\nthe writer, not inside ingest.apply's generic upsert SQL. ingest.apply's\nupdate branch builds one shared SET plus change-detection clause used by every\n'current' record declared in records.py; bending it to special-case one\ncolumn of one table's monotonicity (a GREATEST() in the SET list, plus a\nmatching GREATEST() in the change-detection comparand so a same-or-lower\nincoming value still reads as a legitimate no-op, not a spurious\n\"updated\") would distort a write path every other declared record also\ndepends on. So this handler reads the stored high_water_mark for every\nskill_id in the batch BEFORE calling ingest.apply, clamps each incoming\nrow to max(stored, incoming), and only then hands already-monotonic rows\nto ingest.apply — which sees a normal upsert and needs no special case.\n\nThis is NOT race-proof: two concurrent POSTs for the same skill_id could\nboth read the same stale high_water_mark and both write from it. That is\nthe same read-then-write posture ingest.apply's own `_existing()` already\naccepts for every other 'current' table (no row-level locking there\neither) — acceptable here because Khan is the table's only writer, so\nnothing else can race it.\n\ncomplete=False always: a partial/paginated Khan scrape must never be able\nto delete a skill's mastery row just because that skill didn't appear in\none batch — the whole point of high_water_mark is that it is permanent\nonce observed, so this table only ever grows or is upserted in place,\nunlike assignments/calendar which intentionally prune what drops\noff the portal.","operationId":"set_mastery_api_mastery__source__post","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/school/events":{"get":{"summary":"Get School Events","operationId":"get_school_events_api_school_events_get","parameters":[{"name":"upcoming","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Upcoming"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set School Events","description":"Batch-replace the SchoolWorx calendar for the current school year.\nBody: {\"events\": [{portal_id, date_from, date_to, title, school_year},\n...], \"force\": <bool, default false>}. complete=True always — the caller\nposts the whole 12-month window every scrape, so a dropped holiday is\ndeleted, not left stale; guarded by ingest's shrink floor unless\nforce=true.\n\nforce=true is EXPECTED here on every call from the acquisition source\n(acquisition/sources/schoolworx.py via core_client.py) — see that\nmodule's docstring for the \"complete-sweep-or-nothing\" contract that\nmakes an unconditional force replace safe from that caller: the source\nonly ever sends a batch when its own 12-month sweep was complete, so\nforce can't mask a half-scrape wipe there. The guard below still applies\nin full for any OTHER caller (a direct API client, a manual backfill)\nthat doesn't come through that contract and doesn't pass force —\nbelt-and-braces, same pattern as finance.py's push_balances/push_bills.","operationId":"set_school_events_api_school_events_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/attendance":{"get":{"summary":"Get Attendance","operationId":"get_attendance_api_attendance_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Attendance","description":"The dates ARE the totals: school.attendance_summary counts the stored rows,\nso a body's own total_absences/total_tardies are no longer stored — a scraper\nthat disagreed with its own date list can no longer publish the disagreement.\nallowed_remaining is the portal's number and has no rows to count, so it is\nkept in core.settings under school/attendance_allowance scoped by person.","operationId":"set_attendance_api_attendance_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/grade/{class_name}":{"get":{"summary":"Get Grade History","operationId":"get_grade_history_api_history_grade__class_name__get","parameters":[{"name":"class_name","in":"path","required":true,"schema":{"type":"string","title":"Class Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Push Grade History","operationId":"push_grade_history_api_history_grade__class_name__post","parameters":[{"name":"class_name","in":"path","required":true,"schema":{"type":"string","title":"Class Name"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/gpa":{"get":{"summary":"Get Gpa","operationId":"get_gpa_api_gpa_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Update Gpa","operationId":"update_gpa_api_gpa_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/academic_history/{year}":{"get":{"summary":"Get Academic History","description":"One school year, by course: the grading periods under `quarters`, and the\ncourse's per-year figures beside them as plain fields.\n\nThe aggregates used to be returned as three extra entries alongside Q1-Q4,\nkeyed 'true_final_grade' / 'yearly_gpa_unweighted' / 'yearly_gpa_weighted',\nbecause that is how they were stored — fake quarters, invented when the only\nwrite path was a POST per (class, quarter). A reader then had to know which\nof a course's keys were grading periods and which were year totals, with\nnothing in the data to say so. They are columns now (`school.quarter` is an\nenum and cannot hold anything else), so they are fields here, and everything\nunder `quarters` is a real grading period.","operationId":"get_academic_history_api_academic_history__year__get","parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"string","title":"Year"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/academic_history/{year}/{class_name}/{quarter}":{"get":{"summary":"Get Quarterly Grade","operationId":"get_quarterly_grade_api_academic_history__year___class_name___quarter__get","parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"string","title":"Year"}},{"name":"class_name","in":"path","required":true,"schema":{"type":"string","title":"Class Name"}},{"name":"quarter","in":"path","required":true,"schema":{"type":"string","title":"Quarter"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/academic_history/{year}/snapshot":{"post":{"summary":"Set Academic History Snapshot","description":"The complete-snapshot write path for one school year's transcript.\n\nReplaced a per-(class, quarter) POST that upserted and never deleted. That\nroute could only ever add: when the school renamed three 2026-2027 courses\nby appending \"Honors\", the pre-rename rows stayed forever and the year read\nback 9 courses for a 6-course schedule — one of them a Christian Education IV\nfrozen at 62.0 that had not existed for weeks.\n\nA year is scraped whole or not at all (history.py walks all four grade\nperiods for it), so this batch IS that year's transcript. complete=True\nscoped to (person, year) lets a course absent from the batch be deleted,\nand can never reach another year or another person. `force` is the caller's\ndeclaration that a shrink is genuine rather than a half-failed scrape —\na renamed course legitimately halves a year, so history.py passes it.\n\nEach item carries its own `quarter` and the per-class-year aggregates\ndenormalized onto it, so the aggregates land in one write instead of a\nfollow-up UPDATE across the class-year.","operationId":"set_academic_history_snapshot_api_academic_history__year__snapshot_post","parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"string","title":"Year"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trajectory":{"get":{"summary":"Get All Trajectories","operationId":"get_all_trajectories_api_trajectory_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/announcements":{"get":{"summary":"Get Announcements","operationId":"get_announcements_api_announcements_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":14,"title":"Days"}},{"name":"all","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"All"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Announcements","operationId":"set_announcements_api_announcements_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/grades/{class_name}/category_weights":{"post":{"summary":"Set Category Weights","operationId":"set_category_weights_api_grades__class_name__category_weights_post","parameters":[{"name":"class_name","in":"path","required":true,"schema":{"type":"string","title":"Class Name"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/courses":{"get":{"summary":"Get Courses","operationId":"get_courses_api_courses_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Courses","operationId":"set_courses_api_courses_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/grades/attendance":{"get":{"summary":"Get Attendance Summary","operationId":"get_attendance_summary_api_grades_attendance_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/health":{"get":{"summary":"Get Scraper Health","description":"Each source's last run: ok, the error, when, and `name` -- what to call it.","operationId":"get_scraper_health_api_scraper_health_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/health/{scraper}":{"post":{"summary":"Set Scraper Health","operationId":"set_scraper_health_api_scraper_health__scraper__post","parameters":[{"name":"scraper","in":"path","required":true,"schema":{"type":"string","title":"Scraper"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/commands":{"get":{"summary":"Get Scraper Commands","operationId":"get_scraper_commands_api_scraper_commands_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/commands/{key}":{"post":{"summary":"Set Scraper Command","operationId":"set_scraper_command_api_scraper_commands__key__post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Clear Scraper Command","operationId":"clear_scraper_command_api_scraper_commands__key__delete","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sync":{"get":{"summary":"Get Sync","operationId":"get_sync_api_sync_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sync/{key}":{"post":{"summary":"Update Sync","operationId":"update_sync_api_sync__key__post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/runs":{"post":{"summary":"Post Acquisition Run","operationId":"post_acquisition_run_api_scraper_runs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Acquisition Runs","operationId":"get_acquisition_runs_api_scraper_runs_get","parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","title":"Source"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/gaming":{"get":{"summary":"Get Gaming History","operationId":"get_gaming_history_api_history_gaming_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Push Gaming Session","operationId":"push_gaming_session_api_history_gaming_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/gaming/daily":{"get":{"summary":"Get Gaming Daily","description":"Computed, never stored: enforcement.gaming_daily is a view over\ngaming_sessions. The agent's nightly aggregator POST that used to write a\ntable of the same name is gone -- there is nothing left to disagree with\nthe sessions it was summing.","operationId":"get_gaming_daily_api_gaming_daily_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/gaming/sessions":{"get":{"summary":"Get Gaming Sessions","operationId":"get_gaming_sessions_api_gaming_sessions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/argus/activity":{"get":{"summary":"Get Argus Activity","description":"The last 30 days of brain runs for this person, newest first: `says` is the one\nsentence to read out loud, plus the goal, what he said about it, which tools it\ntouched, how long it took and why it failed if it did. Empty list if he has run\nnothing -- which is different from the route being broken, and reads that way.","operationId":"get_argus_activity_api_argus_activity_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/argus/own-activity":{"get":{"summary":"Get Own Activity","description":"Everything Bram did on his own in the last `days` days (argus.own_activity), newest first, ready to draw as\nhis profile's Activity tab, and his own runs open right now.\n\nHis diary entries are not rows here: the journal is read in its own place (GET /api/journal, the profile's one\nJournal row), so the Activity tab never lists it a second time (the owner, 2026-12-03). A diary entry stays a row of\nargus.own_activity, so a desk ref to one (diary:<id>) still resolves.\n\nEach row: `id` (msg:, run:, work:, memory:, skill:, order:, suggestion: and its number; a POST /api/desk\nref {kind: activity, id} carries it into a chat), `kind` (told, paused, timer, calendar, work, held, not_told,\nfailed, stopped, memory, skill, order, suggestion: a face draws its icon), `title` (short, plain words), `line` (one\nline of what came of it, whole sentences), `whole` (all of it), `orders` (each order that took part, {id, name,\ndid}), `source` (the original, a URL), `status` (on a message he told: what became of it on the phone, in words), `held_says` and `went_local` (a message that\nwaited for him), `order_run` (a finding waiting for the voice: POST /api/orders/runs/{id}/send has it told now), `at_local`,\n`time_local` and `day_says` (Today, Yesterday, then \"Nov 26\"). `working`: each of his own runs still open (the\ndiary's included), `run_id` (POST /api/argus/runs/{run_id}/stop stops it), `what`, `since_local`, `step`, `waiting`\n(gated on the person's yes, answered in the chat). An empty `rows` means he did nothing on his own, a real answer.","operationId":"get_own_activity_api_argus_own_activity_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/argus/runs/{run_id}/stop":{"post":{"summary":"Stop Run","description":"The person stops one of his runs still going (a row of `working`: an order, the diary). Nothing is written here:\nBram hears \"desk.stop\" {run_id} and interrupts the run, the model call and any running tool; the run closes\nstopped, and what it had already done stays done. 404 when it is not his run or there is none, 409 when it has\nalready finished. Returns {stopping: run_id}.","operationId":"stop_run_api_argus_runs__run_id__stop_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/argus/asks":{"get":{"summary":"Get Asks","description":"Every card Bram asked and what the person answered (argus.asks), newest first: the Approvals tab of his profile.\nEach: `id`, `question` (as the card asked it), `why`, `answer` (Yes, No, Always, or null: never answered),\n`asked_local`, `answered_local`, and `approval` (the standing yes an Always made, while it stands: DELETE\n/api/argus/approvals/{approval} takes it back). `always` counts the standing yeses. An empty list is a real\nanswer: he has asked nothing.","operationId":"get_asks_api_argus_asks_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/argus/approvals/{approval_id}":{"delete":{"summary":"Revoke Argus Approval","description":"Take a standing approval back: Argus asks about that target again from the next call.\nScoped to the caller's own rows (invariant 12), so another person's id answers 404, same\nas a missing one. Deleting the row IS the revoke -- there is no revoked flag, because a\nstanding approval is current truth and a list of things that are no longer true is what\nthe screen must never show him.","operationId":"revoke_argus_approval_api_argus_approvals__approval_id__delete","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"integer","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/transactions":{"post":{"summary":"Push Transaction","operationId":"push_transaction_api_transactions_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Transactions","operationId":"get_transactions_api_transactions_get","parameters":[{"name":"person","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Until"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/finance/transactions":{"get":{"summary":"Get Finance Transactions","operationId":"get_finance_transactions_api_finance_transactions_get","parameters":[{"name":"person","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/finance/balances":{"post":{"summary":"Push Balances","description":"Batch-upsert account balance snapshots (money.accounts, record `accounts`).\nBody: {\"balances\": [{account_id, account_owner, institution, last_four,\naccount_type, ledger, available, credit_limit}, ...], \"complete\": <bool,\ndefault false>, \"force\": <bool, default false>}.\ncomplete defaults False (upsert-on-change, never deletes) because the\nacquisition engine's simplefin source POSTs one batch-of-one per account on\nits own thread: a per-account complete=True batch would claim to BE the\nwhole table and delete the other accounts, and one failed account thread\nwould make an aggregate complete=True batch silently drop that account's\nbalance (a 1-of-5 shrink is under the shrink floor, so nothing would catch\nit). Pass complete=true explicitly for a real full-list replace (guarded by\ningest's shrink floor unless force=true).\naccount_owner defaults to the caller's own person (lowercased) when absent\n— money.accounts.owner is NOT NULL.\n\nbalance_as_of, by contrast, IS taken from the body: it is when the BANK\ncomputed the figure (SimpleFIN's `balance-date`), so it answers \"is this\nconnection alive\", which neither of the other two times can. Three times on\none row, none interchangeable — see money.accounts' comment.\n\nscraped_at is stamped HERE, not taken from the body: it is the moment Core\naccepted this batch, so it cannot be bent by a client's clock and every\nwriter of balances gets it without having to remember. It answers \"when did\nwe last LOOK\", which `updated_at` (last CHANGE) does not — see\nrecords.declare('accounts'), where it is a checked_field. It was written by\nnothing at all until 2026-09-15, so a balance that had not moved in three\nweeks and a scraper that had been dead three weeks read identically.","operationId":"push_balances_api_finance_balances_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/finance/people":{"get":{"summary":"Get Finance People","description":"Each household member's money, the caller first (money.people): to_spend, in_bank, owed,\nand their accounts -- a card's figure is what is owed on it -- with how stale the bank's\nnumbers are. Nothing is added up across people.","operationId":"get_finance_people_api_finance_people_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/family/members":{"get":{"summary":"Get Family Members","operationId":"get_family_members_api_family_members_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/travel":{"get":{"summary":"Get Travel","description":"How long and how far from one place to another: `from` (default: the caller) and `to` are each a person id of the\ncaller's household (their latest fix) or an address. Mapbox does the routing (core/vps/travel.py); a missing\ntoken or a refusal is an HTTP error with the reason, never a guess.","operationId":"get_travel_api_travel_get","parameters":[{"name":"to","in":"query","required":true,"schema":{"type":"string","title":"To"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","default":"driving","title":"Mode"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/family/members/{member_id}/ask":{"post":{"summary":"Ask For Location","description":"Ask someone who has no location yet to share it. The ONE DOOR: a\n`family.location_asked` row on the ASKED person's ledger, `member` = who asked; their\nphone gets the push the catalog grants. Household-scoped, never yourself.","operationId":"ask_for_location_api_family_members__member_id__ask_post","parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/self/location":{"post":{"summary":"Set Self Location","operationId":"set_self_location_api_self_location_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/places":{"get":{"summary":"Get Places","operationId":"get_places_api_places_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Save Place","description":"Upsert one place by (household, name). Everything the matcher needs —\nkind, coordinates, radius — plus the label and address the map shows.\n\nOmitted fields leave an existing place's value alone. The gym is the one\nplace this cannot loosen: see GYM_IS_A_RATCHET above.","operationId":"save_place_api_places_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/places/{name}":{"delete":{"summary":"Delete Place","operationId":"delete_place_api_places__name__delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/family/members/{member_id}":{"post":{"summary":"Upsert Family Member","description":"The phone's only job: hand Core GPS fixes.\n\nBody is one fix object or {\"fixes\": [...]} — the phone spools while offline\nand sends a batch on reconnect, oldest first. A fix is lat/lng (required)\nplus acc, speed, heading, battery, activity and `at` (the phone's own fix\ntime; the receive time stands in when it is missing). Unknown keys are\nignored: the currently-installed phones keep sending name/address/\ninside_home/home_entered_at/updated_at/is_driving for an hour or two after\nthis deploys, and every one of those is a decision Core now makes itself.\n\nPath {member_id} is the phone's member id (jr/mom) and the fixes are recorded\nfor THAT person, not the caller — every phone still shares one app key.\n\nWhat rides back is what the phone needs and nothing else: where Core thinks\nit is, and since when. The geofence fold-in is gone; the phone no longer has\na geofence to cache, because it no longer decides anything.","operationId":"upsert_family_member_api_family_members__member_id__post","parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/family/visits":{"get":{"summary":"Get Family Visits","description":"Where the household has been. One row per stay, newest first.\n\nThis is the reader family.visits lands with — the question neither the phone\nnor the old whereabouts view could answer at all (\"where was he yesterday\",\n\"how long was he at the gym\"). Household-scoped: `person` narrows it to one\nmember of the caller's own household and is refused for anyone else.","operationId":"get_family_visits_api_family_visits_get","parameters":[{"name":"person","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/gym/status":{"get":{"summary":"Get Gym Status","description":"The gym gate right now: done, minutes_today, full_today, in_session, radius_m,\nupdated_at, gym_tier, window_expires_at (+ _local) — derived from the visits ledger.\n\nNo longer a question about TODAY. Since 2026-09-07 the gate is a rolling\nwindow that starts at a session's departure and outlives the accounting day it\nopened in, so `done` means \"a window is live, or the day is waived, or the\nfrequency floor covers it\" rather than \"45 minutes happened today\". See\nlocation.gym_status for the whole rule.\n\nBeside the gate, what the Gym screen reads (location.gym_week, reporting only): the open\nsession's start (it starts on arrival, by itself), the last seven days marked, full sessions\nagainst the frequency floor, days missed, the distance to the gym and the recent sessions.","operationId":"get_gym_status_api_gym_status_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/family/health":{"post":{"summary":"Push Family Health","operationId":"push_family_health_api_family_health_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Family Health","operationId":"get_family_health_api_family_health_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user_state":{"get":{"summary":"List User State","operationId":"list_user_state_api_user_state_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user_state/{key}":{"get":{"summary":"Get User State Route","operationId":"get_user_state_route_api_user_state__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Set User State Route","operationId":"set_user_state_route_api_user_state__key__put","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete User State Route","operationId":"delete_user_state_route_api_user_state__key__delete","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/weather":{"get":{"summary":"Get Weather","operationId":"get_weather_api_weather_get","parameters":[{"name":"lat","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lat"}},{"name":"lng","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lng"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/release/core/manifest":{"get":{"summary":"Get Release Manifest","operationId":"get_release_manifest_api_release_core_manifest_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/release/core/{version}/manifest":{"get":{"summary":"Get Release Version Manifest","description":"The sha256/filename for a SPECIFIC past release, not just the newest one. A client\npinned to what the rulebook's `builds` section still expects (K12/D7: a new build waits\n24 hours, so the expected build often lags the newest published one) asks here instead of\nthe plain manifest route, which always names the latest. 404 for a version deploy_core.sh\nnever published or has pruned (releases_keep.py never prunes one a `builds` word names).","operationId":"get_release_version_manifest_api_release_core__version__manifest_get","parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/release/core/{version}":{"get":{"summary":"Get Release Tarball","operationId":"get_release_tarball_api_release_core__version__get","parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/release/android/manifest":{"get":{"summary":"Get Android Manifest","description":"{version, sha256, filename, published_at, commit} of the APK a phone should be on now.","operationId":"get_android_manifest_api_release_android_manifest_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/release/android/{version}":{"get":{"summary":"Get Android Apk","operationId":"get_android_apk_api_release_android__version__get","parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/perception/rollups":{"post":{"summary":"Push Perception Rollups","description":"Land a batch of closed perception windows: the desktops' 5-minute windows, and the\nphone's hourly screen time (android .../screentime/ScreenTime.kt: bucket 'hour', payload\n{focus: {package: seconds}, labels: {package: name}, top_app}).\n\nrequire_perception (machine + phone), and the row's machine is the CALLER's\n(deps.incident_machine): a key bound to a machine files only under it, and a body\nmachine_id that disagrees is a 403. Admitting the phone widens who may post, never what\na key may speak for.","operationId":"push_perception_rollups_api_perception_rollups_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/perception/judge":{"post":{"summary":"Judge Frame","description":"The phone is a camera, not a judge (redesign spec section 10; frame_judge.py is the\nrule). Body: {frame: base64 JPEG/PNG, app, title, url}. Answer: {seen, convict, score,\ncategory, bar, judge, reason}. The phone carries out `convict` (cover, Home, suspend) and\ndecides nothing. Every conviction is an incident row, written here: one the arbiter\nconfirmed is a strike, exactly as a desktop fire is. A fire the arbiter could not be asked about\nis not a conviction: the phone closes nothing and hears convict=false, and its row says\nmonitored, with no strike and no announcement.","operationId":"judge_frame_api_perception_judge_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/perception/incidents":{"post":{"summary":"Record Perception Incident","description":"Record one explicit-content incident from a desktop eye. The phone's key does not open this\ndoor (device_doors.PHONE): Core files the phone's rows when it judges a frame. The row is filed\nunder the CALLER's machine via incident_machine(), so a key that may write an incident still\ncannot write another machine's. A missing required field is a 400 — a silently dropped incident is worse than\na loud rejection, because the whole point of this table is that the action left an\nauditable trace.","operationId":"record_perception_incident_api_perception_incidents_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Perception Incidents","description":"Recent incidents, newest first — the shape an operator reviewing the false-positive\nrate wants. Only the caller's own: checks on devices their person owns.","operationId":"get_perception_incidents_api_perception_incidents_get","parameters":[{"name":"machine_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/perception/incidents/{incident_id}/audit":{"post":{"summary":"Audit Perception Incident","description":"The arbiter's audit of one instant-lane conviction, from the desktop reflex that closed the\ntab first (vision_reflex.py). Body: {arbiter_veto: bool, arbiter_reason}. Written onto the\nrow once, and the machine is the row's (deps.incident_row_machine: 403 unless the caller\nspeaks for it); a veto erases its strike. Then, and only then, he is told (_announce).\n404 when there is no such row awaiting an audit -- an unknown id, a row the ordinary lane\nwrote, or one already audited.","operationId":"audit_perception_incident_api_perception_incidents__incident_id__audit_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/perception/incidents/{incident_id}/outcome":{"post":{"summary":"Settle Perception Incident","description":"What the desktop reflex's close (or kill) did, after its row was written as closing /\nkilling (the row is written first): body {action: 'closed' | 'not_closed' | 'killed' |\n'not_killed'}. The row says so -- an act that did not happen carries no strike -- and only\nnow is he told (_announce), in the words of what happened. The machine is the row's\n(deps.incident_row_machine). 404 when there is no such row still pending.","operationId":"settle_perception_incident_api_perception_incidents__incident_id__outcome_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/raise":{"post":{"summary":"Raise Route","operationId":"raise_route_api_notify_raise_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RaiseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/{notification_id}/receipt":{"post":{"summary":"Receipt Route","operationId":"receipt_route_api_notify__notification_id__receipt_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Receipt"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/feed":{"get":{"summary":"Feed Route","description":"What the panel opens with, and what it re-reads when the socket says\nsomething changed. Bounded at ledger.FEED_MAX — an unbounded history read\non a 90-day ledger is a slow query waiting to happen, and the panel scrolls\nrather than showing everything at once anyway.\n\n`type` narrows the feed to one notification type, so a screen that shows\none kind of message reads it this way rather than filtering the whole\nper-person feed client-side. Optional; the response shape is unchanged\neither way.","operationId":"feed_route_api_notify_feed_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"before_id","in":"query","required":false,"schema":{"type":"integer","title":"Before Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/less_like_this":{"post":{"summary":"Less Like This Route","description":"The one-tap Less Like This on a message. On an argus.order message the order that decided it\n(notifications.ledger.order_id), and every other order the message answered (facts.orders), goes to log_only if it was on: what it finds is still written down\nand nothing of it reaches them again until THEY turn it back on, and an orders.changed event is\nfiled so Bram puts the order back on his clock. On any other message the person's watch for its\ntype (notifications.ledger.watch) is set to log only, the same way (PATCH /api/notify/watches/{id}\nturns it back on). Already logging or off stays as it is. Sticky, per person, idempotent.\nOrder: returns `order` (its id), `state` and `demoted` (its name). Type watch: `watch`, `state`,\n`demoted`. Offered only where the feed says `less_like_this` (and the push carries the `less`\ntag): a type with a floor -- what the enforcement says -- is turned down, as far as it may be, in\nthe Watching list.","operationId":"less_like_this_route_api_notify_less_like_this_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessLikeThis"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/watches":{"get":{"summary":"Get Watches","description":"What reaches the caller, one watch per notification type (notifications.watching), in one group,\n`system` (\"What reaches you\"; `type` and `area` to group by). What Bram does on his own is\nnotifications.orders (GET /api/orders), not here. Each watch: what it watches for (`says`), its\n`state` (on / log_only / off) and `state_says`, `floor` and `can_lower`, and `record`, the last\nthings it told or logged, newest first -- `outcome` (told, logged, suppressed, ...), `line` as he\ngot it, `when_local` in his time, `source` the page it rests on or null. Only the caller's own; on\nfirst. Every type the catalog has is here, a new one included (made now, on).","operationId":"get_watches_api_notify_watches_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/watches/{watch_id}":{"patch":{"summary":"Patch Watch","description":"The person, or Bram when they ask him, sets one of THEIR type watches on (it tells), log_only (a row only,\nnothing reaches them) or off (its messages are written suppressed). Only the state moves; a watch's floor holds for\nboth (BelowFloor, 409); another person's watch answers 404, the same as a missing one. Kept, never erased.\nIdempotent. Returns the watch's id, says, state and state_says (the state in the list's own words).","operationId":"patch_watch_api_notify_watches__watch_id__patch","parameters":[{"name":"watch_id","in":"path","required":true,"schema":{"type":"integer","title":"Watch Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchState"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/{notification_id}/send":{"post":{"summary":"Send Now Route","description":"Send Now: a message whose push waits for him (its `held`, his rules) goes to his phone now, whatever his rules.\nHis hand only (signed in, or his phone): a desktop or machine key lives where Bram runs, and releasing his own held\nwords is not Bram's to do. 404 when it is not his, or nothing waits on it (already sent). Returns the row as the\nfeed shows it, released.","operationId":"send_now_route_api_notify__notification_id__send_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notify/{notification_id}":{"get":{"summary":"Get One Route","description":"The single-row read the desktop popup uses after a WS nudge names an\nid — 'the socket only decides WHEN, the REST read stays the single\nsource of truth for WHAT' (see feed_route above). Registered AFTER\nGET /api/notify/feed: Starlette matches path templates in registration\norder, and a bare {notification_id} segment matches the literal string\n\"feed\" too — only the int-conversion of that param fails, which is a\n422, not a fall-through. Placing this route first would make\nGET /api/notify/feed unreachable.","operationId":"get_one_route_api_notify__notification_id__get","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classifications/lookup":{"get":{"summary":"Lookup Classification","description":"The drain-rate read. `known=false` NEVER means \"no rate\" — the\ncaller still gets a rate, and it is the harshest one, arrived at by a\nliteral in this function rather than a read of anything else.\n\nIDENTITY NOTE: `exe` is expected to already be the machine-resolved real\npath — resolved by the caller, on the machine that has the filesystem in\nquestion (core/classifier/core_client.py calls this after\ncore/classifier/runner.py::_resolve_exe has already normalized the\nstring). This router does a bare `WHERE exe = %s` below and must NEVER\ncall os.path.realpath/readlink or otherwise resolve `exe` itself — the\nVPS's filesystem is not the governed machine's, so \"resolving\" here\nwould either invent a path or match a different, possibly CHEAPER, row\nthat happens to resolve the same way on THIS filesystem.","operationId":"lookup_classification_api_classifications_lookup_get","parameters":[{"name":"exe","in":"query","required":true,"schema":{"type":"string","title":"Exe"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classifications":{"get":{"summary":"List Classifications","operationId":"list_classifications_api_classifications_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Post Classification","description":"Never classify the same exe twice. ON CONFLICT (exe) DO NOTHING makes\na second write for an already-seen exe a structural no-op, not a\nbehaviour this handler has to remember to enforce -- `written=false` is\nsuccess (200), not an error: the row already existing is the point.\n\nThe stored rate is DERIVED FROM THE CATEGORY, never trusted verbatim\nfrom the body's number -- see `_resolve_stored_rate`. The machine key\nthis endpoint authenticates lives on the enforced person's own desktop,\nso a body claiming `{\"category\":\"game\",\"rate\":0.0}` must not be able to\nbuy permanently free gaming merely by lying about the number; the\nclient's rate may only ever make a classification MORE expensive than\nits category's canonical rate, never cheaper, the same tighten-only\nasymmetry this module already applies to corrections.\n\nIDENTITY NOTE: `exe` is the machine-resolved real path, resolved by the\ncaller (core/classifier/runner.py::_resolve_exe) before it ever reaches\nthis endpoint, for the same reason given on the lookup endpoint above —\nthis router stores exactly the string it is given and must never resolve\nit itself; the VPS filesystem has no bearing on what that path resolves\nto on the machine that sent it.","operationId":"post_classification_api_classifications_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classifications/corrections":{"post":{"summary":"Post Correction","description":"One transaction, one row lock, and the asymmetry the whole schema\nexists to hold:\n\n  TIGHTEN (new_rate >= current_rate) -- write straight through to\n  process_classifications (this path DOES overwrite; it is the one\n  exception to the first-sight table's never-twice rule) and cancel any\n  pending loosen for the same exe in the SAME transaction. Otherwise a\n  legitimate instant tighten would be silently undone 12 hours later by\n  a correction already in the pipe.\n\n  LOOSEN (new_rate < current_rate) -- never touches\n  process_classifications. Inserts a pending row behind\n  GREATEST(12h, delay_seconds) -- a FLOOR computed in SQL, so a caller\n  passing delay_seconds=0 (or negative, or omitting it) cannot buy an\n  earlier effective_at than now()+12h; only a LONGER wait can be\n  requested. A second loosen for the same exe REPLACES the in-flight\n  one (old row cancelled, new row inserted, same transaction) rather\n  than queuing behind it, honouring the one-pending-per-exe partial\n  unique index without ever hitting it.\n\nIDENTITY NOTE + KNOWN RESIDUAL: like the endpoints above, `exe` here must\nalready be the machine-resolved real path, and this router never\nresolves it — same VPS-filesystem-is-not-the-machine's-filesystem\nreasoning. The residual this creates: a correction issued for an\nunresolved or wrapper (symlink) path creates or targets a row that\nnothing on the read side ever looks up (the drain endpoint's lookup is\nalways keyed on the client's resolved path). That is inert and\nfail-safe, not a silent discount — a loosen filed against the wrong\n(unresolved) key can never reach the real, resolved row a tick is\nactually priced against, so it simply never takes effect rather than\ntaking effect somewhere it shouldn't.","operationId":"post_correction_api_classifications_corrections_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classifications/loosens/promote":{"post":{"summary":"Promote Loosens","description":"The background sweep. Promotes every pending row whose effective_at\nhas elapsed: writes its category/rate into process_classifications\n(upsert -- a tighten could have landed for the same exe after this\nloosen was queued but before it was cancelled in a prior call, though\nthe corrections handler above prevents that window from ever existing;\nupsert is still the correct verb because promotion legitimately\noverwrites the current classification) and marks the loosen consumed.\n\nIdempotent and safe to call on any schedule: the WHERE clause\n(effective_at <= now()) is the ONLY place \"is this due yet\" is decided,\nand it can only ever expand which rows already qualify -- there is no\nparameter here that could make a row due sooner than its own\neffective_at, so this endpoint cannot be used to accelerate a\ncorrection, only to apply one that has already waited out its floor.","operationId":"promote_loosens_api_classifications_loosens_promote_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classifications/loosens":{"get":{"summary":"List Loosens","operationId":"list_loosens_api_classifications_loosens_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"pending","title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classifier/blindness":{"post":{"summary":"Report Blindness","description":"Stored as a settings row (domain='perception', key='blindness', machine=<the machine row>)\nper invariant 4 of the database law -- this is current truth, one row per\nmachine, not a new table. `reported_at` is ALWAYS stamped server-side:\ntrusting a client-supplied timestamp here would let a dead classifier's\nlast, stale report claim freshness forever, which defeats the entire\npoint of the staleness check in GET below.","operationId":"report_blindness_api_classifier_blindness_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Blindness","description":"Must fail CLOSED three independent ways -- and, before any of those\nare even reached, gated on whether this machine is expected to be\nrunning a classifier at all. Full decision table:\n\n  | expected? | stored state                  | answer      |\n  |-----------|--------------------------------|-------------|\n  | NO        | anything, including no row     | blind=False |\n  | YES       | no settings row                | blind=True  |\n  | YES       | reported_at older than 180s    | blind=True  |\n  | YES       | malformed record               | blind=True  |\n  | YES       | fresh, blind=true               | blind=True  |\n  | YES       | fresh, blind=false               | blind=False |\n\n0. THE EXPECTATION GATE. `classifier_expectation.is_expected(machine_id)`\n   is checked first, before the settings row is even read, and the\n   server decides this from ITS OWN list -- never from anything the\n   caller asserts about itself. The caller supplies only its\n   machine_id (it already did, as a query param); whether that id is\n   one this deployment expects to be running a classifier is entirely\n   the server's call. A machine that is NOT expected returns\n   blind=False unconditionally -- even if a stale or malformed row\n   happens to be sitting in `settings` for it (see the anti-brick\n   tests in test_classification_router.py) -- because a machine with\n   no classifier BY DESIGN must never be locked out for failing to\n   report one. Locking out a machine nobody asked to watch itself is\n   an outage, not enforcement. See core/vps/classifier_expectation.py\n   for which machines are expected, why that list is a mirrored\n   literal instead of an import, and the honest writeup of the\n   self-asserted-machine_id spoofing tradeoff this gate does NOT close\n   (not duplicated here -- read it there).\n\nOnce a machine is confirmed expected, the three fail-CLOSED checks\nbelow are unchanged. This is the arrangement that makes killing the\nclassifier process WORSE than leaving it running: if silence read as\n\"not blind\" (the natural default for \"I have no information\"), the\nwinning move for the person this system governs would be to `kill -9`\nthe classifier and get free leisure forever. Every branch below is\nchecked in the direction that makes silence, staleness, and a broken\nreport all cost MORE than an honest, fresh, blind=false report --\nthere is no way to reach blind=false except a report that exists,\nparses, is recent, and says so itself (or a machine the expectation\ngate above already excused).\n\n  1. No settings row at all -> blind=true, reason=\"never reported\".\n     A classifier that has never phoned home gets no benefit of the\n     doubt.\n\n  2. `reported_at` older than BLIND_STALE_SECONDS (the classifier's own\n     120s blind threshold plus a heartbeat grace) -> blind=true,\n     stale=true, REGARDLESS of what the stored payload's `blind` field\n     says. A classifier that reported blind=false five minutes ago and\n     has said nothing since is now silent -- and silence, past the\n     grace window, IS the blind signal. This is the branch that\n     specifically defeats \"kill the watcher\": the last report before\n     the kill said blind=false, and this check overrides it.\n\n  3. Stored `blind` is true -> blind=true. The straightforward case.\n\n  4. Anything about the stored value that does not parse (not an\n     object, `reported_at` missing/unparseable, `blind` not a real\n     bool) -> blind=true. A malformed record is exactly the kind of\n     thing a broken or half-killed classifier would leave behind, and\n     it gets no benefit of the doubt either.\n\nOnly when none of the above fire does this return the classifier's own\nhonest, fresh, non-blind report.\n\nEvery branch below returns an `\"expected\"` field so a reader can tell\n\"not blind because it reported fresh and sighted\" (expected=True,\nblind=False) apart from \"not blind because nothing is expected of it\"\n(expected=False, blind=False) -- those are different facts and a\nconsumer that conflates them would silently stop enforcing on a\nmachine that IS expected to report but that a bug caused to look\nunexpected.","operationId":"get_blindness_api_classifier_blindness_get","parameters":[{"name":"machine_id","in":"query","required":true,"schema":{"type":"string","title":"Machine Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/family/heart_rate":{"post":{"summary":"Log Heart Rate","operationId":"log_heart_rate_api_family_heart_rate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Heart Rate","operationId":"get_heart_rate_api_family_heart_rate_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/now":{"get":{"summary":"Get Now","description":"One row: whether fun is open and what he owes (fun, owed), what is blocked and the one next\nstep, place, machines online and the app on screen, GPA, next due (with next_due_local already in\nAmerica/New_York), balances, last scrape. Empty object only if\nthe person has no row (inactive).","operationId":"get_now_api_now_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk":{"get":{"summary":"Get Desk","description":"The caller's thread, oldest first — the order a chat is read in. Without `topic` it is the main chat: every\nthread the router keeps, combined, and never a side chat's lines (argus.topics.side: a scoped task he opened apart\nfrom it). With `topic`, only that chat's messages (a side chat, from the phone's drawer): a topic that is not his\nanswers 404, like one that does not exist. With `every`, every chat at once, each row's `chat` saying which: the\ndesk watcher's read, because Bram owes an answer to each line he wrote, wherever he wrote it (until 2026-10-27 the\nwatcher read the main chat and never saw a side chat's line).\n\n`desk_online` is whether Bram is listening right now: his process holds a socket open for this person\n(deps.listening), so a message or a Stop reaches his run at once. It is here rather than left to a second call\nbecause the phone needs it on the same screen and at the same instant: a message sent while he is not listening is\nnot lost, but the person has to be able to see that it will not be answered yet. Each change is pushed as it\nhappens ({\"event\": \"presence\", \"online\": bool} on the \"desk\" channel).","operationId":"get_desk_api_desk_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"topic","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Topic"}},{"name":"every","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Every"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Send To Desk","description":"The person says something to the desk. Body: {text, typed_on?, images?, quote?, reply_to?, topic?} — typed_on is\n'phone' (default) or 'desktop' (a chatbar; then `hostname` names which machine); images is\n[{data: base64, name?}, ...], JPEG/PNG/WebP stored with the message in the same transaction; quote\nis the text the person had selected, which the question is about; reply_to is the line he swiped to\nanswer (a swipe is the strongest signal of which chat a message belongs to: the row comes back with\n`replying_to` {id, side, text} to draw above it, and Bram files it where that line is filed); topic is the chat\nhe wrote it in (the phone's side chat, opened from the drawer): one of his argus.topics (404 otherwise), stored on\nthe row, and Bram answers it there with no routing at all -- he chose the chat.","operationId":"send_to_desk_api_desk_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/mentions":{"get":{"summary":"Mentions","description":"What the composer's @ (and the attach sheet's To-do) can point at: his assignments due from\na week ago to three weeks out, what is on his calendar from yesterday to two weeks out\n(timed or not, each with its labels), and his classes' announcements (the 14 days retention keeps), newest first. Each is {kind, id, title, detail, group} with the id POST /api/desk `refs` takes, so the\nphone never builds an id. Soonest first within each group.","operationId":"mentions_api_desk_mentions_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/reply":{"post":{"summary":"Reply From Desk","description":"The desk answers. Body: {text, reply_to?, kind?, run_id?, card?, images?, trail?, topic?, sources?, stopped?}.\n\n`text` is his answer as he wrote it; what the phone draws from it (paragraphs, a list, the topic) is read off it\nwhen the row is served (desk_shape.served).\n\n`stopped: true` is an answer the person stopped mid-run (POST /api/desk/{id}/stop): `text` is what was written\nbefore the stop and may be blank (only then), and the row's `stopped_at` says it was stopped; what the run did\nbefore the stop is drawn under it from the run's record (`activity`).\n\n`sources` is what the answer's claims were read from, [{claim, source, title, cited_text}] (the citations\non his words; argus.desk_messages.sources): a face shows where a claim came from, the voice drops it.\n\n`topic` is the argus.topics id the answer belongs to (the label drawn on it); it must be one of\nthis person's topics, else 404.\n\n`images` are pictures Argus shows with the answer ([{data: base64, name?}], the same checks as\nPOST /api/desk): ones he found on the web, or from the thread or his memory. `trail` is what the\nrun did to make the answer ({steps: [words], line, seconds}: `line` the one collapsed row both faces\ndraw under the reply).\n\n`kind` defaults to 'text'. Any reply that carries a card ('gate',\n'result') is validated against desk_cards.CATALOG by the card's own\n`kind`, and refused with 400 rather than stored broken — the person has\nnothing to press on a gate with no options, and no reader can draw a card\nwhose kind it has never heard of. A 'gate' additionally needs `run_id`\n(the `argus.runs` row waiting on the answer), and its card is stored with\n`answered`/`answered_at` forced to null on write; only\nPOST /api/desk/{id}/answer is allowed to fill them in. A card on a kind\nthat draws none is refused too: an object on a row nothing renders is the\ntrap this replaces.\n\nA reply to the person marks every one of this person's still-unseen messages\nseen, in the same transaction as the reply: a reply IS the read receipt.\nDoing it here rather than making Argus post a separate seen call means the\ntwo can never disagree — there is no path that produces an answer to a\nmessage the table still says was never read. A person's message is unseen in\neither of the two states it can be in before a reply: 'sent' (POST /api/desk\nhasn't been read yet) or 'delivered' (the pre-kind status this same column\nused to default to) — both mean \"the desk hasn't answered this yet\".\n\nOnly a reply IS a receipt, and every kind this route takes is one: nothing Bram starts on his own is posted\nhere (the 7am brief, since deleted, once forged a read receipt for his 11pm question).","operationId":"reply_from_desk_api_desk_reply_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/redact":{"post":{"summary":"Redact From Desk","description":"Take a secret back out of every copy of the person's words. Body: {secret, note?}.\n\nWHY THIS EXISTS. On 2026-09-22 the owner typed a live password into the Desk so Argus could\nuse it on a form. Argus was right to refuse it — the vault exists so a password never passes\nthrough the model — but the refusal left the password in the thread, and the turn that read it\nhad already copied it: the run's goal, its steps, its saved state, the verbatim turn log, the facts\ndistilled from it. The first version of this route cleaned the thread alone,\nand run 660 still held the password a day later.\n\nSo the vault's `save` calls this the moment it has sealed the value, and Argus calls it again\nwhen that turn has finished writing (brain.service): every declared copy (words.COPIES) of\nthis person's words has that exact string replaced by a marker. It is an exact-substring\nreplace and nothing cleverer on purpose — a regex that guesses what a password looks like\nwould redact his prose and miss the one that matters. The caller knows the literal because\nthe person typed it.\n\nRows are NOT deleted where they can be rewritten. A message that vanishes is a thread the\nperson cannot follow; a message that says a credential was moved to the vault is the honest\nrecord (root CLAUDE.md — A MESSAGE IS ONE ROW). What cannot be rewritten (a pickled job)\nis dropped, and the answer says so.\n\nAnswers {redacted: [desk message ids], count, copies: {site: rows}, cancelled_runs, dropped_jobs, files, marker} — counts and ids, never text.","operationId":"redact_from_desk_api_desk_redact_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/answer":{"post":{"summary":"Answer Card","description":"The person resolves a gate card. Body: {option, typed_on?}.\n\nScoped to the caller's own thread the same way every other route here is\n(invariant 12) — another person's card id answers 404, same as a missing\none. `FOR UPDATE` closes the double-answer race: two taps on the same\ncard land as one answer and one 409, never two 'me' rows for one card.","operationId":"answer_card_api_desk__message_id__answer_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/stop":{"post":{"summary":"Stop Message","description":"The person stops Bram's answer to a message of his (the composer's one Stop): a typo, a picture he meant to\nswap, a run he no longer wants. 404 when the message is not his own line, 409 when it is already answered.\n\nThe stop is a MARK on his message, `stopped_at`, written in the same transaction it reads the message in, so it\nholds whether or not Bram is listening: the desk watcher never answers a stopped message (a stop sent while Bram\nwas off is not answered hours later), and his next message is a turn of its own, never one that carries this one.\n\nThe `desk.stop` broadcast is the second half: a turn ALREADY running cannot be stopped by a mark, so Bram hears the\nmessage id on its own channel (same shape as `desk.answer`) and interrupts the run, the model call and any running\ntool. What he had written then arrives as his reply marked stopped (POST /api/desk/reply `stopped`), with what the\nrun did before the stop under it, each thing it changed with its Undo. The `desk` broadcasts tell every face to\nre-read the line (it now says stopped) and end the live row with a `stopped` status frame.","operationId":"stop_message_api_desk__message_id__stop_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/activity":{"get":{"summary":"Get Activity","description":"What Bram did for one reply, as the sheet under it opens: {line, seconds, stopped, items, made}.\n\n`items`, in order: for each step a title names, {type: \"said\", text} when he said something just before it, then\n{type: \"step\", n, title, failed, secret, touches, went_in, came_back}; {type: \"stopped\"} after the last when the\nperson stopped the run. Plain words only (run_activity.plain): no tool names, ids, raw JSON or stack traces, and a\nsecret step (the vault, or one that handled a secret) says only its title. `touches` is what the step touched\n(run_activity.TOUCHES: calendar, web, login, memory, order, page, message, file, screen, school, money, other),\nfor a face's glyph. `made` is the reply's `activity.made`. 404 when it is not his reply out of a run.","operationId":"get_activity_api_desk__message_id__activity_get","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/undo/{n}":{"post":{"summary":"Undo Step","description":"The person takes back thing `n` the reply's run made (`activity.made[].n`), through the door that made it\n(run_changes.py), and `n` joins the reply's `trail.undone` in the same transaction. His own hand only (a session,\nhis phone, his desktop face). Returns the reply as every route here serves it, its activity saying undone.\n\n404 when the reply is not his or its run has no call `n`; 409 when that call has no door (the sentence that says\nwhy), it is already undone, or the door refused (in its words, made plain); a door's 403 and 503 pass through.","operationId":"undo_step_api_desk__message_id__undo__n__post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"n","in":"path","required":true,"schema":{"type":"integer","title":"N"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/status":{"post":{"summary":"Post Status","description":"A transient run-status line for the phone to show under the thread\nwhile Argus works — thinking/using a tool/waiting/done/failed. No row: a\nstatus frame the phone missed has nothing to catch up on except the next\none, which is exactly why this is a broadcast and never a write. `text` is\nthe answer to `reply_to` as far as he has written it (module docstring).","operationId":"post_status_api_desk_status_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/image/{n}":{"get":{"summary":"Get Image","description":"Picture n (from 0) on one message, as its own bytes and type. Scoped to the caller's\nthread like every route here: another person's message answers 404, same as one with no\nsuch picture. Cacheable for a day — a message's pictures never change once written.","operationId":"get_image_api_desk__message_id__image__n__get","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"n","in":"path","required":true,"schema":{"type":"integer","title":"N"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/seen":{"post":{"summary":"Mark Seen","description":"Bram has READ this message: the desk watcher calls it the moment a run starts on it, which is\nthe moment the words are in front of the model. The phone's \"Read\" comes off this and nothing\nelse. A reply still marks what it answers seen (reply_from_desk), so a run that read nothing\nfirst cannot leave a line looking unread.\n\nOnly ever strengthens, on the person's own lines: a `desk` row is not his to acknowledge.\nScoped to the caller's own thread: another person's row answers 404, the same answer as a row\nthat does not exist — a stranger must not be able to tell the two apart.","operationId":"mark_seen_api_desk__message_id__seen_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/file":{"get":{"summary":"Get File","description":"The document attached to one message, as its own bytes, type and name. Scoped like the\npicture: another person's message answers 404, same as one with no file.","operationId":"get_file_api_desk__message_id__file_get","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/delivered":{"post":{"summary":"Mark Delivered","description":"The desk watcher on Big-Ben has claimed this message and is dispatching it.\n\nOne tick on the phone. Only ever strengthens: a row already 'seen' stays seen (a reply can\nwin the race with the claim that produced it, and a receipt must never walk backwards), and\na `desk` row is not the person's message to acknowledge.","operationId":"mark_delivered_api_desk__message_id__delivered_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/react":{"post":{"summary":"React","description":"Argus puts a reaction on one of the person's messages, while he works on it.\n\nHis own choice, on the turn — nothing here picks an emoji, and an empty `reaction` clears\none. Only a `me` row can carry it: a reaction is something said ABOUT a message, and he does\nnot react to himself.","operationId":"react_api_desk__message_id__react_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics":{"get":{"summary":"List Topics","description":"The caller's chats, the most recently talked in first: what the move sheet offers, and with `side=true` his\nside chats alone (the phone's drawer). `last_turn_local` is already America/New_York.","operationId":"list_topics_api_topics_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"side","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Side"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Open Side Chat","description":"The person opens a side chat for one scoped task (\"investigate three election candidates\"). Body: {title}: what\nhe asked it to do; its first line, cut at a word, is the chat's title. Answers the chat as GET /api/topics lists\nit. Its messages then go to POST /api/desk with its `topic`.","operationId":"open_side_chat_api_topics_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/topic":{"post":{"summary":"Set Message Topic","description":"Argus files one message to a topic. Body: {topic: id}. The machine key only: the router's\ndecision is his, and the person changes it with /move, which keeps a record of the correction.","operationId":"set_message_topic_api_desk__message_id__topic_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/desk/{message_id}/move":{"post":{"summary":"Move Exchange","description":"The person moves an exchange to another topic (or Argus does, with the machine key, when the person\nsays Bram misread the subject of his last message: argus/brain/service._refile_misread). Body: {topic: id}\nor {new_title: str}.\n\nThe exchange is the person's message and every desk row replying to it: tapping either his\nmessage or one of Bram's replies moves the whole question-and-answer, since a label that moved\nonly the reply would leave Bram reading the question under the wrong subject. `new_title`\nopens the topic first. The move is written to argus.topic_moves (the router's labelled\nmistake) and filed as a `desk.topic_moved` core event {message_id, from, to}, in the same\ntransaction, so Argus re-files the turns behind it. Moving an exchange to where it already is\nchanges nothing and records nothing (`moved` is empty).\n\nReturns {topic: {id, title}, moved: [message ids re-filed]}.","operationId":"move_exchange_api_desk__message_id__move_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors":{"get":{"summary":"List Connectors","operationId":"list_connectors_api_connectors_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Connector","operationId":"create_connector_api_connectors_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/catalog":{"get":{"summary":"Catalog","description":"Apps Bram can be given: Composio's toolkits and the official MCP Registry's remote servers. A source that is\ndown is named in `errors`; the other still answers.","operationId":"catalog_api_connectors_catalog_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{cid}/link":{"post":{"summary":"Link","description":"The one tap that finishes connecting an app, for Bram to hand over in the chat: a short Core address, good for\n30 minutes, that opens the app's own sign-in when the row waits for one (`sign_in`), else a page where the person\ntypes the key it needs (`key`), once. A key goes from that page into the vault: it never passes through Bram, a\nmessage, a model call or a log line.","operationId":"link_api_connectors__cid__link_post","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"integer","title":"Cid"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{cid}/reauthorize":{"post":{"summary":"Reauthorize","operationId":"reauthorize_api_connectors__cid__reauthorize_post","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"integer","title":"Cid"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/oauth/client.json":{"get":{"summary":"Client Document","description":"Core's client metadata document (connectors_oauth.begin): no key, an authorization server fetches it to learn\nwho is signing in and where it may send the person back.","operationId":"client_document_api_connectors_oauth_client_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/connectors/oauth/callback":{"get":{"summary":"Oauth Callback","description":"No API key: the person's browser lands here from the authorization server.","operationId":"oauth_callback_api_connectors_oauth_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/composio/callback":{"get":{"summary":"Composio Callback","description":"No API key: the person's browser lands here once Composio has signed them in, carrying the sign-in's one-time\nstate. Composio is asked, not believed; a Composio that cannot be asked leaves the row as it was.","operationId":"composio_callback_api_connectors_composio_callback_get","parameters":[{"name":"cid","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Cid"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{cid}/state":{"patch":{"summary":"Report State","operationId":"report_state_api_connectors__cid__state_patch","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"integer","title":"Cid"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{cid}/token":{"get":{"summary":"Get Token","operationId":"get_token_api_connectors__cid__token_get","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"integer","title":"Cid"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{cid}":{"delete":{"summary":"Delete Connector","operationId":"delete_connector_api_connectors__cid__delete","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"integer","title":"Cid"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/catalog":{"get":{"summary":"Settings Catalog","description":"Every setting that can exist, with its control, range and English.\n\nThis is what the SUPER+comma panel renders itself from: adding a setting is\na migration, and the panel grows a control for it with no UI change.","operationId":"settings_catalog_api_settings_catalog_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings":{"get":{"summary":"List Settings","description":"The caller's effective configuration: defaults with overrides applied.\n\nPerson-scoped rows are the caller's own. Machine-scoped rows are `machine`\nif given, else the caller's own machine, else every machine (so a reader\nwith no machine identity still sees the whole picture rather than nothing).","operationId":"list_settings_api_settings_get","parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},{"name":"applies_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applies To"}},{"name":"machine","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/{domain}/{key}":{"put":{"summary":"Set Setting","description":"Set one declared setting. Body is the bare JSON value.\n\n`actor=argus` is how the assistant identifies his own writes, so a setting\ndeclared argus_writable=false refuses them. It is a GUARDRAIL, not a\nsecurity boundary -- it stops him changing his own spend ceiling because a\nsentence sounded like an instruction, and nothing here is enforcement, so\nnothing stronger is owed. The assistant stays outside the enforcement trust\nboundary by having no enforcement key in the catalog to reach at all.","operationId":"set_setting_api_settings__domain___key__put","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","title":"Domain"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"machine","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine"}},{"name":"actor","in":"query","required":false,"schema":{"type":"string","default":"person","title":"Actor"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Reset Setting","description":"Drop the override so the declared default takes over again.\n\nDeleting the row is the whole reset -- because the default was never copied\ninto it, there is nothing to restore it to.","operationId":"reset_setting_api_settings__domain___key__delete","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","title":"Domain"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"machine","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/labels":{"get":{"summary":"Get Labels","description":"Every label an item can carry: {labels: [{name, means, works_on_something}]}. One list for every\nhousehold (there is one; the table has no household column), so the same thing is always called the same.","operationId":"get_labels_api_calendar_labels_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Label","description":"{name, means, works_on_something?, source} -> a new label. Refused (409) when the name exists:\nuse it instead. `works_on_something` marks a label whose items are time set aside to work on\nanother item (a work block): they say what they work on, or \"not linked\".","operationId":"create_label_api_calendar_labels_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/events":{"post":{"summary":"Create Event","description":"Add an item: a title on a day, with a time (`start`, and `end` or `duration_minutes` for a span;\na start alone is a moment, such as a deadline at 5 PM) or without one, carrying `labels` (names\nfrom GET /api/calendar/labels; `new_labels` makes new ones) and optionally what it works on\n(`works_on`, or `works_on_new` to add that item too). One Argus proposed and the person agreed\nto, or one placed straight from a face. Returns the row, saying its labels and what it works on\nthe way every face shows them (`labels_says`, `works_on_says`, `date_says`).\nNothing else on the day moves for a face's own write: there is no packer to cascade a change\nthrough. An ASSISTANT write on the caller's own day goes through `store.reconcile_day` — so a blind add cannot stack a\ntitle already on the day: the day this landed on is what it now holds, one call or ten (see that\nfunction's docstring). Another item that starts where this one lands is never removed by it;\nit comes back in `conflicts`, and both stay. A face's own add is unreconciled on purpose — a\nperson adding from a screen has already seen the day.","operationId":"create_event_api_calendar_events_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/facts":{"post":{"summary":"Put Facts","description":"The dates an announcement names, written as facts keyed to that announcement: {announcement:\next_id, facts: [{title, date: YYYY-MM-DD, applies, why, notes?, label?}]} (label: a name from GET\n/api/calendar/labels: test, quiz, deadline ...; applies: whose it is, store.APPLIES, decided for each\none; why: that decision in plain words). Idempotent -- the same announcement read again\nupdates its rows, never adds copies (store.upsert_announced_facts); each date reads back \"from a\nteacher's post\". The one rule of what lands is the store's: his and everyone's on his calendar, a maybe\nas an idea waiting for his yes, other people's not at all (answered 'skipped' with its why). The watch\nengine is the only caller: the model reads the announcement and decides whose each date is, code\nvalidates and sends the dates, and this is where they become rows, so no run's wording can\nmultiply one and nothing lands without a decision.","operationId":"put_facts_api_calendar_facts_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/events/{event_id}":{"put":{"summary":"Update Event","description":"Change or move an event. Send only what changes: title, notes, remind, private, a new time\n(date + start [+ end | duration_minutes], or starts_at/ends_at; `date` alone moves the day and\nkeeps the clock time), estimate_minutes (an item with no time), `labels` (the whole set it now\ncarries), `works_on` / `works_on_new`, `date_source`. A moved item becomes the mover's and a\nmoved draft is accepted.\n\nAn ASSISTANT move of an item's time goes through the same reconciliation `create_event`'s\nassistant adds do (`store.reconcile_day`, one item, this row named by `row_id` so it is never\nre-found by title): anything else on the day that repeats the row's (possibly renamed) title is\ncancelled; anything else that starts in the new stretch is only reported in `conflicts` — the\nmove still lands, both stay. A face's own move is unreconciled, as it always was: a person\nmoving an item from a screen has already seen the day.","operationId":"update_event_api_calendar_events__event_id__put","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"integer","title":"Event Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/tick":{"post":{"summary":"Run Tick","description":"The calendar's minute, for every person with a calendar (see planner/tick.py). Called by\naegis-calendar.timer on the VPS. Idempotent: running it twice in a minute does nothing twice.","operationId":"run_tick_api_calendar_tick_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today":{"get":{"summary":"Get Today","description":"One day as one list, the week strip around it, Bram's one open question for the day and\ntomorrow's first timed item. Items: open first (timed by time, then untimed oldest first), then\ndone by when.","operationId":"get_today_api_today_get","parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string","default":"today","title":"Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/ahead":{"get":{"summary":"Get Today Ahead","description":"What is coming: every open item from today through `days` ahead, each once, on its own day (school\nwork today lists because it is due soon shows on the day it is due). One read for \"what's coming up\",\n\"when is the test\", instead of a day at a time.","operationId":"get_today_ahead_api_today_ahead_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":62,"minimum":1,"default":14,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/tick":{"post":{"summary":"Today Tick","description":"{ref} -> the verdict a tick gives: a calendar row is done at once;\nschool work and the gym are checked against their source (verified / not_done / cant_check).\nNothing about credits or locks moves.","operationId":"today_tick_api_today_tick_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/untick":{"post":{"summary":"Today Untick","description":"{ref} -> a done row back to open. School work and the gym are their source's to undo.","operationId":"today_untick_api_today_untick_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/move":{"post":{"summary":"Today Move","description":"{ref, to, source}: to another day, another time, or both, in his words ('tomorrow', '3pm',\n'friday 1:30pm'). A row keeps whatever `to` does not say: its clock time and length on a new\nday, its day at a new time; an untimed item just changes day. Moves through update_event's\nown write (_update), so the assistant's move is reconciled exactly as it is there, and a move\nthat changes nothing is refused there (409) -- 2026-10-17 a time here was dropped and the\nsame-day \"move\" answered ok, so Bram reported three moves done that changed nothing.","operationId":"today_move_api_today_move_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/drop":{"post":{"summary":"Today Drop","description":"{ref}: take it off the day (cancelled; the row stays, and /restore brings it back).","operationId":"today_drop_api_today_drop_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/restore":{"post":{"summary":"Today Restore","description":"{ref}: undo a drop.","operationId":"today_restore_api_today_restore_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/answer":{"post":{"summary":"Today Answer","description":"{ref, yes}: the person's answer to an idea. yes = it is on the day; no = it is let go\n(cancelled). Only this, or a face's move, ever accepts an idea.","operationId":"today_answer_api_today_answer_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/add":{"post":{"summary":"Today Add","description":"{text, date?, source}: one typed line. Core reads the day and time out of it\n(when_in_text): the item is on the day the text names, else `date`, else today, at the time it\nnames (a moment, no end) or with none. The title keeps the person's casing. {idea: true} from the assistant makes it an idea that waits for a yes. Places through\ncreate_event's own write (_create).","operationId":"today_add_api_today_add_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whoami":{"get":{"summary":"Whoami","description":"Who Core takes this API key to be. The judge seals `person` into every verdict and an\nagent names its machine in its logs; both ask here rather than carry a name of their own,\nbecause identity is a row (database law, invariant 9), not a string in a config file.","operationId":"whoami_api_whoami_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/enroll":{"post":{"summary":"Enroll","description":"Body: {\"hostname\": ..., \"public_key\": <b64>, \"key_type\": \"ed25519\"|\"p256\" (default\ned25519), \"proof\": <envelope sealed with that key whose body is {\"enroll\": hostname}>}.\nThe proof is what makes this more than a claim: only the holder of the private half can\nproduce it.\n\nTHE KEY IS THE IDENTITY, the hostname is a label. A key already on file names its machine,\nwhatever hostname comes with it: the I4 drive (2026-09-26) renamed Big-Ben for 115 s and\nevery process that started in that window was refused, because this door looked the\nhostname up first. When the label differs, the row's hostname follows the key (one\n`machine_renamed` row says from and to) -- unless another machine already holds that name,\nwhich a key can never take.\n\nOnly a key Core has never seen is matched by hostname, and only to a row with no key yet\n(the first enrollment). A DIFFERENT key for a machine that has one is refused and logged --\nreplacing a device's key is a migration, on purpose. A new key under a hostname nobody\ndeclared is refused (400), as before.","operationId":"enroll_api_devices_enroll_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/enforcement/events":{"post":{"summary":"Report Event","description":"Body is a sealed envelope whose body is\n{source, action, target?, reason?, detail?, verdict_seq?, rulebook_version?, build?}.","operationId":"report_event_api_enforcement_events_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/enforcement/events/verify":{"get":{"summary":"Verify Chain","description":"Walk the chain from the oldest surviving row. `broken_at` is the first id whose\nprev_hash is not the row before it, or whose own hash no longer matches its contents.","operationId":"verify_chain_api_enforcement_events_verify_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/rulebook":{"get":{"summary":"Get Rulebook","operationId":"get_rulebook_api_rulebook_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Publish","operationId":"publish_api_rulebook_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/rulebook/history":{"get":{"summary":"Get Rulebook History","description":"Every signed version after `since` (rulebook_store.history) -- how a device that fell\nbehind catches up. See that function's docstring for why current/pending alone cannot do\nthis: `since` must be the version the CALLER already holds, so a catch-up in progress asks\nfor it once, not the whole table every tick.","operationId":"get_rulebook_history_api_rulebook_history_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Since"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/judge/rulings":{"post":{"summary":"Record Ruling","operationId":"record_ruling_api_judge_rulings_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Precedents","description":"The most recent rulings that actually ruled something (ok, with a correction or a\npattern) UNDER THIS CONSTITUTION (its sha256), for the judge to hand the model as precedent.\nA ruling made under an earlier text is not precedent for this one: on 2026-10-06 the new\n`teacher-policy` clause never fired in production because every earlier ruling, decided\nbefore the clause existed, said in its pattern that the very row it was written for \"still\ncounts\", and the model followed them.","operationId":"precedents_api_judge_rulings_get","parameters":[{"name":"constitution","in":"query","required":true,"schema":{"type":"string","title":"Constitution"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":8,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/fleet/beat":{"post":{"summary":"Beat","description":"Sealed body: {kind: 'beat'|'goodbye', build, rulebook_version, verdict_seq, mechanisms,\nbattery?, reason?, reconnect_after?}. `battery` ({percent, discharging}, a laptop's) is kept as\nenforcement.fleet.on_battery: silence after a beat on battery reads as off, not dark (a battery\nthat dies cannot say goodbye). An \"I'm alive\" cannot be replayed: Core refuses any message\nwhose timestamp is not newer than the last one it holds from that device (and one more than\nfive minutes from its own clock).\n\n`reconnect_after` (F2 follow-up, 2026-09-24): the device's OWN account of a cutoff it just\ncame back from -- {seconds, network} -- carried on the first beat/goodbye that lands after\none or more sends failed locally (pc_agent/fleet.py's `_cutoff_since`). It never changes\ndark/off/reporting: that is still decided purely by beat timing (Law 1 -- a laptop cut off\nfrom Core, on purpose or not, still costs leisure). It only says WHY on the device_back row\nthat fires anyway, so a captive-portal Wi-Fi reads differently from a real kill.","operationId":"beat_api_fleet_beat_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/fleet/sweep":{"post":{"summary":"Sweep","description":"Body: {\"orders\": {machine: <judge-sealed {order: 'restart', machine}>}} -- orders for\ndevices an earlier sweep reported dark; {} on a plain look. Answers {\"dark\": [...],\n\"newly_dark\": [...]}. A device is marked (and gets its one `device_dark` row) the first\ntime a sweep sees it dark; its next beat clears the mark and the order.","operationId":"sweep_api_fleet_sweep_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/fleet/order":{"post":{"summary":"Revive Order","description":"The sealed restart order waiting for the asking machine, or null. Asked by that\nmachine's revive unit (pc_agent/revive.py) with an envelope sealed by its DEVICE key --\nthe machines share one API key, so the key that sealed the question is the only thing\nthat says which machine is asking. The unit verifies the judge's seal on the answer.","operationId":"revive_order_api_fleet_order_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/judge/restart-request":{"post":{"summary":"Judge Restart Request","description":"Sealed body: {kind: 'restart?'}. Any enrolled, reachable device may ask -- the judge is\nthe one thing NOTHING enforces without, so refusing this to a device that is not one of\nthe two computers would only be security theater. Every ask is logged (`judge_restart_\nrequested`, detail.judge_alive) whatever the outcome; an actual restart is its own row\n(`judge_restarted`) -- L6: a tamper-ish event belongs on the enforcement log, never only in\na print(). Restarts ONLY when Core's own check finds the judge silent, and even then is\ndebounced to once every _JUDGE_RESTART_MIN_INTERVAL.","operationId":"judge_restart_request_api_judge_restart_request_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sorter/met":{"post":{"summary":"Met","description":"A device reports what it has met, for the sorter to rate before anything closes it by default. Body, each\nlist optional but one required: {apps: [{package}], domains: [{host, title?}], programs: [{exe, exe_evidence?}],\nmachine_id?} (machine_id is the hostname of a computer whose key names no machine).\nThe phone sends `apps` (everything installed); a computer sends the `domains` and `programs` it sees in focus\n(pc_agent/sightings.py). Every one that nothing already rates (the owner's rulebook, Core's phone app map, an\nearlier sighting) is sighted under sorted_store's daily cap, whatever `fun` says: a thing nobody has sorted is\nclosed by default, so a new game or video site that never reached the sorter could never be told apart.\n\nOnly the evidence that is not the device's own word about what the thing is is kept: an app's package (the sorter\nreads the Play Store listing), a domain's tab title (when the site cannot be fetched), a program's path and its\npackage manager's reading (sorted_store.program_evidence). Never an answer: what a thing IS comes only from the\nsorter, under the judge's seal. Answers {sighted, known}, summed over the three kinds.","operationId":"met_api_sorter_met_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sorter/work":{"get":{"summary":"Sorter Work","operationId":"sorter_work_api_sorter_work_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sorter/life":{"get":{"summary":"Sorter Life","description":"The person's life as the video judge reads it for one video (sorted_store.his_life): his\nareas, Bram's lines that match `about` (the video's channel and title), what is due.","operationId":"sorter_life_api_sorter_life_get","parameters":[{"name":"about","in":"query","required":true,"schema":{"type":"string","title":"About"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sorter/answers":{"post":{"summary":"Sorter Answer","operationId":"sorter_answer_api_sorter_answers_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dns/plan":{"get":{"summary":"Get Plan","operationId":"get_plan_api_dns_plan_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dns/eyes_on":{"post":{"summary":"Set Eyes On","description":"The judge's read of the resolver's own query log (dns_layer.py, once a minute): a device\njust looked up a gray host, so its eye watches for the next 5 minutes. `signals` names the\ndevice by its DNS ClientID, which is core.machines.id (the same id GET /api/dns/plan hands\nout as `devices`) -- an id that does not resolve to a machine this person owns is a stale or\nforged client id from the query log and is silently dropped, never raised.","operationId":"set_eyes_on_api_dns_eyes_on_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dns/eyes_on/{device}":{"get":{"summary":"Get Eyes On","description":"Whether `device` should have its eye on right now (N8/P2), for the desktop eye\n(core/perception) and the phone to read as a second trigger beside their own local one. A\ncaller may ask only about the machine its own key is bound to, when it is bound to one --\nmirrors deps.incident_machine's handling of a shared, unbound key.\n\n`device` is a machine id or its hostname (deps.machine_named, the one resolver): the\ndesktop eye names itself by socket.gethostname() (\"Big-Ben-Yahu-Connection\") while the\njudge files the signal under the id (\"big-ben\"), and until 2026-09-26 this read the\nhostname's row, which never exists -- Big-Ben's second trigger answered null every time.\nA name that is no machine answers null, like any read of a machine nobody declared.","operationId":"get_eyes_on_api_dns_eyes_on__device__get","parameters":[{"name":"device","in":"path","required":true,"schema":{"type":"string","title":"Device"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages":{"post":{"summary":"Make Page","description":"Make a page. Answers its id, version 1, the link to open and its settings.","operationId":"make_page_api_pages_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Pages","description":"His pages, pinned first, then most recently changed, each with its link, what last changed, and what waits for\nBram: comments he has not been told of and hand edits since Bram's own last version. An empty list means he has none.","operationId":"list_pages_api_pages_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"folder","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/page-viewers":{"post":{"summary":"Viewer Token","description":"A short-lived sign-in for opening pages, for the app that holds this key to hand the page host (in the link's\n#v= fragment, which no server sees). Only a key that is a person's own face (his phone, his desktop) signs in as him;\nany other key (Bram's machine and app keys among them) gets a preview token: it reads, never writes or spends.","operationId":"viewer_token_api_page_viewers_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages/{page_id}":{"post":{"summary":"Change Page","description":"A new version of a page, at the same link. Anything left out carries over from the shown version; `restore: N`\ncopies version N forward, so an undo is history too, never a rewrite. `draft: true` writes the version as a draft:\nthe page keeps showing what it showed, and the person previews the draft and publishes it (or Bram does, told to).","operationId":"change_page_api_pages__page_id__post","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Read Page","description":"One page: the shown version's body (or version N's, a draft's included), its versions with notes and who wrote\neach, its settings, its comments (marked told: Bram has now seen them), its files and how much data it keeps.","operationId":"read_page_api_pages__page_id__get","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Page","description":"Delete a page and every version, file, comment and row of it; its link answers 404 from now on. Scoped to the\ncaller's own pages, so another person's id is 404 like a missing one.","operationId":"delete_page_api_pages__page_id__delete","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages/{page_id}/settings":{"post":{"summary":"Page Settings","description":"Who may open it, what it can do, its folder and pin. Not a version: the page's words stay as they are.","operationId":"page_settings_api_pages__page_id__settings_post","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageSettings"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages/{page_id}/publish":{"post":{"summary":"Publish","description":"The waiting draft becomes the version the page shows.","operationId":"publish_api_pages__page_id__publish_post","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/made":{"get":{"summary":"List Made","description":"Everything Argus made for him, newest first: his pages (argus.pages_made) and the Google Docs and decks the Desk\nthread carried a file card for (argus.desk_messages, one row per file, its latest card). A markdown page carries\nthe start of its current version (`preview`) so the phone can draw it small without opening it.","operationId":"list_made_api_made_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":60,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages/{page_id}/data":{"get":{"summary":"Page Data","description":"Everything the page keeps: the shared rows and each viewer's own, newest first (Bram reads back what a page\ncollected).","operationId":"page_data_api_pages__page_id__data_get","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Write Page Data","description":"Bram writes a row the page reads (an order keeping a dashboard current writes its numbers here); every viewer\nwith it open redraws.","operationId":"write_page_data_api_pages__page_id__data_post","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages/{page_id}/pictures":{"post":{"summary":"Add Picture","description":"Keep a picture with the page (from a public address, his thread, or bytes) and answer the `file:<id>` the page\nwrites where the picture goes; the page keeps it whatever happens to where it came from.","operationId":"add_picture_api_pages__page_id__pictures_post","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PictureIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/oauth-protected-resource/bram/mcp":{"get":{"summary":"Protected Resource Metadata","operationId":"protected_resource_metadata__well_known_oauth_protected_resource_bram_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"summary":"Authorization Server Metadata","operationId":"authorization_server_metadata__well_known_oauth_authorization_server_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/bram/oauth/register":{"post":{"summary":"Register","operationId":"register_bram_oauth_register_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/bram/oauth/authorize":{"get":{"summary":"Authorize","description":"Validate the request, make a pairing, and ask who is connecting: Bram's road shows the code for the phone,\nLooking Glass the Keelson sign-in. Anything wrong with the client or its redirect is said on the page and never\nredirected to: an unregistered redirect is exactly the place a code must not be sent.","operationId":"authorize_bram_oauth_authorize_get","parameters":[{"name":"client_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Client Id"}},{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string","default":"","title":"Redirect Uri"}},{"name":"response_type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Response Type"}},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code Challenge"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code Challenge Method"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"resource","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"}},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bram/oauth/sign-in":{"post":{"summary":"Sign In","description":"Looking Glass's Connect page posts the person's Keelson email and password here, for the pairing it holds. Right,\nand the person has a computer to run sessions on: the pairing is allowed for them with no areas and the browser\ngoes straight back to the AI with its authorization code. Wrong: the page again, saying why. Five wrong on one\npairing end it; the limits per email and per address (routers/devices.py, core.sign_in_attempts) hold across\nevery pairing and every other password door.","operationId":"sign_in_bram_oauth_sign_in_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/bram/oauth/pairing/{pairing_id}":{"get":{"summary":"Pairing State","description":"What the Connect page polls. Once allowed, the FIRST poll mints the one-time authorization\ncode and returns the redirect carrying it; later polls say it was already handed over.","operationId":"pairing_state_bram_oauth_pairing__pairing_id__get","parameters":[{"name":"pairing_id","in":"path","required":true,"schema":{"type":"string","title":"Pairing Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bram/oauth/token":{"post":{"summary":"Token Route","operationId":"token_route_bram_oauth_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/bram/oauth/revoke":{"post":{"summary":"Revoke Route","description":"RFC 7009. The only authority is possession of a live token: nothing is looked up by client\nor connection id. Presenting one ends the grant it belongs to -- its access AND refresh tokens\n(7009 section 2.1: revoking a refresh token SHOULD invalidate the grant's access tokens) -- and\nmarks the connection disconnected, so the phone never lists a connection that can no longer\nsign in. Always 200 with an empty body, whether or not the token existed.","operationId":"revoke_route_bram_oauth_revoke_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/ai-connections/pair":{"post":{"summary":"Pair","operationId":"pair_api_ai_connections_pair_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/pair/{pairing_id}/decide":{"post":{"summary":"Decide","operationId":"decide_api_ai_connections_pair__pairing_id__decide_post","parameters":[{"name":"pairing_id","in":"path","required":true,"schema":{"type":"string","title":"Pairing Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/pending":{"get":{"summary":"Pending","description":"The person's allowed connects whose AI has not taken its key yet and still can (the pairing is\nopen). The phone lists them as \"finishing\" beside the connections, so leaving the app loses\nnothing; one that runs out simply leaves the list (nothing was made). Newest first.","operationId":"pending_api_ai_connections_pending_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections":{"get":{"summary":"List Connections","operationId":"list_connections_api_ai_connections_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/{connection_id}":{"patch":{"summary":"Change Areas","operationId":"change_areas_api_ai_connections__connection_id__patch","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Disconnect","operationId":"disconnect_api_ai_connections__connection_id__delete","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/{connection_id}/activity":{"get":{"summary":"Activity","operationId":"activity_api_ai_connections__connection_id__activity_get","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/{connection_id}/notes":{"get":{"summary":"Notes","description":"What this live connection filed that still needs the person or waits for Bram to file it, as\ngroups (see the block above): [{group_id, title, kind note|session|import, created_local,\nwaiting, lines: [{id, text, approved, conflict}]}]. Groups with something waiting first, then\nnewest first. `conflict` is always null (conflicts no longer exist; the installed phone app still\nreads the key). A failed note shows approved=false: approving it again retries it.","operationId":"notes_api_ai_connections__connection_id__notes_get","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/{connection_id}/notes/approve-all":{"post":{"summary":"Approve All","description":"Approve every note of the connection still waiting.","operationId":"approve_all_api_ai_connections__connection_id__notes_approve_all_post","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/{connection_id}/notes/{group_id}/approve":{"post":{"summary":"Approve","description":"The ticked notes of one group are approved (Bram files them); every other note of it still\nwaiting (or failed) is dropped (rejected). `conflicts` stays in the answer, always empty.","operationId":"approve_api_ai_connections__connection_id__notes__group_id__approve_post","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/{connection_id}/notes/{group_id}/deny":{"post":{"summary":"Deny","description":"Drop a whole note: every note of it still waiting, approved and not filed yet, or failed is\nrejected. What Bram already filed from it is on the Memory screen, where the person removes it\nline by line.","operationId":"deny_api_ai_connections__connection_id__notes__group_id__deny_post","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-connections/{connection_id}/notes/unconfirm":{"post":{"summary":"Unconfirm","description":"Undo an approve: back to waiting. Only a note Bram has not filed yet (still approved); one he\nfiled is on the Memory screen.","operationId":"unconfirm_api_ai_connections__connection_id__notes_unconfirm_post","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"integer","title":"Connection Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me":{"get":{"summary":"Get Me","description":"The caller's person: id, display name, household, and how they came in (`via`: a signed-in\n`session`, or the role of the key they hold).","operationId":"get_me_api_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/settings":{"get":{"summary":"My Settings","description":"Everything the phone's Settings screen shows that is not itself a setting, in one read,\neach already in the words it is said in (or a count: `orders_on`, his orders that run; `watches_on`, the kinds of\nmessage that reach him). The switches on that screen are declared settings\n(GET/PUT /api/settings); the Lockout rows are the signed rulebook in force and are READ ONLY\nhere -- the rules that govern a person are not loosened from a settings screen (header of\nmigrations/2026_09_15_settings_are_declared_not_hardcoded.sql).","operationId":"my_settings_api_me_settings_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/challenge":{"post":{"summary":"Issue Challenge","description":"A one-use challenge (32 bytes, base64) for a watch to bind its new key's attestation to the\nclaim it is about to make. Good for 10 minutes and one claim. Needs no key: it is how a watch\nthat has none gets one. Issuing stores nothing (key_attestation.Challenges), so asking for as\nmany as you like takes nothing from anyone else.","operationId":"issue_challenge_api_devices_challenge_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/devices/claim":{"post":{"summary":"Claim Device","description":"Body: public_key, key_type ('p256' | 'ed25519'), proof (an envelope this key sealed over\n{\"claim\": <label>}), kind ('phone', the default, or 'watch'), and for a NEW device email +\npassword. Answers machine, person, display_name and key (shown once).","operationId":"claim_device_api_devices_claim_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/memory":{"get":{"summary":"Memory Home","operationId":"memory_home_api_memory_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/journal":{"get":{"summary":"Journal","description":"Bram's own journal (argus.journal_entries), newest first, the person's own: `entries` each `{id, body,\nwritten_local}`. He writes it after five minutes of silence (argus/delta/journal.py) and it is only ever\nopened, never put in front of the person. An empty list is a real answer: he has written nothing yet.","operationId":"journal_api_journal_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/pages/{page_id}":{"get":{"summary":"Memory Page","operationId":"memory_page_api_memory_pages__page_id__get","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Change Page","description":"{title?, aliases?, archived?}. you, rules, proactive and unfiled cannot be archived (they are always there).","operationId":"change_page_api_memory_pages__page_id__patch","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/lines/{line_id}":{"patch":{"summary":"Edit Line","description":"{text}: the person's own words replace the line in place. `was` keeps the old words, said_by is\nowner and the quote is what he typed, source the face (phone or desktop), told_on today (he just told it). The line is embedded again now so recall finds\nthe new words; when the embedder is down the edit still lands (his word is not refused for our\noutage) with no vector, and recall's full-text half finds it until it is embedded.","operationId":"edit_line_api_memory_lines__line_id__patch","parameters":[{"name":"line_id","in":"path","required":true,"schema":{"type":"integer","title":"Line Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Remove Line","description":"The person removes a line: retracted (kept for six months, never shown or recalled), with the\nreason \"removed by <name> on the phone\" (or \"on the desktop\"). Removing a line that is already retracted answers the same\nway with the reason it has and changes nothing: the phone retries a DELETE whose answer it lost,\nand the retry must hear that the line is gone, not that there never was one.","operationId":"remove_line_api_memory_lines__line_id__delete","parameters":[{"name":"line_id","in":"path","required":true,"schema":{"type":"integer","title":"Line Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/skills":{"get":{"summary":"Skills","description":"The caller's learned skills, `skills` each `{id, name, description, body, state, pinned, uses,\nlast_used_local, created_local}`: live first, then stale, then archived, each by name. Bram writes them\n(his skills tool) and ages them (a daily sweep); the person only pins, restores and deletes.","operationId":"skills_api_memory_skills_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/skills/{skill_id}":{"patch":{"summary":"Change Skill","description":"`{\"pinned\": true|false}` and/or `{\"restore\": true}` (state live, state_at and active_at now); answers the\nskill row. Another person's skill, or none, is 404. A plain def: its psycopg calls run in the threadpool, never on\nthe event loop.","operationId":"change_skill_api_memory_skills__skill_id__patch","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"integer","title":"Skill Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Skill","description":"The person deletes a skill: the row is gone (Bram's role cannot delete, so this is the only way).","operationId":"delete_skill_api_memory_skills__skill_id__delete","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"integer","title":"Skill Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/changes/{change_id}/undo":{"post":{"summary":"Undo Change","description":"Take one change back, through the door (door undo, his tap): a line it added is retracted\n(\"undone\"), anything else gets back what it was before (an edit its old words, a retired line its\nplace, an approval its waiting). The\nundo is itself a change, and can be undone. 409 when it cannot be: already undone, a kind of change\nwith no way back, the line no longer reads what it left (a later change not undone), or the memory rules refuse what it would put back.","operationId":"undo_change_api_memory_changes__change_id__undo_post","parameters":[{"name":"change_id","in":"path","required":true,"schema":{"type":"integer","title":"Change Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/session":{"post":{"summary":"Sign In","description":"Body: username, password. A right pair sets the admin cookie for 7 days. Five wrong\ntries from one address in 15 minutes and the door answers 429 until they age out.","operationId":"sign_in_api_admin_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/check":{"get":{"summary":"Check","description":"nginx auth_request: 204 with a valid admin cookie, 401 without.","operationId":"check_api_admin_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/sign-out":{"post":{"summary":"Sign Out","operationId":"sign_out_api_admin_sign_out_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/watch/wear":{"post":{"summary":"Report Wear","description":"Body: an envelope sealed by the watch's own key over {kind: 'wear', on_wrist, charging,\nbattery}. Answers the wear rule's verdict for its person: {state, locks, says, ..., wake, home}: `wake`\nis the window the watch adopts, `home` whether the person is at home (`_home`): the watch opens its\nwindow, and so rings, only there.","operationId":"report_wear_api_watch_wear_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Wear","description":"The wear rule's answer for the caller's person: {state, locks, says, battery, since_local,\nlast_heard_local, worn_local, machine, label}; {state: 'no_watch', locks: false} when they have no\nwatch. `machine` is the watch's core.machines id: the one rule's owed list names it\n(cloud_evaluator/owed.py).","operationId":"get_wear_api_watch_wear_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/watch/wake":{"get":{"summary":"Get Wake","description":"The phone's backup alarm for the caller's person: {has_watch, start, end, phone_at, up, off,\nwoke_local, home}. has_watch false: nothing to back up, the phone arms nothing. up: this local\nmorning already has a wake that woke (the watch's or the phone's), or off: watch/wake_off holds\nthis local date (2026-11-06, \"turn off my waketime for today\"; it counts as up), so the phone stays\nquiet. home: whether he is at home (`_home`); an alarm rings only there, on the phone and on the\nwatch, whatever other place he is at (2026-11-09: it replaced a list of school, work and gym, the\nplaces he is up at, with the one place it may ring).","operationId":"get_wake_api_watch_wake_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Report Phone Wake","description":"The phone's backup alarm's outcome: {alarm_at, woke_at (absent when it gave up), gave_up,\ntest}. Recorded as the morning's wake (alarm_reason 'phone'); a ring fired by hand (test true)\nis a wake_test like the watch's and raises nothing. Answers {recorded, up}.","operationId":"report_phone_wake_api_watch_wake_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/board":{"get":{"summary":"Get Board","description":"Every widget of the caller's Board, ready to draw, in catalog order; `keys` (comma-separated) answers only those,\nin the order asked, and an unknown key is left out (`keys` in the answer is the whole catalog, so a caller can say\nwhich exist). Read-only.","operationId":"get_board_api_board_get","parameters":[{"name":"keys","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Keys"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sleep/last_night":{"get":{"summary":"Get Last Night","description":"The latest night on record: {night_of, bedtime, woke, bedtime_local, woke_local}; {} when the\nwatch has reported none. night_of is the date of the morning the night ended. Read by the judge\n(api_client.last_night): a bedtime after the rulebook's doctrine.bed_by is owed.","operationId":"get_last_night_api_sleep_last_night_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/adult/starts":{"get":{"summary":"Get Adult Starts","description":"{starts: [ISO instants]}: every adult_hour_started row of the last 14 days, oldest first.\nThe judge counts the week's earliest one (api_client.adult_starts, owed.adult_hour).","operationId":"get_adult_starts_api_adult_starts_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/adult/start":{"post":{"summary":"Start Adult Hour","description":"He starts the weekend hour. Appends one adult_hour_started row to enforcement.events (once per\nlocal day: a second press the same day answers `already` and adds nothing) and asks the judge to\nrun now (a judge.run_requested bus row), so the sealed `adult_open_until` follows\nwithin ~15 seconds. It opens nothing itself: whether the week earned it and whether today is a\nday it may start is the judge's answer, read from the record, not from this request.","operationId":"start_adult_hour_api_adult_start_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/overrides":{"get":{"summary":"Get Overrides","description":"The caller's override asks of the last 60 days, newest first (enforcement.recent_overrides): what\nwas asked, the ruling and its sentence, and `this_week` for the cap. The judge reads it for the asks to\nrule and the lifts to apply; `aegis override` reads it for the ruling it is waiting on.","operationId":"get_overrides_api_overrides_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Ask Override","description":"Ask the judge to lift one owed item, or to rule that he is sick today. Body: `ref` (\"gym:2026-11-14\": kind,\na colon, the item's ref as the sealed owed list has it) and `reason`, his words, never blank; or `sick: true`\nand `reason` (no ref: the ask is for today's credit day, owed or not yet, and has its own cap). A key that is not his own hand (Bram's, a\nmachine's) must also name his message that says so, `desk: id` or `episodic: id`; Core checks it is the\nperson's and from the last half hour (his_word.find) and records which message the ask rests on.\n\nRefused: 400 for a blank or malformed field, 409 when the item is not owed right now (or the judge has sealed\nno list; never for a sick ask), 429 when this Monday-to-Sunday week already has doctrine.overrides_a_week asks,\nor doctrine.sick_days_a_week sick asks (refused ones count, each against its own cap).\nA second ask for an item that already has one pending or agreed today is that ask, not a new one. The judge\nis woken by the database (core.wake_judge) and rules within a cycle; the answer is the row, ruling pending.","operationId":"ask_override_api_overrides_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/overrides/{override_id}/ruling":{"post":{"summary":"Rule Override","description":"The constitution judge's ruling on one pending ask (the judge's key only). Body: `agree` (bool), `clause`\n(what the ruling rests on), `says` (one plain sentence to him), and `model` / `cost_usd` of the call that\nmade it. Written once: a ruling already made answers 409, so an ask is never ruled twice.","operationId":"rule_override_api_overrides__override_id__ruling_post","parameters":[{"name":"override_id","in":"path","required":true,"schema":{"type":"integer","title":"Override Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skunk/board":{"get":{"summary":"Get Board","description":"The caller's whole board: live cards, and the kept and suggested strings between them.","operationId":"get_board_api_skunk_board_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skunk/cards":{"post":{"summary":"Make Card","operationId":"make_card_api_skunk_cards_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skunk/cards/{card_id}":{"patch":{"summary":"Change Card","description":"Move a card, set its stage or codename, or write on it; `deleted` moves it to or from Recently Deleted.","operationId":"change_card_api_skunk_cards__card_id__patch","parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"integer","title":"Card Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skunk/strings":{"post":{"summary":"Tie String","operationId":"tie_string_api_skunk_strings_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StringIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skunk/strings/{string_id}":{"patch":{"summary":"Change String","description":"Keep or toss a string (a Connect the dots suggestion, usually).","operationId":"change_string_api_skunk_strings__string_id__patch","parameters":[{"name":"string_id","in":"path","required":true,"schema":{"type":"integer","title":"String Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StringChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Untie String","operationId":"untie_string_api_skunk_strings__string_id__delete","parameters":[{"name":"string_id","in":"path","required":true,"schema":{"type":"integer","title":"String Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skunk/dots":{"post":{"summary":"Connect The Dots","description":"Ask Haiku which cards connect that nobody tied yet, and for a codename for each project without one; the\nnew links come back as suggested strings, the codenames as each card's codename_suggested.","operationId":"connect_the_dots_api_skunk_dots_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders":{"get":{"summary":"List Orders","description":"Every order of the caller's, live ones first, his own and Bram's before Aegis's, newest first; every word is\nCore's, ready to print: `name`; `summary` (the one line of what it does for him, Bram's words to him; null when it\nhas none); `runs_says` (when it runs: \"Every day at 5:30 PM\", \"When a teacher posts work\", \"Checks sciencenhs.org\ndaily\"); `status_says` (one line: \"Ran today 5:30 PM, told you\", \"Didn't finish yesterday 8:45 AM\", \"Paused\",\n\"Off\", \"Hasn't run yet\") and `status` (ok, failed, paused, off, new: how loud to draw it); `mark` (\"Bram set this\nup\" on an order Bram made on his own, else null); `why_says` (why it exists: Bram's reason said to him, or \"You\nasked: ...\" with his message; null on Aegis's own); `instruction` (what Bram does when it runs, whole, his to edit\nwhen `can_edit`); `next_says`, `ends_says`, `paused_reason` (while paused); `state` (on, log_only, paused, off),\n`right_away`, `hook`, `can_delete` (false on Aegis's own: turned off instead). `says` is the one line over the list.\nAn empty list means no order, a real answer.","operationId":"list_orders_api_orders_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/{order_id}":{"patch":{"summary":"Change Order","description":"The person turns one of his orders on, to log only (it runs, nothing reaches him), paused, or off; makes it right\naway (`right_away: true`: what it says reaches him at once, past every rule for when things reach him but his\nquiet hours) or not; or gives it\na hook (`hook: true`: its key is in the answer once, `hook_url` and `hook_key`, and never again; a new one replaces\nthe old) or takes it away (`hook: false`; refused, 409, when the hook is its only start); or rewrites what Bram does\nwhen it runs (`instruction`, his own words, whole; 409 on one that runs Bram's own code, `can_edit` false, and when\nthe database refuses it, saying why). Turning it on again clears its failures and back-off. Another person's order\nis 404. Returns the order as GET /api/orders lists it.","operationId":"change_order_api_orders__order_id__patch","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Order","description":"The person deletes one of his orders or one of Bram's; its firings stay in the history with no order. A\ndefault is never deleted (it would come back with the next class): 409, turn it off. An order another reads from\nis 409 naming that one, which goes first.","operationId":"delete_order_api_orders__order_id__delete","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/{order_id}/test":{"post":{"summary":"Test Order","description":"Fire the order now, marked a test (Rakazo's test run): Bram's runner does what it would do, and the firing is\nin its history. Returns at once; the result is in GET /api/orders/{id}/history.","operationId":"test_order_api_orders__order_id__test_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/{order_id}/history":{"get":{"summary":"Order History","description":"The order (as GET /api/orders lists it) and its firings, newest first (notifications.order_history), each ready to\nprint: `when_says` (\"Today 5:30 PM\"), `came_of_it` (\"Told you\", \"Nothing to tell\", \"Didn't finish\"), `line` (the\nfirst sentence of what came of it, or null when there is nothing more to say), `whole` (all of it, plain words: a\nrun's result is made plain where it is recorded), `outcome` (told, worked, logged, quiet, vetoed, failed, held; null\nwhile it runs) and on a held firing `held_says` (when Bram's message will tell it: \"Waits for my next message, Mon\n7:00 AM\"; POST /api/orders/runs/{id}/send sends it now).","operationId":"order_history_api_orders__order_id__history_get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","title":"Order Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/runs/{run_id}/send":{"post":{"summary":"Send Run Now","description":"Send Now on a firing of his order whose finding waits for Bram's voice (outcome held): it is marked his\n(sent_now_at, which Core's door reads to let the message past his rules and the daily cap) and the voice speaks at\nonce with it and whatever else waits (orders.release). His hand only. 404 when it is not his or is not waiting.\nReturns at once; the told firing shows in GET /api/orders/{id}/history.","operationId":"send_run_now_api_orders_runs__run_id__send_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/suggestions":{"get":{"summary":"List Suggestions","description":"What Bram or Aegis suggests he could have done on its own, every one waiting, oldest first: `title`, `why`,\n`source` (catalog: Aegis's starters; diary: Bram, from his diary; usage: from what he keeps asking) and `order`,\nthe whole order accepting it makes (name, instruction, how it acts, its starts). Never one a live order of his\nalready covers (notifications.suggestions_waiting), and never a message.","operationId":"list_suggestions_api_orders_suggestions_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/suggestions/{sid}/accept":{"post":{"summary":"Accept Suggestion","description":"He accepts a suggestion: the order it describes is made, on. A starter of Aegis's becomes his own order (his\ntap is his word on fixed words); one Bram suggested stays Bram's (its words are Bram's), with its reason and that\nhe accepted it. Returns the order. A spec the database refuses (a name that is not a name, events from more than\none area: notifications.orders_named) is 409 with why, and the suggestion still waits.","operationId":"accept_suggestion_api_orders_suggestions__sid__accept_post","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"integer","title":"Sid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/suggestions/{sid}/dismiss":{"post":{"summary":"Dismiss Suggestion","description":"He dismisses a suggestion: it is never offered again (its dedup_key stays dismissed).","operationId":"dismiss_suggestion_api_orders_suggestions__sid__dismiss_post","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"integer","title":"Sid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/{order_id}/hook":{"post":{"summary":"Hook","description":"An order's webhook (Rakazo routine triggers): anything that knows the order's key (header X-Order-Key) starts\nit, its body handed to Bram as outside words (fenced, never instructions; at most 8000 characters). The key is\nthe order's own, issued once on his screen (PATCH hook), and opens nothing else. An unknown order, one with no\nhook or a wrong key is 404 alike; an order that is not on, 409; more than 10 calls in half an hour, 429.","operationId":"hook_api_orders__order_id__hook_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","title":"Order Id"}},{"name":"x-order-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Order-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/landings":{"post":{"summary":"Open Landing","description":"`{\"hostname\", \"branch\", \"head\", \"subjects\": [...]}` -> `{\"id\"}`: ship.sh is landing this branch now.","operationId":"open_landing_api_landings_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/landings/{landing_id}":{"post":{"summary":"Close Landing","description":"`{\"state\": \"shipped\", \"sha\", \"version\", \"deployed\"}` or `{\"state\": \"refused\", \"step\", \"reason\"}`. A landing\ncloses once: a second close is a 409, so a log replayed later can never rewrite what happened.","operationId":"close_landing_api_landings__landing_id__post","parameters":[{"name":"landing_id","in":"path","required":true,"schema":{"type":"integer","title":"Landing Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-views":{"post":{"summary":"Keep View","description":"Bram's connector hook, after a tool call: the view, when the tool names one.","operationId":"keep_view_api_app_views_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/screen-viewers":{"post":{"summary":"Screen Viewer","description":"A sign-in for Bram's computer, for the app holding this key to hand the screen page in the link's #v=. Only the\nperson's own faces (their phone, their desktop) get one; no other key ever watches or moves the screen.","operationId":"screen_viewer_api_screen_viewers_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/screen/control":{"post":{"summary":"Control","description":"He takes the screen's mouse and keys (Bram's browser waits), or hands them back.","operationId":"control_api_screen_control_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/vault/once":{"get":{"summary":"Take Once","description":"The login (or code) kept for run `run`, from its newest login card answered with Save to Vault off: {name, site,\nusername, password, code, fields}. Bram's machine key only, the vault's own person only, and the first read removes\nit (404 after, or when none was kept).","operationId":"take_once_api_vault_once_get","parameters":[{"name":"run","in":"query","required":true,"schema":{"type":"integer","title":"Run"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/vault/logins":{"get":{"summary":"Logins","description":"{logins: [{name, username, site, two_factor, used_local, used_for}]}: used_* are Bram's newest sign-in (or code)\nwith that login in the last 180 days, the task it was for in his words; null when he has not used it.","operationId":"logins_api_vault_logins_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/vault/logins/{name}":{"put":{"summary":"Put Login","description":"{site, values: {username, password}} → {result: \"added\" | \"changed\"}. A new login needs its https address and a\npassword; a saved one keeps its address (bitwarden.save_login refuses another, 409).","operationId":"put_login_api_vault_logins__name__put","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Login","operationId":"delete_login_api_vault_logins__name__delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bram/spend":{"get":{"summary":"Spend","operationId":"spend_api_bram_spend_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bram/needs-you":{"get":{"summary":"Needs You","description":"[{id, text, card, topic}]: what Bram is holding on the person for right now (empty when nothing).","operationId":"needs_you_api_bram_needs_you_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/oauth-protected-resource/glass/mcp":{"get":{"summary":"Protected Resource Metadata","description":"Looking Glass signs in on Bram's road's authorization server; its Connect page asks for the Keelson sign-in.","operationId":"protected_resource_metadata__well_known_oauth_protected_resource_glass_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"CallIn":{"properties":{"connector":{"type":"string","title":"Connector"},"tool":{"type":"string","title":"Tool"},"input":{"additionalProperties":true,"type":"object","title":"Input","default":{}},"content":{"items":{},"type":"array","title":"Content","default":[]},"is_error":{"type":"boolean","title":"Is Error","default":false}},"type":"object","required":["connector","tool"],"title":"CallIn"},"CardChange":{"properties":{"kind":{"anyOf":[{"type":"string","enum":["idea","project"]},{"type":"null"}],"title":"Kind"},"stage":{"anyOf":[{"type":"string","enum":["idea","building","shipped","killed"]},{"type":"null"}],"title":"Stage"},"codename":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Codename"},"title":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Body"},"next_step":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Next Step"},"note":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Note"},"x":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"X"},"y":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Y"},"deleted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Deleted"}},"type":"object","title":"CardChange"},"CardIn":{"properties":{"kind":{"type":"string","enum":["idea","project"],"title":"Kind"},"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"body":{"type":"string","maxLength":4000,"title":"Body","default":""},"next_step":{"type":"string","maxLength":300,"title":"Next Step","default":""},"stage":{"type":"string","enum":["idea","building","shipped","killed"],"title":"Stage","default":"idea"},"under":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Under"},"x":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"X"},"y":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Y"}},"type":"object","required":["kind","title"],"title":"CardIn"},"ControlIn":{"properties":{"take":{"type":"boolean","title":"Take"}},"type":"object","required":["take"],"title":"ControlIn"},"DataIn":{"properties":{"key":{"type":"string","title":"Key"},"value":{"title":"Value"},"person":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person"},"remove":{"type":"boolean","title":"Remove","default":false}},"type":"object","required":["key"],"title":"DataIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LessLikeThis":{"properties":{"notification_id":{"type":"integer","title":"Notification Id"}},"type":"object","required":["notification_id"],"title":"LessLikeThis"},"OrderChange":{"properties":{"state":{"anyOf":[{"type":"string","enum":["on","log_only","paused","off"]},{"type":"null"}],"title":"State"},"right_away":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Right Away"},"hook":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hook"},"instruction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction"}},"type":"object","title":"OrderChange"},"PageChange":{"properties":{"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"restore":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Restore"},"draft":{"type":"boolean","title":"Draft","default":false}},"type":"object","title":"PageChange"},"PageIn":{"properties":{"title":{"type":"string","title":"Title"},"format":{"type":"string","title":"Format","default":"html"},"body":{"type":"string","title":"Body"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"sharing":{"type":"string","title":"Sharing","default":"private"},"abilities":{"items":{"type":"string"},"type":"array","title":"Abilities","default":[]},"apps":{"items":{"type":"string"},"type":"array","title":"Apps","default":[]},"folder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder"},"people":{"items":{"type":"string"},"type":"array","title":"People","default":[]}},"type":"object","required":["title","body"],"title":"PageIn"},"PageSettings":{"properties":{"sharing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sharing"},"people":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"People"},"abilities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Abilities"},"apps":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Apps"},"folder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder"},"pinned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pinned"}},"type":"object","title":"PageSettings"},"PictureIn":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"desk":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desk"},"data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},"type":"object","title":"PictureIn"},"RaiseRequest":{"properties":{"type":{"type":"string","title":"Type"},"facts":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Facts"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At"}},"type":"object","required":["type"],"title":"RaiseRequest","description":"The payload shape, validated at the boundary before the handler ever\nruns — a missing `type`, a non-JSON body, or an unparseable `occurred_at`\nnow fails as a clean 422 with no ledger row, instead of reaching\n`raise_notification` (or Postgres) and 500ing with a hole left behind.\n\n`facts` and `source` are Optional, not defaulted-and-required, because\nreal producers (the Android tree in particular — Slice 3) routinely\nserialize an absent map/string field as an explicit JSON `null` rather\nthan omitting the key. A bare `dict` / `str` type annotation would 422 on\nthat `null`, which is a real client sending a real absence, not a\nmalformed request. The handler below collapses `None` (and `source`'s\nempty string) the same way the old hand-parsed code did, with `or` —\nonly a genuinely wrong SHAPE (e.g. `facts` as a list) still 422s.\n\nDeliberately no `surface` / `severity` / `push` / `voice` / `panel` field:\nthe one rule holds here too — a producer reports facts, the center (via\nthe catalog) decides consequences. Widening this model to accept any of\nthose is exactly the mistake this route exists to make impossible."},"Receipt":{"properties":{"surface":{"type":"string","enum":["panel","push"],"title":"Surface"},"state":{"type":"string","enum":["rendered","failed","dropped","opened"],"title":"State"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["surface","state"],"title":"Receipt","description":"What a surface actually did. `state` is a Literal on purpose: 'pending'\nis not a receipt, and an invented state is a 422 at the boundary rather\nthan a CHECK violation five layers in.\n\nThere is no `notification` body field and no way to name a type — the id is\nin the path and everything else is already in the ledger. A surface reports\nwhat it drew; it does not restate what it was told."},"StringChange":{"properties":{"state":{"type":"string","enum":["kept","tossed"],"title":"State"}},"type":"object","required":["state"],"title":"StringChange"},"StringIn":{"properties":{"a":{"type":"integer","title":"A"},"b":{"type":"integer","title":"B"},"why":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Why"}},"type":"object","required":["a","b"],"title":"StringIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WatchState":{"properties":{"state":{"type":"string","enum":["on","log_only","off"],"title":"State"}},"type":"object","required":["state"],"title":"WatchState"}}}}