{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/v1/brains/{brainId}/search":{"post":{"operationId":"workspace_searchPages","summary":"Search pages","description":"Search pages using combined semantic and keyword matching. Results are ranked by relevance and include a snippet showing why each page matched.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrainSearchResultDto"}}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSearchReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/index":{"get":{"operationId":"workspace_index","summary":"Prompt index","description":"Return a compact index of the brain's top pages, formatted for injection into an LLM prompt. This is the intended way to give an agent working context without sending the whole brain.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrainIndexEntryDto"}}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/graph":{"get":{"operationId":"workspace_graph","summary":"Connection graph","description":"Return a renderable subgraph of nodes and edges for visualizing how the brain's pages relate. Use `nodeLimit` to keep the payload small enough to draw.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"nodeLimit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainGraphResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages":{"get":{"operationId":"workspace_listPages","summary":"List pages","description":"List pages in a brain with offset pagination. Filter by bucket or status, and optionally include deprecated pages that are normally hidden.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}},{"name":"includeDeprecated","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"includeArchived","in":"query","description":"Include archived pages in the results. Archived pages are hidden from lists and search by default.","required":false,"schema":{"type":"boolean"}},{"name":"bucket","in":"query","required":false,"schema":{"$ref":"#/components/schemas/V1BrainsBrainIdPagesGetParametersBucket"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/V1BrainsBrainIdPagesGetParametersStatus"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageListResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/buckets":{"get":{"operationId":"workspace_buckets","summary":"Per-bucket page counts","description":"Return per-bucket page counts for the brain — the fastest way to render bucket navigation with badges.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Active page counts keyed by bucket","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"}}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}":{"get":{"operationId":"workspace_getPage","summary":"Read a page","description":"Read a single page by slug. This bumps the page's `lastReferencedAt`, which feeds the brain health score — use it when a human or agent actually consumes the content.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"includeDeprecated","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"delete":{"operationId":"workspace_deletePermanently","summary":"Delete a page","description":"Permanently delete a page and every record that depends on it, including its versions and connections. This cannot be undone.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"permanent","in":"query","description":"Explicit irreversible-deletion confirmation","required":true,"schema":{"$ref":"#/components/schemas/V1BrainsBrainIdPagesSlugDeleteParametersPermanent"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDeleteResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/versions":{"get":{"operationId":"workspace_pageVersions","summary":"Page version history","description":"List a page's version history, newest first. Every content edit and automated recompile produces a version.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrainPageVersionDto"}}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/connections":{"get":{"operationId":"workspace_pageConnections","summary":"Connections for a page","description":"List the connections attached to a single page, with the related page inlined on each connection.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageConnectionsResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/content":{"patch":{"operationId":"workspace_editContent","summary":"Edit page content","description":"Manually overwrite a page's content. This creates a new version, so the previous content stays retrievable through the version history.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageContentReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/bucket":{"patch":{"operationId":"workspace_moveBucket","summary":"Move a page","description":"Move a page into a different bucket. Buckets are the brain's top-level organizational grouping.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MovePageBucketReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/pin":{"post":{"operationId":"workspace_pin","summary":"Pin or unpin a page","description":"Pin or unpin a page. Pinned pages are prioritized in the prompt index and are exempt from deprecation.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PinPageReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/rename":{"post":{"operationId":"workspace_rename","summary":"Rename a page","description":"Rename a page's title and slug. Existing connections follow the page, but any external references to the old slug will break.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenamePageReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/archive":{"post":{"operationId":"workspace_archive","summary":"Archive a page","description":"Archive a page. Archived pages are hidden from lists and search until restored, but their content, versions, and connections are kept. Use `restore` to bring the page back.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/restore":{"post":{"operationId":"workspace_restore","summary":"Restore a page","description":"Restore an archived page and return it to active status, so it reappears in lists and search.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/recover":{"post":{"operationId":"workspace_recover","summary":"Recover a page","description":"Recover a deprecated page and return it to active status.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/resolve":{"post":{"operationId":"workspace_resolve","summary":"Resolve a page","description":"Resolve a contested page. A page becomes contested when newly captured material contradicts what the page already asserts; resolving records which version wins.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveContestedReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/pages/{slug}/reviewed":{"post":{"operationId":"workspace_reviewed","summary":"Recover a page (legacy)","description":"Legacy alias for recovering a deprecated page. Prefer `recover` in new code; this endpoint is retained for backwards compatibility.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"slug","in":"path","description":"Page slug","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainPageDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/changes":{"get":{"operationId":"workspace_changes","summary":"List change-feed events","description":"List change-feed events with offset pagination. This is the primary way to sync an external system: poll with `since`, or filter to `unackedOnly` to build an inbox.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}},{"name":"unackedOnly","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"pageId","in":"query","required":false,"schema":{"type":"string"}},{"name":"since","in":"query","description":"ISO timestamp","required":false,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainChangeListResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/changes/{changeId}/ack":{"post":{"operationId":"workspace_ackChange","summary":"Acknowledge a change","description":"Acknowledge a single change event, removing it from unacknowledged views.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"changeId","in":"path","description":"Change event id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainChangeEventDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/changes/ack-all":{"post":{"operationId":"workspace_ackAll","summary":"Acknowledge all","description":"Acknowledge every outstanding change event in one call, and return how many were cleared.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainAckAllResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/connections":{"get":{"operationId":"workspace_listConnections","summary":"List connections","description":"List connections across the whole brain with offset pagination. Filter by strength, or restrict to connections the user has not yet dismissed.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}},{"name":"unackedOnly","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"strength","in":"query","description":"Minimum strength (inclusive)","required":false,"schema":{"$ref":"#/components/schemas/V1BrainsBrainIdConnectionsGetParametersStrength"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainConnectionListResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/connections/{connectionId}/ack":{"post":{"operationId":"workspace_ackConnection","summary":"Dismiss a connection","description":"Dismiss a connection so it stops appearing in unacknowledged views. The connection itself is preserved.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"connectionId","in":"path","description":"Connection id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainConnectionDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/score":{"get":{"operationId":"workspace_getScore","summary":"Brain health score","description":"Return the brain's health score with its contributing factors and metrics. The score reflects coverage, freshness, and connectedness.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainScoreResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/score/history":{"get":{"operationId":"workspace_scoreHistory","summary":"Score trend history","description":"Return the score trend over a time range, including the delta versus the start of the period.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"range","in":"query","required":false,"schema":{"$ref":"#/components/schemas/V1BrainsBrainIdScoreHistoryGetParametersRange"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainScoreHistoryResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/score/suggestions":{"post":{"operationId":"workspace_scoreSuggestions","summary":"Score suggestions","description":"Return concrete, ranked suggestions for raising the brain's health score, derived from whichever factors are currently weakest.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainScoreSuggestionsResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/profile":{"get":{"operationId":"workspace_getProfile","summary":"Get the brain profile","description":"Return the brain profile — the standing directives and context that shape how the brain interprets and organizes new captures.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Null body when no profile has been created yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainProfileDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"patch":{"operationId":"workspace_updateProfile","summary":"Update the profile","description":"Update the brain profile's directives. These take effect on subsequent captures, not retroactively.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainProfileDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBrainProfileReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/profile/suggestions":{"post":{"operationId":"workspace_profileSuggestions","summary":"Profile suggestions","description":"Suggest profile fields inferred from what the brain already contains. Best-effort: returns an empty set when there is not yet enough signal.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainProfileSuggestionsResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/export/markdown":{"get":{"operationId":"workspace_exportMarkdown","summary":"Export as markdown","description":"Export the entire brain as a single markdown bundle, suitable for backup or for handing to another tool.","tags":["Workspace"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"includeDeprecated","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainExportMarkdownResDto"}}}},"400":{"description":"Validation failed (e.g. empty title/body, slug already in use)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain, page, change, or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains":{"get":{"operationId":"brains_list","summary":"List brains","description":"List every brain owned by the calling subject, most recently updated first.","tags":["Brains"],"parameters":[{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrainDto"}}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"post":{"operationId":"brains_create","summary":"Create a brain","description":"Create a new brain for the calling subject. A brain is an isolated knowledge vault: every capture, page, and connection belongs to exactly one brain. The `x-subject-id` header determines who owns it.","tags":["Brains"],"parameters":[{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"403":{"description":"Linked projects cannot create brains here","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBrainReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/stats":{"get":{"operationId":"brains_bulkStats","summary":"Bulk brain stats","description":"Aggregate counts for many brains in one round trip. Pass a comma-separated `ids` list; brains the caller cannot access are omitted rather than erroring.","tags":["Brains"],"parameters":[{"name":"ids","in":"query","description":"Comma-separated brain ids, e.g. `ids=a,b,c`. Unowned ids are omitted.","required":false,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stats keyed by brain id","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/BrainStatsResDto"}}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}":{"get":{"operationId":"brains_get","summary":"Get a brain","description":"Retrieve a single brain by ID, including its name, description, and brief settings.","tags":["Brains"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"delete":{"operationId":"brains_remove","summary":"Delete a brain","description":"Soft-delete a brain and disable its active data.","tags":["Brains"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"403":{"description":"Linked projects cannot delete brains here","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"patch":{"operationId":"brains_update","summary":"Update a brain","description":"Update a brain's mutable fields, such as its name or description. Omitted fields are left unchanged.","tags":["Brains"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBrainReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/stats":{"get":{"operationId":"brains_stats","summary":"Brain stats","description":"Aggregate counts for a single brain — pages, sources, connections, and unacknowledged changes. Useful for dashboard headline numbers.","tags":["Brains"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainStatsResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/brief-settings":{"patch":{"operationId":"brains_updateBriefSettings","summary":"Update brief settings","description":"Update the daily-brief schedule and delivery settings for a brain, including whether briefs are enabled and what time they are generated.","tags":["Brains"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBriefSettingsReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/brief/run":{"post":{"operationId":"brains_runBrief","summary":"Run the daily brief","description":"Generate this brain's daily brief immediately instead of waiting for its scheduled run. Returns the generated brief page's id and slug, or `null` when the last 7 days had no activity to brief.","tags":["Brains"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Null body when the last 7 days had no activity to brief","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainBriefRunResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/captures":{"post":{"operationId":"captures_capture","summary":"Push a capture","description":"Push a single item into a brain for ingestion. Accepts notes, URLs, raw text, chat transcripts, and PDF/DOCX/PPTX documents. Capture is asynchronous: this returns an ingest source whose `status` you can poll or receive via webhook.","tags":["Captures"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainIngestSourceDto"}}}},"400":{"description":"Validation failed (e.g. neither/both of `content` and `fetchUrl`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or source not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"429":{"description":"Caller rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainCaptureReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/captures/batch":{"post":{"operationId":"captures_captureBatch","summary":"Push a capture batch","description":"Push many captures in a single request. Each item is processed independently, so a malformed entry fails on its own without rejecting the whole batch.","tags":["Captures"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainCaptureBatchResDto"}}}},"400":{"description":"Validation failed (e.g. neither/both of `content` and `fetchUrl`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or source not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"429":{"description":"Caller rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainCaptureBatchReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/captures/chat-turn":{"post":{"operationId":"captures_captureChatTurn","summary":"Push a chat turn","description":"Submit a single chat turn for worthiness classification. The service decides whether the turn contains durable knowledge and only captures it if so, which keeps conversational filler out of the brain.","tags":["Captures"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainCaptureChatTurnResDto"}}}},"400":{"description":"Validation failed (e.g. neither/both of `content` and `fetchUrl`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or source not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"429":{"description":"Caller rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainCaptureChatTurnReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/sources":{"get":{"operationId":"captures_listSources","summary":"List ingest sources","description":"List ingest sources for a brain, optionally filtered by processing status. Use this to surface an ingestion queue or to find sources that failed to compile.","tags":["Captures"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/V1BrainsBrainIdSourcesGetParametersStatus"}},{"name":"ids","in":"query","description":"Comma-separated source ids for a targeted lookup (e.g. resolving a page’s source refs regardless of age)","required":false,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSourceListResDto"}}}},"400":{"description":"Validation failed (e.g. neither/both of `content` and `fetchUrl`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or source not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"429":{"description":"Caller rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/sources/{sourceId}/retry":{"post":{"operationId":"captures_retrySource","summary":"Retry an ingest source","description":"Retry compiling an ingest source that previously failed. Only sources in a failed state can be retried.","tags":["Captures"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"sourceId","in":"path","description":"Ingest source id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSourceRetryResDto"}}}},"400":{"description":"Validation failed (e.g. neither/both of `content` and `fetchUrl`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or source not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"429":{"description":"Caller rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/sources/{sourceId}":{"delete":{"operationId":"captures_removeSource","summary":"Delete an ingest source","description":"Delete an ingest source. Pages already derived from the source are retained unless you delete them separately.","tags":["Captures"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"sourceId","in":"path","description":"Ingest source id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResDto"}}}},"400":{"description":"Validation failed (e.g. neither/both of `content` and `fetchUrl`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or source not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"429":{"description":"Caller rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/webhooks":{"get":{"operationId":"webhooks_list","summary":"List webhooks","description":"List all webhook subscriptions for the calling subject. Signing secrets are not included.","tags":["Webhooks"],"parameters":[{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"403":{"description":"Linked-project integrations are source-managed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"post":{"operationId":"webhooks_create","summary":"Register a webhook","description":"Register a webhook endpoint and receive its signing secret. The secret is returned only on creation — store it immediately, as it cannot be retrieved again.","tags":["Webhooks"],"parameters":[{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"403":{"description":"Linked-project integrations are source-managed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/webhooks/{id}":{"delete":{"operationId":"webhooks_remove","summary":"Delete a webhook","description":"Delete a webhook subscription. Deliveries stop immediately.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","description":"Webhook subscription id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"403":{"description":"Linked-project integrations are source-managed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"patch":{"operationId":"webhooks_update","summary":"Update a webhook","description":"Update a webhook subscription's URL or subscribed event types. The signing secret is unchanged.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","description":"Webhook subscription id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"403":{"description":"Linked-project integrations are source-managed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/telegram":{"get":{"operationId":"telegram_status","summary":"Telegram status","description":"Return the current Telegram bot connection status for a brain, including the connected bot's username when one is linked.","tags":["Telegram"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Null body when no bot was ever connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainTelegramBotResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"post":{"operationId":"telegram_connect","summary":"Connect Telegram","description":"Connect a Telegram bot to a brain so messages sent to the bot are captured automatically.","tags":["Telegram"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainTelegramBotResDto"}}}},"400":{"description":"Invalid Telegram bot token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectTelegramReqDto"}}}},"security":[{"apiKey":[]}]},"delete":{"operationId":"telegram_disconnect","summary":"Disconnect Telegram","description":"Disconnect the Telegram bot from a brain. Already-captured messages are retained.","tags":["Telegram"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainTelegramDisconnectResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/slack":{"get":{"operationId":"slack_status","summary":"Slack status","description":"Return every Slack workspace installed for a brain along with its channel bindings. Use the installation IDs returned here to list channels or create bindings.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSlackStatusResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/slack/oauth/start":{"post":{"operationId":"slack_startOauth","summary":"Start Slack OAuth","description":"Create a signed Slack OAuth installation URL for a brain. Redirect the user to `authorizationUrl`; Slack sends them back to your redirect URL with a `code` and `state` to pass to `confirmOauth`. The signed state expires at `expiresAt`.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackOAuthStartResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/slack/oauth/confirm":{"post":{"operationId":"slack_confirmOauth","summary":"Confirm Slack OAuth","description":"Complete a Slack installation by exchanging the `code` and `state` Slack returned to your redirect URL. Returns the new installation ID.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackOAuthConfirmResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackOAuthConfirmReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/slack/channels":{"get":{"operationId":"slack_channels","summary":"List Slack channels","description":"List the channels visible to the Living Brain bot in a Slack installation. `isMember` tells you whether the bot has already been added to the channel.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"installationId","in":"query","description":"Slack installation id returned by the status endpoint","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrainSlackChannelResDto"}}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/slack/bindings":{"post":{"operationId":"slack_bind","summary":"Bind a Slack channel","description":"Connect a Slack channel to a brain so it receives brain notifications. Configure which notifications it receives with `updateBinding`.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSlackBindingResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindSlackChannelReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/slack/bindings/{bindingId}":{"delete":{"operationId":"slack_unbind","summary":"Unbind a Slack channel","description":"Disconnect a single Slack channel from a brain. The Slack installation and any other bindings are unaffected.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"bindingId","in":"path","description":"Slack channel binding id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSlackUnbindResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]},"patch":{"operationId":"slack_updateBinding","summary":"Update a Slack binding","description":"Update which notifications a bound Slack channel receives — daily briefs, new connections, and page changes. Omitted fields are left unchanged.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"bindingId","in":"path","description":"Slack channel binding id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSlackBindingResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSlackBindingReqDto"}}}},"security":[{"apiKey":[]}]}},"/v1/brains/{brainId}/slack/installations/{installationId}":{"delete":{"operationId":"slack_disconnectInstallation","summary":"Disconnect Slack","description":"Disconnect a Slack workspace from a brain and remove all of its channel bindings.","tags":["Slack"],"parameters":[{"name":"brainId","in":"path","description":"Brain id","required":true,"schema":{"type":"string"}},{"name":"installationId","in":"path","description":"Slack installation id","required":true,"schema":{"type":"string"}},{"name":"x-subject-id","in":"header","description":"Identifies the end user the request is made on behalf of. Must be a UUID. Brains are\nowned by a subject, so this determines which brains the caller can see.\n","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainSlackUnbindResDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}},"404":{"description":"Brain or Slack installation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResDto"}}}}},"security":[{"apiKey":[]}]}}},"tags":[{"name":"Workspace"},{"name":"Brains"},{"name":"Captures"},{"name":"Webhooks"},{"name":"Telegram"},{"name":"Slack"}],"servers":[{"url":"https://api.livingbrain.com","description":"Production"}],"components":{"schemas":{"BrainSearchReqDto":{"type":"object","properties":{"query":{"type":"string","description":"Search query"},"topK":{"type":"integer","default":5,"description":"Max results"},"minSimilarity":{"type":"number","format":"double","default":0.35,"description":"Minimum similarity (0-1)"}},"required":["query"],"title":"BrainSearchReqDto"},"BrainSearchResultDtoPageType":{"type":"string","enum":["source","topic","entity","project","decision","brief"],"description":"What kind of knowledge this page holds.","title":"BrainSearchResultDtoPageType"},"BrainSearchResultDtoStatus":{"type":"string","enum":["active","deprecated","stale","contested","archived"],"description":"Lifecycle state. Deprecated and archived items are hidden from listings by default.","title":"BrainSearchResultDtoStatus"},"BrainSearchResultDtoMatchedOn":{"type":"string","enum":["semantic","keyword","both"],"description":"Why the page matched: semantic similarity, keyword (title/summary/body words), or both. Keyword matches are returned even when similarity is below minSimilarity.","title":"BrainSearchResultDtoMatchedOn"},"BrainSearchResultDto":{"type":"object","properties":{"pageId":{"type":"string","description":"Page id"},"slug":{"type":"string","description":"URL-safe identifier, unique within the brain."},"title":{"type":"string","description":"Human-readable title."},"summary":{"type":"string","description":"Summary of the matched page."},"pageType":{"$ref":"#/components/schemas/BrainSearchResultDtoPageType","description":"What kind of knowledge this page holds."},"status":{"$ref":"#/components/schemas/BrainSearchResultDtoStatus","description":"Lifecycle state. Deprecated and archived items are hidden from listings by default."},"similarity":{"type":"number","format":"double","description":"Similarity score (0-1)"},"matchedOn":{"$ref":"#/components/schemas/BrainSearchResultDtoMatchedOn","description":"Why the page matched: semantic similarity, keyword (title/summary/body words), or both. Keyword matches are returned even when similarity is below minSimilarity."}},"required":["pageId","slug","title","summary","pageType","status","similarity","matchedOn"],"title":"BrainSearchResultDto"},"ErrorResDtoBody":{"type":"object","properties":{},"description":"Original framework exception response when available, e.g. `{ statusCode, message, error }` with per-field validation messages","title":"ErrorResDtoBody"},"ErrorResDto":{"type":"object","properties":{"statusCode":{"type":"integer","description":"HTTP status code"},"timestamp":{"type":"string","description":"ISO timestamp of the failure"},"path":{"type":"string","description":"Request path (query string stripped)"},"message":{"type":"string","description":"Human-readable error message"},"body":{"$ref":"#/components/schemas/ErrorResDtoBody","description":"Original framework exception response when available, e.g. `{ statusCode, message, error }` with per-field validation messages"}},"required":["statusCode","timestamp","path","message"],"title":"ErrorResDto"},"BrainIndexEntryDtoPageType":{"type":"string","enum":["source","topic","entity","project","decision","brief"],"description":"What kind of knowledge this page holds.","title":"BrainIndexEntryDtoPageType"},"BrainIndexEntryDtoStatus":{"type":"string","enum":["active","deprecated","stale","contested","archived"],"description":"Lifecycle state. Deprecated and archived items are hidden from listings by default.","title":"BrainIndexEntryDtoStatus"},"BrainIndexEntryDto":{"type":"object","properties":{"slug":{"type":"string","description":"URL-safe identifier, unique within the brain."},"title":{"type":"string","description":"Human-readable title."},"summary":{"type":"string","description":"Summary truncated to 160 chars"},"pageType":{"$ref":"#/components/schemas/BrainIndexEntryDtoPageType","description":"What kind of knowledge this page holds."},"pinned":{"type":"boolean","description":"Pinned entries are placed first in the prompt index."},"status":{"$ref":"#/components/schemas/BrainIndexEntryDtoStatus","description":"Lifecycle state. Deprecated and archived items are hidden from listings by default."}},"required":["slug","title","summary","pageType","pinned","status"],"title":"BrainIndexEntryDto"},"BrainGraphNodeDtoBucket":{"type":"string","enum":["inbox","notes","ideas","projects"],"description":"Top-level grouping the page belongs to.","title":"BrainGraphNodeDtoBucket"},"BrainGraphNodeDtoStatus":{"type":"string","enum":["active","deprecated","stale","contested","archived"],"description":"Lifecycle state. Deprecated and archived items are hidden from listings by default.","title":"BrainGraphNodeDtoStatus"},"BrainGraphNodeDto":{"type":"object","properties":{"id":{"type":"string","description":"Page id"},"slug":{"type":"string","description":"URL-safe identifier, unique within the brain."},"title":{"type":"string","description":"Human-readable title."},"bucket":{"oneOf":[{"$ref":"#/components/schemas/BrainGraphNodeDtoBucket"},{"type":"null"}],"description":"Top-level grouping the page belongs to."},"status":{"$ref":"#/components/schemas/BrainGraphNodeDtoStatus","description":"Lifecycle state. Deprecated and archived items are hidden from listings by default."},"pinned":{"type":"boolean","description":"Pinned pages rank first in the prompt index and are exempt from deprecation."},"summary":{"type":"string","description":"Short summary, suitable for a tooltip on the node."},"updatedAt":{"type":"string","description":"ISO timestamp"}},"required":["id","slug","title","bucket","status","pinned","summary","updatedAt"],"title":"BrainGraphNodeDto"},"BrainGraphEdgeDtoStrength":{"type":"string","enum":["weak","medium","strong"],"description":"How strongly the two nodes are related; use it to weight edge thickness when rendering.","title":"BrainGraphEdgeDtoStrength"},"BrainGraphEdgeDto":{"type":"object","properties":{"id":{"type":"string","description":"Connection id"},"pageAId":{"type":"string","description":"Identifier of the first page in the pair."},"pageBId":{"type":"string","description":"Identifier of the second page in the pair."},"pageASlug":{"type":"string","description":"Slug of the first page in the pair."},"pageBSlug":{"type":"string","description":"Slug of the second page in the pair."},"pageATitle":{"type":"string","description":"Title of the first page in the pair."},"pageBTitle":{"type":"string","description":"Title of the second page in the pair."},"strength":{"$ref":"#/components/schemas/BrainGraphEdgeDtoStrength","description":"How strongly the two nodes are related; use it to weight edge thickness when rendering."},"similarity":{"type":"number","format":"double","description":"Cosine similarity (0-1)"},"reasoning":{"type":"string","description":"Model-generated explanation of why these two pages are connected."},"createdAt":{"type":"string","description":"ISO timestamp"}},"required":["id","pageAId","pageBId","pageASlug","pageBSlug","pageATitle","pageBTitle","strength","similarity","reasoning","createdAt"],"title":"BrainGraphEdgeDto"},"BrainGraphResDto":{"type":"object","properties":{"nodes":{"type":"array","items":{"$ref":"#/components/schemas/BrainGraphNodeDto"},"description":"Pages to draw, capped by the requested node limit."},"edges":{"type":"array","items":{"$ref":"#/components/schemas/BrainGraphEdgeDto"},"description":"Connections between the returned nodes."},"truncated":{"type":"boolean","description":"True when eligible pages exceeded the requested node limit"}},"required":["nodes","edges","truncated"],"title":"BrainGraphResDto"},"V1BrainsBrainIdPagesGetParametersBucket":{"type":"string","enum":["inbox","notes","ideas","projects"],"title":"V1BrainsBrainIdPagesGetParametersBucket"},"V1BrainsBrainIdPagesGetParametersStatus":{"type":"string","enum":["active","deprecated","stale","contested","archived"],"title":"V1BrainsBrainIdPagesGetParametersStatus"},"BrainSourceDto":{"type":"object","properties":{"channel":{"type":"string","description":"Provenance channel"},"ref":{"type":["string","null"],"description":"Opaque host reference (e.g. agent id)"},"label":{"type":["string","null"],"description":"Human-readable provenance label"}},"required":["channel"],"title":"BrainSourceDto"},"BrainPageDtoPageType":{"type":"string","enum":["source","topic","entity","project","decision","brief"],"description":"What kind of knowledge this page holds.","title":"BrainPageDtoPageType"},"BrainPageDtoBucket":{"type":"string","enum":["inbox","notes","ideas","projects"],"description":"Top-level grouping the page belongs to.","title":"BrainPageDtoBucket"},"BrainPageDtoBucketSource":{"type":"string","enum":["auto","user"],"description":"Whether the bucket was set automatically or by the user","title":"BrainPageDtoBucketSource"},"BrainPageSourceRefDto":{"type":"object","properties":{"ingestSourceId":{"type":"string","description":"Contributing ingest source id"},"chunkUuids":{"type":"array","items":{"type":"string"},"description":"Knowledge chunk uuids backing the source"},"attachedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this source was attached to the page."}},"required":["ingestSourceId","chunkUuids","attachedAt"],"title":"BrainPageSourceRefDto"},"BrainPageDtoStatus":{"type":"string","enum":["active","deprecated","stale","contested","archived"],"description":"Lifecycle state. Deprecated and archived items are hidden from listings by default.","title":"BrainPageDtoStatus"},"BrainPageDto":{"type":"object","properties":{"id":{"type":"string","description":"Page id"},"tenantId":{"type":"string","description":"Owning tenant id"},"subjectId":{"type":"string","description":"Owning subject id (host-defined)"},"brainId":{"type":"string","description":"Owning brain id"},"source":{"oneOf":[{"$ref":"#/components/schemas/BrainSourceDto"},{"type":"null"}],"description":"Opaque provenance"},"pageType":{"$ref":"#/components/schemas/BrainPageDtoPageType","description":"What kind of knowledge this page holds."},"bucket":{"$ref":"#/components/schemas/BrainPageDtoBucket","description":"Top-level grouping the page belongs to."},"bucketSource":{"$ref":"#/components/schemas/BrainPageDtoBucketSource","description":"Whether the bucket was set automatically or by the user"},"slug":{"type":"string","description":"URL-safe identifier, unique per brain"},"title":{"type":"string","description":"Human-readable title."},"summary":{"type":"string","description":"Short generated summary of the content."},"body":{"type":"string","description":"Markdown body"},"entities":{"type":"array","items":{"type":"string"},"description":"Named entities extracted from the body"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/BrainPageSourceRefDto"},"description":"Contributing ingest sources"},"backlinks":{"type":"array","items":{"type":"string"},"description":"Wikilink slugs referenced by the body"},"version":{"type":"integer","description":"Monotonic version, bumped on every compile/edit"},"pinned":{"type":"boolean","description":"Pinned pages rank first in the prompt index and are exempt from deprecation."},"archived":{"type":"boolean","description":"Whether the page has been retired by the user."},"status":{"$ref":"#/components/schemas/BrainPageDtoStatus","description":"Lifecycle state. Deprecated and archived items are hidden from listings by default."},"lastCompiledAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last time this page was recompiled from its sources."},"lastReferencedAt":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp of the last read. Reading a page bumps this, and it feeds the brain health score."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","subjectId","brainId","source","pageType","bucket","bucketSource","slug","title","summary","body","entities","sources","backlinks","version","pinned","archived","status","lastCompiledAt","lastReferencedAt","createdAt","updatedAt"],"title":"BrainPageDto"},"BrainPageListResDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BrainPageDto"},"description":"The pages on this page of results."},"total":{"type":"integer","description":"Total pages matching the filter (ignores pagination)"},"limit":{"type":"integer","description":"Applied page size"},"offset":{"type":"integer","description":"Applied offset"}},"required":["items","total","limit","offset"],"title":"BrainPageListResDto"},"V1BrainsBrainIdPagesSlugDeleteParametersPermanent":{"type":"string","enum":["true"],"title":"V1BrainsBrainIdPagesSlugDeleteParametersPermanent"},"BrainPageDeleteResDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Whether the page was removed."},"pageId":{"type":"string","description":"Deleted page id"},"slug":{"type":"string","description":"Deleted page slug"}},"required":["deleted","pageId","slug"],"title":"BrainPageDeleteResDto"},"BrainPageVersionDto":{"type":"object","properties":{"id":{"type":"string","description":"Version snapshot id"},"tenantId":{"type":"string","description":"Owning tenant id"},"subjectId":{"type":"string","description":"Owning subject id (host-defined)"},"brainId":{"type":"string","description":"Owning brain id"},"pageId":{"type":"string","description":"Page id"},"version":{"type":"integer","description":"Monotonically increasing version number; every edit or recompile increments it."},"title":{"type":"string","description":"Page title as of this version."},"summary":{"type":"string","description":"Page summary as of this version."},"body":{"type":"string","description":"Markdown body at this version"},"ingestSourceId":{"type":["string","null"],"description":"Ingest source that produced this version, if any"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","subjectId","brainId","pageId","version","title","summary","body","ingestSourceId","createdAt","updatedAt"],"title":"BrainPageVersionDto"},"BrainConnectionDtoStrength":{"type":"string","enum":["weak","medium","strong"],"description":"How strongly the two pages are related.","title":"BrainConnectionDtoStrength"},"BrainConnectionDtoSource":{"type":"string","enum":["auto","manual"],"description":"Whether the connection was discovered automatically or created by a user.","title":"BrainConnectionDtoSource"},"BrainConnectionDto":{"type":"object","properties":{"id":{"type":"string","description":"Connection id"},"tenantId":{"type":"string","description":"Owning tenant id"},"subjectId":{"type":"string","description":"Owning subject id (host-defined)"},"brainId":{"type":"string","description":"Owning brain id"},"pageAId":{"type":"string","description":"Identifier of the first page in the pair."},"pageBId":{"type":"string","description":"Identifier of the second page in the pair."},"pageASlug":{"type":"string","description":"Slug of the first page in the pair."},"pageATitle":{"type":"string","description":"Title of the first page in the pair."},"pageBSlug":{"type":"string","description":"Slug of the second page in the pair."},"pageBTitle":{"type":"string","description":"Title of the second page in the pair."},"similarity":{"type":"number","format":"double","description":"Cosine similarity (0-1)"},"strength":{"$ref":"#/components/schemas/BrainConnectionDtoStrength","description":"How strongly the two pages are related."},"reasoning":{"type":"string","description":"Model-generated explanation of why these two pages are connected."},"source":{"$ref":"#/components/schemas/BrainConnectionDtoSource","description":"Whether the connection was discovered automatically or created by a user."},"ackedAt":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp of when a user acknowledged this, or null if still unacknowledged."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","subjectId","brainId","pageAId","pageBId","pageASlug","pageATitle","pageBSlug","pageBTitle","similarity","strength","reasoning","source","ackedAt","createdAt","updatedAt"],"title":"BrainConnectionDto"},"BrainPageConnectionsResDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BrainConnectionDto"},"description":"Connections attached to the page, each with the related page inlined."},"pageId":{"type":"string","description":"Id of the page the connections were fetched for"}},"required":["items","pageId"],"title":"BrainPageConnectionsResDto"},"BrainPageContentReqDto":{"type":"object","properties":{"title":{"type":"string","description":"Human-readable title."},"summary":{"type":"string","description":"Short generated summary of the content."},"body":{"type":"string","description":"New page content. Replaces the existing body and creates a new version."}},"title":"BrainPageContentReqDto"},"MovePageBucketReqDtoBucket":{"type":"string","enum":["inbox","notes","ideas","projects"],"description":"Top-level grouping the page belongs to.","title":"MovePageBucketReqDtoBucket"},"MovePageBucketReqDto":{"type":"object","properties":{"bucket":{"$ref":"#/components/schemas/MovePageBucketReqDtoBucket","description":"Top-level grouping the page belongs to."}},"required":["bucket"],"title":"MovePageBucketReqDto"},"PinPageReqDto":{"type":"object","properties":{"pinned":{"type":"boolean","description":"Pin or unpin"}},"required":["pinned"],"title":"PinPageReqDto"},"RenamePageReqDto":{"type":"object","properties":{"title":{"type":"string","description":"Human-readable title."},"newSlug":{"type":"string","description":"New URL-safe slug. External references to the old slug will stop resolving."}},"title":"RenamePageReqDto"},"ResolveContestedReqDto":{"type":"object","properties":{"resolution":{"type":"string","description":"Resolution note"}},"title":"ResolveContestedReqDto"},"BrainChangeEventDtoAction":{"type":"string","enum":["created","updated","renamed","merged","split","archived","restored","recovered","routed"],"description":"What happened to the page.","title":"BrainChangeEventDtoAction"},"BrainChangeEventDto":{"type":"object","properties":{"id":{"type":"string","description":"Change event id"},"tenantId":{"type":"string","description":"Owning tenant id"},"subjectId":{"type":"string","description":"Owning subject id (host-defined)"},"brainId":{"type":"string","description":"Owning brain id"},"pageId":{"type":"string","description":"Affected page id"},"pageSlug":{"type":"string","description":"Slug of the page this refers to."},"pageTitle":{"type":"string","description":"Title of the page at the time of the event."},"action":{"$ref":"#/components/schemas/BrainChangeEventDtoAction","description":"What happened to the page."},"changeSummary":{"type":"string","description":"One-line human-readable description of the change."},"toVersion":{"type":"integer","description":"Page version after the change."},"fromVersion":{"type":"integer","description":"Page version before the change."},"ingestSourceId":{"type":["string","null"],"description":"Ingest source that triggered the change, if any"},"contradictions":{"type":"array","items":{"type":"string"},"description":"Contradiction notes raised by the compile"},"ackedAt":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp of when a user acknowledged this, or null if still unacknowledged."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","subjectId","brainId","pageId","pageSlug","pageTitle","action","changeSummary","toVersion","fromVersion","ingestSourceId","contradictions","ackedAt","createdAt","updatedAt"],"title":"BrainChangeEventDto"},"BrainChangeListResDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BrainChangeEventDto"},"description":"The change events on this page of results."},"total":{"type":"integer","description":"Total events matching the filter (ignores pagination)"},"limit":{"type":"integer","description":"Applied page size"},"offset":{"type":"integer","description":"Applied offset"}},"required":["items","total","limit","offset"],"title":"BrainChangeListResDto"},"BrainAckAllResDto":{"type":"object","properties":{"acked":{"type":"integer","description":"Number of events acknowledged"}},"required":["acked"],"title":"BrainAckAllResDto"},"V1BrainsBrainIdConnectionsGetParametersStrength":{"type":"string","enum":["weak","medium","strong"],"title":"V1BrainsBrainIdConnectionsGetParametersStrength"},"BrainConnectionListResDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BrainConnectionDto"},"description":"The connections on this page of results."},"total":{"type":"integer","description":"Total connections matching the filter (ignores pagination)"},"limit":{"type":"integer","description":"Applied page size"},"offset":{"type":"integer","description":"Applied offset"}},"required":["items","total","limit","offset"],"title":"BrainConnectionListResDto"},"BrainScoreFactorDtoTone":{"type":"string","enum":["positive","neutral","negative"],"description":"Whether this value reads as good, neutral, or bad — use it to colour the UI.","title":"BrainScoreFactorDtoTone"},"BrainScoreFactorDto":{"type":"object","properties":{"key":{"type":"string","description":"Stable machine-readable identifier, safe to branch on in code."},"label":{"type":"string","description":"Human-readable display name."},"description":{"type":"string","description":"Human-readable explanation of what this factor measures."},"value":{"type":"number","format":"double","description":"The factor's measured value."},"unit":{"type":"string","description":"Unit the value is expressed in, for formatting."},"tone":{"$ref":"#/components/schemas/BrainScoreFactorDtoTone","description":"Whether this value reads as good, neutral, or bad — use it to colour the UI."}},"required":["key","label","description","value","unit","tone"],"title":"BrainScoreFactorDto"},"BrainScoreMetricDto":{"type":"object","properties":{"key":{"type":"string","description":"Stable machine-readable identifier, safe to branch on in code."},"label":{"type":"string","description":"Human-readable display name."},"score":{"type":"number","format":"double","description":"Score 0-100"},"status":{"type":"string","description":"Human-readable status label"},"summary":{"type":"string","description":"One-line explanation of what this metric captures."},"higherIsBetter":{"type":"boolean","description":"Whether a larger value is an improvement. Drives arrow direction in trend UI."},"factors":{"type":"array","items":{"$ref":"#/components/schemas/BrainScoreFactorDto"},"description":"The individual factors that roll up into this metric."}},"required":["key","label","score","status","summary","higherIsBetter","factors"],"title":"BrainScoreMetricDto"},"BrainScoreResDto":{"type":"object","properties":{"brainId":{"type":"string","description":"Identifier of the brain this belongs to."},"freshness":{"$ref":"#/components/schemas/BrainScoreMetricDto","description":"How recently the brain's pages have been updated or referenced."},"readiness":{"$ref":"#/components/schemas/BrainScoreMetricDto","description":"How complete and well-connected the brain is."},"strain":{"$ref":"#/components/schemas/BrainScoreMetricDto","description":"Backlog pressure — unprocessed captures, contested pages, and unacknowledged changes."},"computedAt":{"type":"string","description":"ISO timestamp"}},"required":["brainId","freshness","readiness","strain","computedAt"],"title":"BrainScoreResDto"},"V1BrainsBrainIdScoreHistoryGetParametersRange":{"type":"string","enum":["7d","30d","90d"],"title":"V1BrainsBrainIdScoreHistoryGetParametersRange"},"BrainScoreHistoryResDtoRange":{"type":"string","enum":["7d","30d","90d"],"description":"The time range these results cover.","title":"BrainScoreHistoryResDtoRange"},"BrainScoreHistoryItemDto":{"type":"object","properties":{"computedAt":{"type":"string","description":"ISO timestamp"},"freshness":{"type":"number","format":"double","description":"Freshness score at this point in time."},"readiness":{"type":"number","format":"double","description":"Readiness score at this point in time."},"strain":{"type":"number","format":"double","description":"Strain score at this point in time."}},"required":["computedAt","freshness","readiness","strain"],"title":"BrainScoreHistoryItemDto"},"BrainScoreDeltaDto":{"type":"object","properties":{"freshness":{"type":"number","format":"double","description":"Change in freshness across the requested range."},"readiness":{"type":"number","format":"double","description":"Change in readiness across the requested range."},"strain":{"type":"number","format":"double","description":"Change in strain across the requested range."}},"required":["freshness","readiness","strain"],"title":"BrainScoreDeltaDto"},"BrainScoreHistoryResDto":{"type":"object","properties":{"brainId":{"type":"string","description":"Identifier of the brain this belongs to."},"range":{"$ref":"#/components/schemas/BrainScoreHistoryResDtoRange","description":"The time range these results cover."},"items":{"type":"array","items":{"$ref":"#/components/schemas/BrainScoreHistoryItemDto"},"description":"Score snapshots over the range, oldest first."},"delta":{"oneOf":[{"$ref":"#/components/schemas/BrainScoreDeltaDto"},{"type":"null"}],"description":"Net change between the first and last snapshot."}},"required":["brainId","range","items","delta"],"title":"BrainScoreHistoryResDto"},"BrainScoreSuggestionDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier."},"metric":{"type":"string","description":"Metric the suggestion improves"},"title":{"type":"string","description":"Human-readable title."},"body":{"type":"string","description":"The suggestion text shown to the user."},"action":{"type":"string","description":"Host UI action hint"},"actionLabel":{"type":"string","description":"Suggested call-to-action label for a button."},"priority":{"type":"integer","description":"Lower = more important"}},"required":["id","metric","title","body","action","actionLabel","priority"],"title":"BrainScoreSuggestionDto"},"BrainScoreSuggestionsResDto":{"type":"object","properties":{"brainId":{"type":"string","description":"Identifier of the brain this belongs to."},"generatedBy":{"type":"string","description":"What produced these suggestions — a model, or a deterministic rule set."},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/BrainScoreSuggestionDto"},"description":"Suggestions ranked by expected impact on the score."},"computedAt":{"type":"string","description":"ISO timestamp"}},"required":["brainId","generatedBy","suggestions","computedAt"],"title":"BrainScoreSuggestionsResDto"},"BrainProfileDirectivesResDto":{"type":"object","properties":{"surfaceConnections":{"type":"boolean","description":"Whether the brain should proactively surface non-obvious connections."},"challengeAssumptions":{"type":"boolean","description":"Whether the brain should push back on assumptions rather than agreeing."},"preferVaultContext":{"type":"boolean","description":"Whether stored knowledge should outweigh the model's own priors."},"flagContradictions":{"type":"boolean","description":"Whether to mark pages as contested when new material disagrees with them."},"custom":{"type":"string","description":"Free-form directives appended to the compiled instructions."}},"required":["surfaceConnections","challengeAssumptions","preferVaultContext","flagContradictions","custom"],"title":"BrainProfileDirectivesResDto"},"BrainProfileDto":{"type":"object","properties":{"id":{"type":"string","description":"Profile id"},"tenantId":{"type":"string","description":"Owning tenant id"},"subjectId":{"type":"string","description":"Owning subject id (host-defined)"},"brainId":{"type":"string","description":"Owning brain id"},"whoTheyAre":{"type":"string","description":"Who the subject is — role, background, and context that frames how captures are interpreted."},"whatTheyDo":{"type":"string","description":"What the subject works on day to day."},"focus":{"type":"string","description":"What the subject is concentrating on right now."},"goals":{"type":"string","description":"What the subject is trying to achieve."},"currentProjects":{"type":"string","description":"Projects currently in flight."},"stuckOn":{"type":"string","description":"Known blockers, so the brain can surface relevant material."},"vaultOrganization":{"type":"string","description":"How the subject prefers their knowledge organized."},"directives":{"oneOf":[{"$ref":"#/components/schemas/BrainProfileDirectivesResDto"},{"type":"null"}],"description":"Standing instructions that shape how new captures are compiled."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","subjectId","brainId","whoTheyAre","whatTheyDo","focus","goals","currentProjects","stuckOn","vaultOrganization","directives","createdAt","updatedAt"],"title":"BrainProfileDto"},"BrainProfileDirectivesDto":{"type":"object","properties":{"surfaceConnections":{"type":"boolean","description":"Surface non-obvious connections between captures"},"challengeAssumptions":{"type":"boolean","description":"Challenge the user's assumptions before agreeing"},"preferVaultContext":{"type":"boolean","description":"Answer from vault context, not generically"},"flagContradictions":{"type":"boolean","description":"Flag contradictions with earlier saved beliefs"},"custom":{"type":"string","description":"Custom free-form directives"}},"title":"BrainProfileDirectivesDto"},"UpdateBrainProfileReqDto":{"type":"object","properties":{"whoTheyAre":{"type":"string","description":"Who the subject is. Omit to leave unchanged."},"whatTheyDo":{"type":"string","description":"What the subject works on. Omit to leave unchanged."},"focus":{"type":"string","description":"Current focus. Omit to leave unchanged."},"goals":{"type":"string","description":"Current goals. Omit to leave unchanged."},"currentProjects":{"type":"string","description":"Projects in flight. Omit to leave unchanged."},"stuckOn":{"type":"string","description":"Known blockers. Omit to leave unchanged."},"vaultOrganization":{"type":"string","description":"Organization preference. Omit to leave unchanged."},"directives":{"$ref":"#/components/schemas/BrainProfileDirectivesDto","description":"Standing instructions. Omit to leave unchanged."}},"title":"UpdateBrainProfileReqDto"},"BrainProfileSuggestionsResDto":{"type":"object","properties":{"brainId":{"type":"string","description":"Identifier of the brain this belongs to."},"suggestions":{"type":"object","additionalProperties":{"type":"string"},"description":"Suggested profile field values keyed by field name"}},"required":["brainId","suggestions"],"title":"BrainProfileSuggestionsResDto"},"BrainExportMarkdownResDto":{"type":"object","properties":{"brainId":{"type":"string","description":"Identifier of the brain this belongs to."},"markdown":{"type":"string","description":"Single markdown bundle with front-matter per page"}},"required":["brainId","markdown"],"title":"BrainExportMarkdownResDto"},"BrainBriefSettingsResDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Generate a daily brief for this brain"},"hourLocal":{"type":"integer","minimum":0,"maximum":23,"description":"Local-time hour the brief should fire"},"timezone":{"type":"string","description":"IANA timezone"},"lastBriefDate":{"type":["string","null"],"description":"ISO date (YYYY-MM-DD) of the last generated brief"}},"required":["enabled","hourLocal","timezone","lastBriefDate"],"title":"BrainBriefSettingsResDto"},"BrainDto":{"type":"object","properties":{"id":{"type":"string","description":"Brain id"},"tenantId":{"type":"string","description":"Owning tenant id"},"subjectId":{"type":"string","description":"Owning subject id (host-defined)"},"name":{"type":"string","description":"User-facing name"},"slug":{"type":"string","description":"URL-safe identifier, unique per (tenant, subject)"},"description":{"type":"string","description":"Description"},"briefSettings":{"oneOf":[{"$ref":"#/components/schemas/BrainBriefSettingsResDto"},{"type":"null"}],"description":"Daily-brief schedule and delivery settings for this brain."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","subjectId","name","slug","description","briefSettings","createdAt","updatedAt"],"title":"BrainDto"},"CreateBrainReqDto":{"type":"object","properties":{"name":{"type":"string","description":"User-facing name of the brain"},"description":{"type":"string","description":"Optional description"}},"required":["name"],"title":"CreateBrainReqDto"},"BrainStatsResDto":{"type":"object","properties":{"pageCount":{"type":"integer","description":"Active (non-deprecated, non-archived) pages"},"deprecatedPageCount":{"type":"integer","description":"Deprecated/stale pages awaiting review or recovery"},"archivedPageCount":{"type":"integer","description":"Archived pages"},"sourceCount":{"type":"integer","description":"Ingest sources ever pushed to the brain"},"connectionCount":{"type":"integer","description":"Connections between active pages"},"agentCount":{"type":"integer","description":"Host concept; always 0 here (the host may merge its own count)"},"estimatedBytes":{"type":"integer","description":"Approximate size of all page bodies in bytes"},"bucketCounts":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Active page count per bucket"},"lastActivityAt":{"type":["string","null"],"description":"ISO timestamp of the last compile/read activity"}},"required":["pageCount","deprecatedPageCount","archivedPageCount","sourceCount","connectionCount","agentCount","estimatedBytes","bucketCounts","lastActivityAt"],"title":"BrainStatsResDto"},"DeleteResDto":{"type":"object","properties":{"id":{"type":"string","description":"Id of the deleted resource"}},"required":["id"],"title":"DeleteResDto"},"UpdateBrainReqDto":{"type":"object","properties":{"name":{"type":"string","description":"New name"},"description":{"type":"string","description":"New description"}},"title":"UpdateBrainReqDto"},"BrainBriefSettingsDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Generate a daily brief for this brain"},"hourLocal":{"type":"integer","minimum":0,"maximum":23,"description":"Local-time hour the brief should fire"},"timezone":{"type":"string","description":"IANA timezone"}},"required":["enabled","hourLocal","timezone"],"title":"BrainBriefSettingsDto"},"UpdateBriefSettingsReqDto":{"type":"object","properties":{"briefSettings":{"$ref":"#/components/schemas/BrainBriefSettingsDto","description":"New daily-brief settings. Replaces the existing configuration."}},"required":["briefSettings"],"title":"UpdateBriefSettingsReqDto"},"BrainBriefRunResDto":{"type":"object","properties":{"pageId":{"type":"string","description":"Id of the generated brief page"},"slug":{"type":"string","description":"Slug of the generated brief page"}},"required":["pageId","slug"],"title":"BrainBriefRunResDto"},"BrainCaptureReqDtoKind":{"type":"string","enum":["note","file","url","transcript","chat_turn","integration"],"description":"Kind of raw input","title":"BrainCaptureReqDtoKind"},"BrainCaptureReqDtoBucket":{"type":"string","enum":["inbox","notes","ideas","projects"],"description":"Bucket hint for the resulting page(s)","title":"BrainCaptureReqDtoBucket"},"BrainCaptureReqDto":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/BrainCaptureReqDtoKind","description":"Kind of raw input"},"content":{"type":"string","description":"Raw textual content of the capture"},"fetchUrl":{"type":"string","description":"URL the service fetches and extracts instead of inlined content. Extraction is driven by `kind`: file -> parse PDF, Word, PPTX, HTML, or UTF-8 text; url -> scrape web page; transcript -> transcribe audio. Legacy .ppt and other unsupported binary formats are rejected. No cloud credentials needed."},"mimeType":{"type":"string","description":"MIME type hint for `fetchUrl` extraction (for example application/vnd.openxmlformats-officedocument.presentationml.presentation)"},"fileName":{"type":"string","description":"Original filename hint for `fetchUrl` extraction, including its extension"},"label":{"type":"string","description":"Short title / filename / URL for display"},"originRef":{"type":["string","null"],"description":"Origin URL / external id, also used as the idempotency key for dedup"},"bucket":{"$ref":"#/components/schemas/BrainCaptureReqDtoBucket","description":"Bucket hint for the resulting page(s)"},"source":{"$ref":"#/components/schemas/BrainSourceDto","description":"Opaque provenance"}},"required":["kind"],"title":"BrainCaptureReqDto"},"BrainIngestSourceDtoKind":{"type":"string","enum":["note","file","url","transcript","chat_turn","integration"],"description":"Kind of raw input","title":"BrainIngestSourceDtoKind"},"BrainIngestSourceDtoBucket":{"type":"string","enum":["inbox","notes","ideas","projects"],"description":"Bucket hint for the resulting page(s)","title":"BrainIngestSourceDtoBucket"},"BrainIngestSourceDtoMetadata":{"type":"object","properties":{},"description":"Extraction hints (e.g. mimeType, fileName)","title":"BrainIngestSourceDtoMetadata"},"BrainIngestSourceDtoStatus":{"type":"string","enum":["pending","compiling","completed","failed"],"description":"Compile pipeline status","title":"BrainIngestSourceDtoStatus"},"BrainIngestSourceDto":{"type":"object","properties":{"id":{"type":"string","description":"Ingest source id"},"tenantId":{"type":"string","description":"Owning tenant id"},"subjectId":{"type":"string","description":"Owning subject id (host-defined)"},"brainId":{"type":"string","description":"Owning brain id"},"source":{"oneOf":[{"$ref":"#/components/schemas/BrainSourceDto"},{"type":"null"}],"description":"Opaque provenance"},"kind":{"$ref":"#/components/schemas/BrainIngestSourceDtoKind","description":"Kind of raw input"},"bucket":{"$ref":"#/components/schemas/BrainIngestSourceDtoBucket","description":"Bucket hint for the resulting page(s)"},"label":{"type":"string","description":"Short display label"},"content":{"type":["string","null"],"description":"Extracted text; null for `fetchUrl` sources not yet extracted"},"originRef":{"type":["string","null"],"description":"Origin URL / external id, also the idempotency key for dedup"},"metadata":{"oneOf":[{"$ref":"#/components/schemas/BrainIngestSourceDtoMetadata"},{"type":"null"}],"description":"Extraction hints (e.g. mimeType, fileName)"},"chunkUuids":{"type":"array","items":{"type":"string"},"description":"Knowledge chunk uuids backing this source"},"status":{"$ref":"#/components/schemas/BrainIngestSourceDtoStatus","description":"Compile pipeline status"},"originalBytes":{"type":["integer","null"],"description":"Original file/note bytes counted toward account storage"},"lastError":{"type":["string","null"],"description":"Last compile error, if any"},"affectedPageIds":{"type":"array","items":{"type":"string"},"description":"Ids of pages this source contributed to"},"attempts":{"type":"integer","description":"Compile attempts so far"},"compiledAt":{"type":["string","null"],"format":"date-time","description":"When the compile completed"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","subjectId","brainId","source","kind","bucket","label","content","originRef","metadata","chunkUuids","status","originalBytes","lastError","affectedPageIds","attempts","compiledAt","createdAt","updatedAt"],"title":"BrainIngestSourceDto"},"BrainCaptureBatchReqDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BrainCaptureReqDto"},"description":"Captures to ingest"}},"required":["items"],"title":"BrainCaptureBatchReqDto"},"BrainCaptureBatchResDto":{"type":"object","properties":{"ingested":{"type":"integer","description":"Number of sources ingested"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/BrainIngestSourceDto"},"description":"One ingest source per accepted item, in the order submitted."}},"required":["ingested","sources"],"title":"BrainCaptureBatchResDto"},"BrainCaptureChatTurnReqDtoSender":{"type":"string","enum":["user","agent"],"description":"Who produced the turn","title":"BrainCaptureChatTurnReqDtoSender"},"BrainCaptureChatTurnReqDto":{"type":"object","properties":{"text":{"type":"string","description":"Raw chat turn text"},"sender":{"$ref":"#/components/schemas/BrainCaptureChatTurnReqDtoSender","description":"Who produced the turn"},"agentName":{"type":"string","description":"Agent display name for classifier context"},"originRef":{"type":["string","null"],"description":"Idempotency key for the turn (e.g. chat:<id>:<ts>)"},"source":{"$ref":"#/components/schemas/BrainSourceDto","description":"Opaque provenance"}},"required":["text","sender"],"title":"BrainCaptureChatTurnReqDto"},"BrainCaptureChatTurnResDto":{"type":"object","properties":{"worthy":{"type":"boolean","description":"Whether the turn was deemed worth capturing"},"reason":{"type":"string","description":"Classifier reasoning (or drop reason)"},"sourceId":{"type":"string","description":"Created ingest source id when worthy"}},"required":["worthy","reason"],"title":"BrainCaptureChatTurnResDto"},"V1BrainsBrainIdSourcesGetParametersStatus":{"type":"string","enum":["pending","compiling","completed","failed"],"title":"V1BrainsBrainIdSourcesGetParametersStatus"},"BrainSourceListResDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BrainIngestSourceDto"},"description":"The ingest sources on this page of results."},"total":{"type":"integer","description":"Total sources matching the filter (ignores pagination)"},"limit":{"type":"integer","description":"Applied page size"},"offset":{"type":"integer","description":"Applied offset"}},"required":["items","total","limit","offset"],"title":"BrainSourceListResDto"},"BrainSourceRetryResDto":{"type":"object","properties":{"enqueued":{"type":"boolean","description":"Whether the compile job was enqueued"},"id":{"type":"string","description":"Ingest source id"}},"required":["enqueued","id"],"title":"BrainSourceRetryResDto"},"WebhookSubscriptionDtoEventsItems":{"type":"string","enum":["brain.page.updated","brain.change.new","brain.connection.new","brain.brief.ready","brain.import.progress"],"title":"WebhookSubscriptionDtoEventsItems"},"WebhookSubscriptionDto":{"type":"object","properties":{"id":{"type":"string","description":"Subscription id"},"tenantId":{"type":"string","description":"Owning tenant id"},"url":{"type":"string","description":"Delivery endpoint"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscriptionDtoEventsItems"},"description":"Subscribed event types; empty = all"},"active":{"type":"boolean","description":"Whether the subscription is currently receiving deliveries."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."}},"required":["id","tenantId","url","events","active","createdAt","updatedAt"],"title":"WebhookSubscriptionDto"},"CreateWebhookReqDtoEventsItems":{"type":"string","enum":["brain.page.updated","brain.change.new","brain.connection.new","brain.brief.ready","brain.import.progress"],"title":"CreateWebhookReqDtoEventsItems"},"CreateWebhookReqDto":{"type":"object","properties":{"url":{"type":"string","description":"HTTPS endpoint to deliver events to"},"events":{"type":"array","items":{"$ref":"#/components/schemas/CreateWebhookReqDtoEventsItems"},"description":"Event types to subscribe to; empty = all"},"secret":{"type":"string","minLength":16,"description":"Signing secret to use for this subscription. When omitted a random secret is generated and returned once. Hosts that verify deliveries against a pre-configured secret (e.g. an env var) should pass it here so signatures match. Write-only: never returned on reads."}},"required":["url"],"title":"CreateWebhookReqDto"},"CreateWebhookResDtoEventsItems":{"type":"string","enum":["brain.page.updated","brain.change.new","brain.connection.new","brain.brief.ready","brain.import.progress"],"title":"CreateWebhookResDtoEventsItems"},"CreateWebhookResDto":{"type":"object","properties":{"id":{"type":"string","description":"Subscription id"},"tenantId":{"type":"string","description":"Owning tenant id"},"url":{"type":"string","description":"Delivery endpoint"},"events":{"type":"array","items":{"$ref":"#/components/schemas/CreateWebhookResDtoEventsItems"},"description":"Subscribed event types; empty = all"},"active":{"type":"boolean","description":"Whether the subscription is currently receiving deliveries."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was last modified."},"secret":{"type":"string","description":"Raw signing secret for verifying `x-brain-signature` on deliveries. Returned exactly once; store it now."}},"required":["id","tenantId","url","events","active","createdAt","updatedAt","secret"],"title":"CreateWebhookResDto"},"UpdateWebhookReqDtoEventsItems":{"type":"string","enum":["brain.page.updated","brain.change.new","brain.connection.new","brain.brief.ready","brain.import.progress"],"title":"UpdateWebhookReqDtoEventsItems"},"UpdateWebhookReqDto":{"type":"object","properties":{"url":{"type":"string","description":"New delivery URL. Omit to leave unchanged."},"events":{"type":"array","items":{"$ref":"#/components/schemas/UpdateWebhookReqDtoEventsItems"},"description":"New event list. Replaces the existing subscription set. Omit to leave unchanged."},"active":{"type":"boolean","description":"Set false to pause deliveries without deleting the subscription."}},"title":"UpdateWebhookReqDto"},"BrainTelegramBotResDtoStatus":{"type":"string","enum":["connected","revoked","failed"],"description":"Lifecycle state. Deprecated and archived items are hidden from listings by default.","title":"BrainTelegramBotResDtoStatus"},"BrainTelegramBotResDto":{"type":"object","properties":{"id":{"type":"string","description":"Connection row id"},"brainId":{"type":"string","description":"Owning brain id"},"botUsername":{"type":"string","description":"Bot username (without @)"},"botFirstName":{"type":["string","null"],"description":"Display name of the connected Telegram bot."},"status":{"$ref":"#/components/schemas/BrainTelegramBotResDtoStatus","description":"Lifecycle state. Deprecated and archived items are hidden from listings by default."},"connectedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the bot was linked."},"lastCaptureAt":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp of the most recent message captured via Telegram."}},"required":["id","brainId","botUsername","botFirstName","status","connectedAt","lastCaptureAt"],"title":"BrainTelegramBotResDto"},"ConnectTelegramReqDto":{"type":"object","properties":{"botToken":{"type":"string","description":"BotFather bot token to connect to this brain"}},"required":["botToken"],"title":"ConnectTelegramReqDto"},"BrainTelegramDisconnectResDto":{"type":"object","properties":{"disconnected":{"type":"boolean","description":"False when no bot was connected"}},"required":["disconnected"],"title":"BrainTelegramDisconnectResDto"},"BrainSlackInstallationResDtoStatus":{"type":"string","enum":["connected","revoked","failed"],"description":"Installation state. `revoked` means the app was removed from the Slack workspace; `failed` means the install did not complete.","title":"BrainSlackInstallationResDtoStatus"},"BrainSlackInstallationResDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the Slack installation."},"teamId":{"type":"string","description":"Slack workspace (team) ID."},"teamName":{"type":["string","null"],"description":"Slack workspace name, when Slack provides it."},"enterpriseId":{"type":["string","null"],"description":"Slack Enterprise Grid organization ID, for Enterprise Grid installs."},"enterpriseName":{"type":["string","null"],"description":"Slack Enterprise Grid organization name, for Enterprise Grid installs."},"status":{"$ref":"#/components/schemas/BrainSlackInstallationResDtoStatus","description":"Installation state. `revoked` means the app was removed from the Slack workspace; `failed` means the install did not complete."},"connectedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the Slack workspace was connected."}},"required":["id","teamId","teamName","enterpriseId","enterpriseName","status","connectedAt"],"title":"BrainSlackInstallationResDto"},"BrainSlackBindingResDtoStatus":{"type":"string","enum":["active","disabled"],"description":"Whether the binding is currently delivering notifications.","title":"BrainSlackBindingResDtoStatus"},"BrainSlackBindingResDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the channel binding."},"brainId":{"type":"string","description":"ID of the brain this channel is bound to."},"installationId":{"type":"string","description":"ID of the Slack installation the channel belongs to."},"teamId":{"type":"string","description":"Slack workspace (team) ID."},"channelId":{"type":"string","description":"Slack channel ID."},"channelName":{"type":["string","null"],"description":"Slack channel name, when available."},"status":{"$ref":"#/components/schemas/BrainSlackBindingResDtoStatus","description":"Whether the binding is currently delivering notifications."},"notifyBriefs":{"type":"boolean","description":"Whether the channel receives the daily brief."},"notifyConnections":{"type":"boolean","description":"Whether the channel is notified when strong new connections are discovered."},"notifyChanges":{"type":"boolean","description":"Whether the channel is notified when pages are updated with new knowledge."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when this record was created."}},"required":["id","brainId","installationId","teamId","channelId","channelName","status","notifyBriefs","notifyConnections","notifyChanges","createdAt"],"title":"BrainSlackBindingResDto"},"BrainSlackStatusResDto":{"type":"object","properties":{"installations":{"type":"array","items":{"$ref":"#/components/schemas/BrainSlackInstallationResDto"},"description":"Slack workspaces installed for this brain."},"bindings":{"type":"array","items":{"$ref":"#/components/schemas/BrainSlackBindingResDto"},"description":"Slack channels bound to this brain."}},"required":["installations","bindings"],"title":"BrainSlackStatusResDto"},"SlackOAuthStartResDto":{"type":"object","properties":{"authorizationUrl":{"type":"string","description":"Open this URL to authorize the LivingBrain Slack app"},"expiresAt":{"type":"string","format":"date-time","description":"Expiry of the signed OAuth state"}},"required":["authorizationUrl","expiresAt"],"title":"SlackOAuthStartResDto"},"SlackOAuthConfirmReqDto":{"type":"object","properties":{"code":{"type":"string","description":"Slack authorization code"},"state":{"type":"string","description":"Signed OAuth state"}},"required":["code","state"],"title":"SlackOAuthConfirmReqDto"},"SlackOAuthConfirmResDto":{"type":"object","properties":{"installationId":{"type":"string","description":"ID of the Slack installation that was created or updated."},"brainId":{"type":"string","description":"ID of the brain the installation is attached to."},"teamId":{"type":"string","description":"Slack workspace (team) ID."},"teamName":{"type":"string","description":"Slack workspace name."}},"required":["installationId","brainId"],"title":"SlackOAuthConfirmResDto"},"BrainSlackChannelResDto":{"type":"object","properties":{"id":{"type":"string","description":"Slack channel ID."},"name":{"type":"string","description":"Slack channel name."},"isPrivate":{"type":"boolean","description":"Whether the channel is private."},"isMember":{"type":"boolean","description":"Whether the Living Brain bot is already a member of the channel."}},"required":["id","name","isPrivate","isMember"],"title":"BrainSlackChannelResDto"},"BindSlackChannelReqDto":{"type":"object","properties":{"installationId":{"type":"string","description":"Slack installation id"},"channelId":{"type":"string","description":"Slack channel id"}},"required":["installationId","channelId"],"title":"BindSlackChannelReqDto"},"BrainSlackUnbindResDto":{"type":"object","properties":{"disconnected":{"type":"boolean","description":"True when the binding or installation was removed."}},"required":["disconnected"],"title":"BrainSlackUnbindResDto"},"UpdateSlackBindingReqDto":{"type":"object","properties":{"notifyBriefs":{"type":"boolean","description":"Receive daily summary of brain updates"},"notifyConnections":{"type":"boolean","description":"Get notified when strong new connections are discovered"},"notifyChanges":{"type":"boolean","description":"Get notified when pages are updated with new knowledge"}},"title":"UpdateSlackBindingReqDto"}},"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Living Brain API key. Create one from the dashboard; keys are scoped to an\norganization and carry the role of the member they were issued to.\n"}}}}