{"openapi":"3.1.0","info":{"title":"Open Brain API","version":"0.1.0"},"paths":{"/api/health":{"get":{"summary":"Health: database, worker heartbeat, non-content inference gateway and semantic search mode","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["ok","degraded","down"]},"db":{"type":"string","enum":["ok","down"]},"worker":{"type":"object","properties":{"heartbeat_age_s":{"type":["number","null"]}},"required":["heartbeat_age_s"],"additionalProperties":false},"semantic_search":{"type":"object","properties":{"mode":{"anyOf":[{"type":"string","enum":["semantic","keyword"]},{"type":"null"}]}},"required":["mode"],"additionalProperties":false},"inference":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":["string","null"]},"status":{"type":"string","enum":["available","not_configured","unavailable"]},"last_error_at":{"type":["string","null"]}},"required":["provider","model","status","last_error_at"],"additionalProperties":false},"version":{"type":"string"},"env":{"type":"string","enum":["dev","prod","test"]}},"required":["status","db","worker","semantic_search","inference","version","env"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/revision":{"get":{"summary":"Deployed commit and build time","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sha":{"type":"string"},"built_at":{"type":["string","null"]}},"required":["sha","built_at"],"additionalProperties":false}}}}}}},"/api/ready":{"get":{"summary":"Readiness (503 while draining)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ready":{"type":"boolean"},"draining":{"type":"boolean"}},"required":["ready","draining"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/flags":{"get":{"summary":"Public flags and gate states","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"env":{"type":"string","enum":["dev","prod","test"]},"gates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},"grupo_menu":{"type":"boolean"}},"required":["env","gates","grupo_menu"],"additionalProperties":false}}}}}}},"/api/v1/capabilities":{"get":{"summary":"User journeys served now (features) and provider adapter status, derived from the live route conditions (no secrets)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"features":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"destination":{"type":"string","enum":["search","history","account","capture"]},"status":{"type":"string","enum":["available","unavailable"]},"requires_session":{"type":"boolean"},"endpoints":{"type":"array","items":{"type":"string"}},"gate":{"type":"string"},"reason_key":{"type":"string"},"mode":{"type":"string","enum":["semantic","keyword"]},"checklist_url":{"type":"string"},"deprecated":{"type":"boolean","const":true},"sunset":{"type":"string"},"successor":{"type":"string"},"fixture":{"type":"boolean","const":true}},"required":["id","destination","status","requires_session","endpoints"],"additionalProperties":false}},"adapters":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string","enum":["available","unavailable","test_only"]},"gate":{"type":"string"},"gate_open":{"type":"boolean"},"reason_key":{"type":"string"},"checklist_url":{"type":"string"}},"required":["kind","provider","status","gate","gate_open","checklist_url"],"additionalProperties":false}},"sign_in":{"type":"object","properties":{"methods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["passkey","google","apple","whatsapp","email","magic_link","token_exchange"]},"enabled":{"type":"boolean"}},"required":["id","enabled"],"additionalProperties":false}},"google_client_id":{"type":"string"},"apple_services_id":{"type":"string"}},"required":["methods"],"additionalProperties":false}},"required":["features","adapters"],"additionalProperties":false}}}}}}},"/api/v1/search":{"post":{"summary":"Search Open Group public pages by default. External web search requires G-WEBSEARCH-PROVIDER.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":4000},"scope":{"default":"open_group","type":"string","enum":["open_group","web"]}},"required":["q"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"snippet":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","title","snippet"],"additionalProperties":false}},"scope":{"type":"string","enum":["open_group","web"]},"source":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified":{"type":"boolean"},"calculation":{"description":"Present when the whole query is arithmetic; computed by code, not by a model.","type":"object","properties":{"expression":{"type":"string"},"value":{"type":"number"},"source":{"type":"string","const":"calculator"}},"required":["expression","value","source"],"additionalProperties":false}},"required":["results","scope","source","fetched_at","verified"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/search/live":{"get":{"summary":"Live record-level search across eligible Open Group apps (per-source counts; real and demo kept separate; no inference)","parameters":[{"name":"q","in":"query","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","minLength":1,"maxLength":800}},{"name":"locale","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["pt-PT","en","es"]}},{"name":"limit","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":6,"type":"integer","minimum":1,"maximum":24}},{"name":"page","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":1,"type":"integer","minimum":1,"maximum":50}},{"name":"sources","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":200,"pattern":"^[a-z0-9]+(,[a-z0-9]+)*$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"status":{"type":"string","enum":["ok","empty","timeout","error","unavailable"]},"real_total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"demo_total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"entity":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"excerpt":{"type":"string"},"url":{"type":"string","format":"uri"},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"thumb_url":{"type":"string","format":"uri"},"alt":{"type":"string"}},"required":["url"],"additionalProperties":false},"price":{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"},"period":{"type":"string","enum":["month","night","once"]}},"required":["amount","currency"],"additionalProperties":false},"facts":{"type":"array","items":{"type":"string"}},"demo":{"type":"boolean"},"published_at":{"type":"string"}},"required":["id","source","entity","title","url","demo"],"additionalProperties":false}},"has_more":{"type":"boolean"},"see_all_url":{"type":"string","format":"uri"},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"took_ms":{"type":"number"},"error_key":{"type":"string"}},"required":["source","status","real_total","demo_total","cards","took_ms"],"additionalProperties":false}},"took_ms":{"type":"number"},"inference_calls":{"type":"number","const":0}},"required":["q","locale","sources","took_ms","inference_calls"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/search/live/connectors":{"get":{"summary":"Connector registry used by live search","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"connectors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string","format":"uri"},"repo":{"type":"string"},"entities":{"type":"array","items":{"type":"string"}},"filters":{"type":"array","items":{"type":"string"}},"auth_scopes":{"type":"array","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string","enum":["pt-PT","en","es"]}},"deep_link":{"type":"string"},"freshness":{"type":"string"},"demo_policy":{"type":"string"},"timeout_ms":{"type":"number"},"status":{"type":"string","enum":["live","planned","excluded"]},"disposition":{"type":"string"}},"required":["id","origin","repo","entities","filters","auth_scopes","locales","deep_link","freshness","demo_policy","timeout_ms","status"],"additionalProperties":false}},"coverage":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string","format":"uri"},"status":{"type":"string","enum":["live","planned","excluded"]},"disposition":{"type":"string"}},"required":["id","origin","status","disposition"],"additionalProperties":false}}},"required":["connectors","coverage"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/search/live/telemetry":{"post":{"summary":"Time-to-first-card samples from live search clients (numbers only, never query text)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"samples":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"ms":{"type":"integer","minimum":0,"maximum":60000},"cached":{"type":"boolean"},"chars":{"type":"integer","minimum":0,"maximum":200}},"required":["ms","cached","chars"],"additionalProperties":false}}},"required":["samples"],"additionalProperties":false}}}},"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/brain/search":{"get":{"summary":"Search your memories, captures and conversations with local embeddings or keyword fallback. Results include the current space_id or null.","security":[{"openBrainSession":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","minLength":1,"maxLength":400,"pattern":"^[^\\0]*$"}},{"name":"kinds","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"memory,capture,thread","type":"string","maxLength":21,"pattern":"^(memory|capture|thread)(,(memory|capture|thread))*$"}},{"name":"limit","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"20","type":"string","pattern":"^(?:[1-9][0-9]?|100)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","enum":["semantic","keyword"]},"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["memory","capture","thread"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"snippet":{"type":"string"},"score":{"type":"number","minimum":0,"maximum":1},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"space_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","id","title","snippet","score","updated_at","space_id"],"additionalProperties":false}}},"required":["mode","items"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/ai/connection":{"get":{"summary":"Read your shared AI connection state","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"state":{"type":"string","enum":["not_connected","connected","revoked","expired","quota_reached"]},"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["openai","anthropic","google"]},"name":{"type":"string","enum":["OpenAI","Claude","Gemini"]},"auth":{"type":"string","enum":["api_key","subscription"]},"status":{"type":"string","enum":["active","revoked","expired","quota_reached"]}},"required":["id","name","auth","status"],"additionalProperties":false}},"manage_url":{"type":["string","null"]},"source":{"type":"string","enum":["mock","open-group"]}},"required":["state","providers","manage_url","source"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Revoke your shared AI connection","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{},"additionalProperties":false}}}},"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/ai/connection/start":{"post":{"summary":"Get the URL to start a shared AI connection. In mock mode, this is /connect-ai/mock on the configured app origin.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"connect_url":{"type":"string"}},"required":["connect_url"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/ai/connection/mock":{"post":{"summary":"Set your mock connection state. Only registered in dev or test with the mock active.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"state":{"type":"string","enum":["not_connected","connected","revoked","expired","quota_reached"]}},"required":["state"],"additionalProperties":false}}}},"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/model":{"post":{"summary":"Answer using the chat capability of your shared AI connection (gated: G-MODEL-LANE). Requires an active session, the canonical Origin and X-OpenBrain-Auth: 1. Pass space_id to prefer memories in that space after pinned memories.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":4000},"space_id":{"description":"Prefer memories in this owned space after pinned memories when signed in.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"history":{"description":"Up to three previous question and answer pairs, oldest first. History is limited to 1,024 UTF-8 bytes and the current question plus history to 1,536 UTF-8 bytes.","maxItems":3,"type":"array","items":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":1024},"a":{"type":"string","minLength":1,"maxLength":1024}},"required":["q","a"],"additionalProperties":false}},"context_session":{"description":"Session context returned by the last answer, required for signed-in preview follow-ups.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"thread_id":{"description":"Owned thread UUID. Its stored messages supply the history.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"save":{"description":"Create a thread when no thread_id is supplied.","type":"boolean"},"model_mode":{"description":"Omit or use auto to use the connected account. Explicit lane selection returns model unavailable.","type":"string","enum":["auto","gateway","local"]}},"required":["q"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"output":{"type":"object","properties":{"text":{"type":"string"},"model":{"type":"string"},"ai_generated":{"type":"boolean","const":true},"provider":{"type":"string"},"fallback":{"type":"boolean"},"fallback_reason":{"type":["string","null"]},"truncated":{"type":"boolean","const":true},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false}},"required":["text","ai_generated"],"additionalProperties":false},"source":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified":{"type":"boolean"},"context_session":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"thread_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memories_used":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"confirmed":{"type":"boolean"}},"required":["id","text","confirmed"],"additionalProperties":false}}},"required":["output","source","fetched_at","verified","memories_used"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/model/stream":{"post":{"summary":"Stream an answer using the chat capability of your shared AI connection (gated: G-MODEL-LANE). An unusable connection returns a 409 JSON error envelope before streaming. Requires an active session, the canonical Origin and X-OpenBrain-Auth: 1. Pass space_id to prefer memories in that space after pinned memories.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":4000},"space_id":{"description":"Prefer memories in this owned space after pinned memories when signed in.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"history":{"description":"Up to three previous question and answer pairs, oldest first. History is limited to 1,024 UTF-8 bytes and the current question plus history to 1,536 UTF-8 bytes.","maxItems":3,"type":"array","items":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":1024},"a":{"type":"string","minLength":1,"maxLength":1024}},"required":["q","a"],"additionalProperties":false}},"context_session":{"description":"Session context returned by the last answer, required for signed-in preview follow-ups.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"thread_id":{"description":"Owned thread UUID. Its stored messages supply the history.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"save":{"description":"Create a thread when no thread_id is supplied.","type":"boolean"},"model_mode":{"description":"Omit or use auto to use the connected account. Explicit lane selection returns model unavailable.","type":"string","enum":["auto","gateway","local"]}},"required":["q"]}}}},"responses":{"200":{"description":"OK","content":{"text/event-stream":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","description":"Server-sent events with JSON data. meta: {provider, model? (omitted for mock answers), fallback, fallback_reason, memories_used, thread_id?}. delta: {text}. done: {usage?, truncated?, context_session}. Saved turns commit before done. Interrupted saved streams keep only the question."}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/model/compare":{"post":{"summary":"Model comparison is unavailable. The connection service selects the model for each capability.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":4000},"space_id":{"description":"Prefer memories in this owned space after pinned memories when signed in.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"history":{"description":"Up to three previous question and answer pairs, oldest first. History is limited to 1,024 UTF-8 bytes and the current question plus history to 1,536 UTF-8 bytes.","maxItems":3,"type":"array","items":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":1024},"a":{"type":"string","minLength":1,"maxLength":1024}},"required":["q","a"],"additionalProperties":false}},"context_session":{"description":"Session context returned by the last answer, required for signed-in preview follow-ups.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["q"]}}}},"responses":{"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/data-export":{"post":{"summary":"Download your profile, active session and passkey metadata, Open Group Search Tasks, Model threads with messages, memories, captures, spaces and saved records as JSON. Derived embeddings are excluded.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"schema_version":{"type":"number","const":1},"exported_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"profile":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"email":{"type":["string","null"]},"locale":{"type":"string","enum":["pt-PT","en","es"]}},"required":["created_at","updated_at","email","locale"],"additionalProperties":false},"passkeys":{"type":"array","items":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["created_at","last_used_at"],"additionalProperties":false}},"active_sessions":{"type":"array","items":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"current":{"type":"boolean"}},"required":["created_at","expires_at","current"],"additionalProperties":false}},"identities":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["google","apple","whatsapp","email"]},"subject":{"type":"string"},"email":{"type":["string","null"]},"email_is_private_relay":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["provider","subject","email","email_is_private_relay","created_at","last_used_at"],"additionalProperties":false}},"threads":{"type":"array","items":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"last_model":{"type":["string","null"]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"model":{"type":["string","null"]},"provider":{"type":["string","null"]},"fallback":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","role","content","model","provider","fallback","created_at","seq"],"additionalProperties":false}},"space_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["created_at","updated_at","id","title","last_model","archived_at","messages"],"additionalProperties":false}},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"source":{"type":"string","enum":["user","conversation"]},"source_thread_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmed":{"type":"boolean"},"pinned":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"space_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","text","kind","source","source_thread_id","confirmed","pinned","created_at","updated_at","last_used_at"],"additionalProperties":false}},"captures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["text","url","file"]},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},{"type":"null"}]},"text":{"type":["string","null"]},"url":{"type":["string","null"]},"mime":{"type":["string","null"]},"byte_size":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["pending","ready","failed"]},"error_code":{"anyOf":[{"type":"string","enum":["url_blocked","url_fetch_failed","url_timeout","url_too_large","url_unsupported_media","extraction_failed","no_text","ocr_unavailable"]},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"space_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","kind","title","text","url","mime","byte_size","status","error_code","created_at","updated_at"],"additionalProperties":false}},"spaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,80}$","description":"Name, 1 to 80 characters."},"emoji":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"color":{"anyOf":[{"type":"string","enum":["violet","blue","green","amber","rose","slate"]},{"type":"null"}]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"counts":{"type":"object","properties":{"threads":{"type":"integer","minimum":0,"maximum":9007199254740991},"memories":{"type":"integer","minimum":0,"maximum":9007199254740991},"captures":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["threads","memories","captures"],"additionalProperties":false}},"required":["id","name","emoji","color","archived_at","created_at","updated_at","counts"],"additionalProperties":false}},"saved_records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source":{"type":"string","pattern":"^[a-z0-9_-]{1,40}$"},"record_id":{"type":"string"},"entity":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"subtitle":{"type":["string","null"]},"image_url":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","minimum":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"period":{"type":"string","enum":["month","night","once"]}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"facts":{"type":"array","items":{"type":"string"}},"demo":{"type":"boolean"},"saved_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","source","record_id","entity","title","url","subtitle","image_url","price","facts","demo","saved_at","updated_at"],"additionalProperties":false}},"search_watches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"string"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"cadence":{"type":"string","enum":["daily","weekly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"local_hour":{"type":"integer","minimum":0,"maximum":23},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"next_run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unseen_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","query","locale","cadence","weekday","local_hour","timezone","status","next_run_at","last_run_at","unseen_count","created_at","updated_at"],"additionalProperties":false}},"plans":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"capture_extractions":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"source_connections":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"}},"required":["source","scopes","created_at"],"additionalProperties":false}},"search_tasks":{"type":"array","items":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"query":{"type":"string"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"state":{"type":"string","enum":["queued","working","done","failed","cancelled"]},"scope":{"type":"string","const":"open_group"},"sources":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"snippet":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","title","snippet"],"additionalProperties":false}}},"required":["created_at","updated_at","query","locale","state","scope","sources"],"additionalProperties":false}}},"required":["schema_version","exported_at","profile","passkeys","active_sessions","identities","threads","memories","captures","spaces","saved_records","search_watches","search_tasks"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/account/delete/options":{"post":{"summary":"Start a fresh passkey confirmation bound to the current session","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"challenge":{"type":"string"},"rpId":{"type":"string"},"timeout":{"type":"number"},"userVerification":{"type":"string","const":"required"},"allowCredentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"public-key"}},"required":["id","type"],"additionalProperties":false}}},"required":["challenge","rpId","timeout","userVerification","allowCredentials"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/account":{"delete":{"summary":"Erase your account after explicit confirmation and a fresh passkey assertion","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"confirmed":{"type":"boolean","const":true},"credential":{"type":"object","properties":{"id":{"type":"string","maxLength":2048,"pattern":"^[A-Za-z0-9_-]+$"},"rawId":{"type":"string","maxLength":2048,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"type":"string","const":"public-key"},"clientExtensionResults":{"type":"object","properties":{}},"response":{"type":"object","properties":{"clientDataJSON":{"type":"string","maxLength":8192,"pattern":"^[A-Za-z0-9_-]+$"},"authenticatorData":{"type":"string","maxLength":8192,"pattern":"^[A-Za-z0-9_-]+$"},"signature":{"type":"string","maxLength":8192,"pattern":"^[A-Za-z0-9_-]+$"},"userHandle":{"type":"string","minLength":22,"maxLength":22,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["clientDataJSON","authenticatorData","signature"]}},"required":["id","rawId","type","clientExtensionResults","response"]}},"required":["confirmed","credential"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/spaces":{"get":{"summary":"List your active spaces and item counts, including archived spaces when include_archived is 1","security":[{"openBrainSession":[]}],"parameters":[{"name":"include_archived","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"0","type":"string","enum":["0","1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,80}$","description":"Name, 1 to 80 characters."},"emoji":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"color":{"anyOf":[{"type":"string","enum":["violet","blue","green","amber","rose","slate"]},{"type":"null"}]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"counts":{"type":"object","properties":{"threads":{"type":"integer","minimum":0,"maximum":9007199254740991},"memories":{"type":"integer","minimum":0,"maximum":9007199254740991},"captures":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["threads","memories","captures"],"additionalProperties":false}},"required":["id","name","emoji","color","archived_at","created_at","updated_at","counts"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a space. A duplicate active name returns 409 with spaces.duplicate.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9._:-]{8,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,80}$","description":"Name, 1 to 80 characters."},"emoji":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"color":{"anyOf":[{"type":"string","enum":["violet","blue","green","amber","rose","slate"]},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,80}$","description":"Name, 1 to 80 characters."},"emoji":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"color":{"anyOf":[{"type":"string","enum":["violet","blue","green","amber","rose","slate"]},{"type":"null"}]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"counts":{"type":"object","properties":{"threads":{"type":"integer","minimum":0,"maximum":9007199254740991},"memories":{"type":"integer","minimum":0,"maximum":9007199254740991},"captures":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["threads","memories","captures"],"additionalProperties":false}},"required":["id","name","emoji","color","archived_at","created_at","updated_at","counts"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/spaces/{id}":{"patch":{"summary":"Edit, archive or restore your space. A duplicate active name returns 409 with spaces.duplicate.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,80}$","description":"Name, 1 to 80 characters."},"emoji":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"color":{"anyOf":[{"type":"string","enum":["violet","blue","green","amber","rose","slate"]},{"type":"null"}]},"archived":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,80}$","description":"Name, 1 to 80 characters."},"emoji":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"color":{"anyOf":[{"type":"string","enum":["violet","blue","green","amber","rose","slate"]},{"type":"null"}]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"counts":{"type":"object","properties":{"threads":{"type":"integer","minimum":0,"maximum":9007199254740991},"memories":{"type":"integer","minimum":0,"maximum":9007199254740991},"captures":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["threads","memories","captures"],"additionalProperties":false}},"required":["id","name","emoji","color","archived_at","created_at","updated_at","counts"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete your space and keep its items","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/spaces/{id}/items":{"get":{"summary":"List up to 20 items in your space by most recent update, optionally filtered by kind","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"kind","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["thread","memory","capture"]}},{"name":"cursor","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":160,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["thread","memory","capture"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":["string","null"]},"snippet":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["kind","id","title","snippet","updated_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Move your item into your space.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["thread","memory","capture"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}}}},"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Remove your item from this space.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["thread","memory","capture"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}}}},"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/threads":{"get":{"summary":"List your threads by most recent update. Filter by space or archive status, or search titles and message text.","security":[{"openBrainSession":[]}],"parameters":[{"name":"space_id","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Filter by owned space UUID.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":300}},{"name":"cursor","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":160,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"20","description":"Maximum number of results, from 1 to 50 (default 20).","type":"string","pattern":"^(?:[1-9]|[1-4][0-9]|50)$"}},{"name":"archived","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"include","description":"Use exclude for active threads, only for archived threads, or include for both (default).","type":"string","enum":["exclude","only","include"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"snippet":{"type":["string","null"]},"message_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","title","updated_at","archived_at","snippet","message_count"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["threads","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create an empty thread","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"thread":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"last_model":{"type":["string","null"]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["created_at","updated_at","id","title","last_model","archived_at"],"additionalProperties":false}},"required":["thread"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/threads/{id}":{"get":{"summary":"Read your thread with its messages in sequence order","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"thread":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"last_model":{"type":["string","null"]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"model":{"type":["string","null"]},"provider":{"type":["string","null"]},"fallback":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","role","content","model","provider","fallback","created_at","seq"],"additionalProperties":false}}},"required":["created_at","updated_at","id","title","last_model","archived_at","messages"],"additionalProperties":false}},"required":["thread"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Rename, archive or unarchive your thread","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"archived":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"thread":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"last_model":{"type":["string","null"]},"archived_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["created_at","updated_at","id","title","last_model","archived_at"],"additionalProperties":false}},"required":["thread"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete your thread and all its messages","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/memories":{"get":{"summary":"List your memories, optionally filtered by space, with relevance ranking when searching","security":[{"openBrainSession":[]}],"parameters":[{"name":"space_id","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Filter by owned space UUID.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":200,"pattern":"^[^\\0]*$"}},{"name":"kind","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["fact","preference","goal","person","date","note"]}},{"name":"limit","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"50","type":"string","pattern":"^(?:[1-9][0-9]?|100)$"}},{"name":"cursor","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","minLength":1,"maxLength":512}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"source":{"type":"string","enum":["user","conversation"]},"source_thread_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmed":{"type":"boolean"},"pinned":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","text","kind","source","source_thread_id","confirmed","pinned","created_at","updated_at","last_used_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Save a confirmed memory, or return an existing exact or near duplicate","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"source_thread_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"source":{"type":"string","enum":["user","conversation"]},"source_thread_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmed":{"type":"boolean"},"pinned":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","text","kind","source","source_thread_id","confirmed","pinned","created_at","updated_at","last_used_at"],"additionalProperties":false},"duplicate":{"type":"boolean","const":true}},"required":["item","duplicate"],"additionalProperties":false}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"source":{"type":"string","enum":["user","conversation"]},"source_thread_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmed":{"type":"boolean"},"pinned":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","text","kind","source","source_thread_id","confirmed","pinned","created_at","updated_at","last_used_at"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/memories/{id}":{"patch":{"summary":"Edit, pin or confirm an owned memory. A duplicate edit returns a conflict.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"pinned":{"type":"boolean"},"confirmed":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"source":{"type":"string","enum":["user","conversation"]},"source_thread_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmed":{"type":"boolean"},"pinned":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","text","kind","source","source_thread_id","confirmed","pinned","created_at","updated_at","last_used_at"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete an owned memory","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/memories/delete-all":{"post":{"summary":"Delete all your memories after explicit confirmation","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"confirm":{"type":"string","const":"delete_all"}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["deleted"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/memories/export":{"get":{"summary":"Download all your memories as JSON","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"exported_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]},"source":{"type":"string","enum":["user","conversation"]},"source_thread_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmed":{"type":"boolean"},"pinned":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","text","kind","source","source_thread_id","confirmed","pinned","created_at","updated_at","last_used_at"],"additionalProperties":false}}},"required":["exported_at","items"],"additionalProperties":false}}},"headers":{"Content-Disposition":{"schema":{"type":"string","const":"attachment; filename=\"openbrain-memories.json\""}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/memory/settings":{"get":{"summary":"Read whether your memories are used in Model prompts (enabled by default)","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Enable or disable the use of your memories in Model prompts","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/memories/suggest":{"post":{"summary":"Extract up to three unsaved, nonduplicate suggestions from your words in English, Portuguese or Spanish","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":2000,"pattern":"^[^\\0]*$"}},"required":["q"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"suggestions":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]}},"required":["text","kind"],"additionalProperties":false}}},"required":["suggestions"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/captures":{"get":{"summary":"List your capture summaries, newest first. Filter by space or search titles and extracted text with q.","security":[{"openBrainSession":[]}],"parameters":[{"name":"space_id","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Filter by owned space UUID.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":200,"pattern":"^[^\\0]*$"}},{"name":"limit","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"50","type":"string","pattern":"^(?:[1-9][0-9]?|100)$"}},{"name":"cursor","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","minLength":1,"maxLength":512}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["text","url","file"]},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},{"type":"null"}]},"url":{"type":["string","null"]},"mime":{"type":["string","null"]},"byte_size":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["pending","ready","failed"]},"error_code":{"anyOf":[{"type":"string","enum":["url_blocked","url_fetch_failed","url_timeout","url_too_large","url_unsupported_media","extraction_failed","no_text","ocr_unavailable"]},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","kind","title","url","mime","byte_size","status","error_code","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Save text, fetch a public HTTP(S) URL, or extract text from an uploaded file. Creation returns the item and its extraction status.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9._:-]{8,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":204800,"pattern":"^[^\\0]*$","description":"Up to 200 KiB of UTF-8 text"},"title":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"url"},"url":{"type":"string","maxLength":8192,"format":"uri"}},"required":["kind","url"],"additionalProperties":false}]}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","const":"file"},"title":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"file":{"type":"string","format":"binary","description":"One file up to 10 MiB: PDF, plain text, Markdown, or image/* metadata"}},"required":["kind","file"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["text","url","file"]},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},{"type":"null"}]},"text":{"type":["string","null"]},"url":{"type":["string","null"]},"mime":{"type":["string","null"]},"byte_size":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["pending","ready","failed"]},"error_code":{"anyOf":[{"type":"string","enum":["url_blocked","url_fetch_failed","url_timeout","url_too_large","url_unsupported_media","extraction_failed","no_text","ocr_unavailable"]},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","kind","title","text","url","mime","byte_size","status","error_code","created_at","updated_at"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"415":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/captures/{id}":{"get":{"summary":"Read your capture and its extracted text","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["text","url","file"]},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},{"type":"null"}]},"text":{"type":["string","null"]},"url":{"type":["string","null"]},"mime":{"type":["string","null"]},"byte_size":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["pending","ready","failed"]},"error_code":{"anyOf":[{"type":"string","enum":["url_blocked","url_fetch_failed","url_timeout","url_too_large","url_unsupported_media","extraction_failed","no_text","ocr_unavailable"]},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","kind","title","text","url","mime","byte_size","status","error_code","created_at","updated_at"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete your capture","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/captures/{id}/suggest-memories":{"post":{"summary":"Preview up to five unsaved deterministic memory suggestions from your capture","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"suggestions":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\0]*$"},"kind":{"type":"string","enum":["fact","preference","goal","person","date","note"]}},"required":["text","kind"],"additionalProperties":false}}},"required":["suggestions"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/saved":{"get":{"summary":"List your saved live-search records, newest first (at most 200), optionally for one source, with counts per source","security":[{"openBrainSession":[]}],"parameters":[{"name":"source","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[a-z0-9_-]{1,40}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source":{"type":"string","pattern":"^[a-z0-9_-]{1,40}$"},"record_id":{"type":"string"},"entity":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"subtitle":{"type":["string","null"]},"image_url":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","minimum":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"period":{"type":"string","enum":["month","night","once"]}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"facts":{"type":"array","items":{"type":"string"}},"demo":{"type":"boolean"},"saved_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","source","record_id","entity","title","url","subtitle","image_url","price","facts","demo","saved_at","updated_at"],"additionalProperties":false}},"by_source":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","pattern":"^[a-z0-9_-]{1,40}$"},"count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["source","count"],"additionalProperties":false}}},"required":["items","by_source"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Save a live-search record card, or refresh the snapshot of one already saved (200, same id). The source must be a live connector and every link https on its origin.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"source":{"type":"string","pattern":"^[a-z0-9_-]{1,40}$"},"id":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,200}$"},"entity":{"type":"string","pattern":"^[a-z0-9_-]{1,40}$"},"title":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,500}$"},"url":{"type":"string","minLength":1,"maxLength":8192},"subtitle":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,500}$"},"image":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":8192}},"required":["url"],"additionalProperties":false},"price":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"period":{"type":"string","enum":["month","night","once"]}},"required":["amount","currency"],"additionalProperties":false},"facts":{"maxItems":8,"type":"array","items":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,200}$"}},"demo":{"type":"boolean"}},"required":["source","id","entity","title","url","demo"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source":{"type":"string","pattern":"^[a-z0-9_-]{1,40}$"},"record_id":{"type":"string"},"entity":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"subtitle":{"type":["string","null"]},"image_url":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","minimum":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"period":{"type":"string","enum":["month","night","once"]}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"facts":{"type":"array","items":{"type":"string"}},"demo":{"type":"boolean"},"saved_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","source","record_id","entity","title","url","subtitle","image_url","price","facts","demo","saved_at","updated_at"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source":{"type":"string","pattern":"^[a-z0-9_-]{1,40}$"},"record_id":{"type":"string"},"entity":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"subtitle":{"type":["string","null"]},"image_url":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","minimum":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"period":{"type":"string","enum":["month","night","once"]}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"facts":{"type":"array","items":{"type":"string"}},"demo":{"type":"boolean"},"saved_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","source","record_id","entity","title","url","subtitle","image_url","price","facts","demo","saved_at","updated_at"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/saved/{id}":{"delete":{"summary":"Remove a saved record","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/watches":{"get":{"summary":"List your saved-search watches, newest first (at most 20), with the next run in UTC and the count of unseen events","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"string"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"cadence":{"type":"string","enum":["daily","weekly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"local_hour":{"type":"integer","minimum":0,"maximum":23},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"next_run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unseen_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","query","locale","cadence","weekday","local_hour","timezone","status","next_run_at","last_run_at","unseen_count","created_at","updated_at"],"additionalProperties":false}},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["items","limit"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Watch a live search on a local daily or weekly hour in an IANA time zone (default daily at 08:00). The first run records what exists without events; later runs record new, changed and removed cards. 200 returns the watch you already have for the same query; 409 when you have 20.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,200}$"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"cadence":{"default":"daily","type":"string","enum":["daily","weekly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"local_hour":{"default":8,"type":"integer","minimum":0,"maximum":23},"timezone":{"type":"string"}},"required":["query","timezone"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"watch":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"string"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"cadence":{"type":"string","enum":["daily","weekly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"local_hour":{"type":"integer","minimum":0,"maximum":23},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"next_run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unseen_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","query","locale","cadence","weekday","local_hour","timezone","status","next_run_at","last_run_at","unseen_count","created_at","updated_at"],"additionalProperties":false}},"required":["watch"],"additionalProperties":false}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"watch":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"string"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"cadence":{"type":"string","enum":["daily","weekly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"local_hour":{"type":"integer","minimum":0,"maximum":23},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"next_run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unseen_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","query","locale","cadence","weekday","local_hour","timezone","status","next_run_at","last_run_at","unseen_count","created_at","updated_at"],"additionalProperties":false}},"required":["watch"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/watches/{id}":{"patch":{"summary":"Pause or resume a watch, or change its query, cadence, weekday (ISO, 1 = Monday), hour or time zone. The next run is recomputed from now; a new query starts a fresh snapshot. 409 when another watch has the same query.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","pattern":"^[^\\0\\p{Cs}]{1,200}$"},"status":{"type":"string","enum":["active","paused"]},"cadence":{"type":"string","enum":["daily","weekly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"local_hour":{"type":"integer","minimum":0,"maximum":23},"timezone":{"type":"string"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"watch":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"string"},"locale":{"type":"string","enum":["pt-PT","en","es"]},"cadence":{"type":"string","enum":["daily","weekly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"local_hour":{"type":"integer","minimum":0,"maximum":23},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"next_run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unseen_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","query","locale","cadence","weekday","local_hour","timezone","status","next_run_at","last_run_at","unseen_count","created_at","updated_at"],"additionalProperties":false}},"required":["watch"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a watch with its snapshot and events","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/watches/{id}/events":{"get":{"summary":"New, changed and removed cards a watch found, newest first. Pass next_cursor as cursor for the next page; unseen=1 for unseen only.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"limit","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9_-]{1,200}$"}},{"name":"unseen","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["0","1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["new","changed","removed"]},"source":{"type":"string"},"record_id":{"type":"string"},"card":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"entity":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"subtitle":{"type":"string"},"image":{"type":"object","properties":{"url":{"type":"string"},"thumb_url":{"type":"string"}},"required":["url"],"additionalProperties":false},"price":{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"},"period":{"type":"string","enum":["month","night","once"]}},"required":["amount","currency"],"additionalProperties":false},"facts":{"type":"array","items":{"type":"string"}},"demo":{"type":"boolean"}},"required":["id","source","entity","title","url","demo"],"additionalProperties":false},"run_slot":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"seen_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","source","record_id","card","run_slot","created_at","seen_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/watches/{id}/seen":{"post":{"summary":"Mark every event of a watch as seen; returns how many changed","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"seen":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["seen"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/watches/{id}/run":{"post":{"summary":"Queue a run now. While one is pending another request shares it (queued: false). 409 when the watch is paused.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/tasks":{"get":{"summary":"List your recent public Open Group research tasks","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","const":"open_group_research"},"q":{"type":"string"},"state":{"type":"string","enum":["queued","working","done","failed","cancelled"]},"locale":{"type":"string","enum":["pt-PT","en","es"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"result":{"anyOf":[{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"snippet":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","title","snippet"],"additionalProperties":false}},"scope":{"type":"string","const":"open_group"},"source":{"type":"string","const":"open-group"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified":{"type":"boolean","const":true},"calculation":{"description":"Present when the whole query is arithmetic; computed by code, not by a model.","type":"object","properties":{"expression":{"type":"string"},"value":{"type":"number"},"source":{"type":"string","const":"calculator"}},"required":["expression","value","source"],"additionalProperties":false}},"required":["results","scope","source","fetched_at","verified"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","q","state","locale","created_at","updated_at","result"],"additionalProperties":false}}},"required":["tasks"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Queue one public Open Group research lookup, or return the task for a repeated request key","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9._:-]{8,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":300}},"required":["q"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","const":"open_group_research"},"q":{"type":"string"},"state":{"type":"string","enum":["queued","working","done","failed","cancelled"]},"locale":{"type":"string","enum":["pt-PT","en","es"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"result":{"anyOf":[{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"snippet":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","title","snippet"],"additionalProperties":false}},"scope":{"type":"string","const":"open_group"},"source":{"type":"string","const":"open-group"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified":{"type":"boolean","const":true},"calculation":{"description":"Present when the whole query is arithmetic; computed by code, not by a model.","type":"object","properties":{"expression":{"type":"string"},"value":{"type":"number"},"source":{"type":"string","const":"calculator"}},"required":["expression","value","source"],"additionalProperties":false}},"required":["results","scope","source","fetched_at","verified"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","q","state","locale","created_at","updated_at","result"],"additionalProperties":false}},"required":["task"],"additionalProperties":false}}}},"202":{"description":"Queued","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","const":"open_group_research"},"q":{"type":"string"},"state":{"type":"string","enum":["queued","working","done","failed","cancelled"]},"locale":{"type":"string","enum":["pt-PT","en","es"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"result":{"anyOf":[{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"snippet":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","title","snippet"],"additionalProperties":false}},"scope":{"type":"string","const":"open_group"},"source":{"type":"string","const":"open-group"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified":{"type":"boolean","const":true},"calculation":{"description":"Present when the whole query is arithmetic; computed by code, not by a model.","type":"object","properties":{"expression":{"type":"string"},"value":{"type":"number"},"source":{"type":"string","const":"calculator"}},"required":["expression","value","source"],"additionalProperties":false}},"required":["results","scope","source","fetched_at","verified"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","q","state","locale","created_at","updated_at","result"],"additionalProperties":false}},"required":["task"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/tasks/{id}":{"get":{"summary":"Get your research task status and verified sources","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","const":"open_group_research"},"q":{"type":"string"},"state":{"type":"string","enum":["queued","working","done","failed","cancelled"]},"locale":{"type":"string","enum":["pt-PT","en","es"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"result":{"anyOf":[{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"snippet":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","title","snippet"],"additionalProperties":false}},"scope":{"type":"string","const":"open_group"},"source":{"type":"string","const":"open-group"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified":{"type":"boolean","const":true},"calculation":{"description":"Present when the whole query is arithmetic; computed by code, not by a model.","type":"object","properties":{"expression":{"type":"string"},"value":{"type":"number"},"source":{"type":"string","const":"calculator"}},"required":["expression","value","source"],"additionalProperties":false}},"required":["results","scope","source","fetched_at","verified"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","q","state","locale","created_at","updated_at","result"],"additionalProperties":false}},"required":["task"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/tasks/{id}/cancel":{"post":{"summary":"Cancel your pending research task","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","const":"open_group_research"},"q":{"type":"string"},"state":{"type":"string","enum":["queued","working","done","failed","cancelled"]},"locale":{"type":"string","enum":["pt-PT","en","es"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"result":{"anyOf":[{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"snippet":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","title","snippet"],"additionalProperties":false}},"scope":{"type":"string","const":"open_group"},"source":{"type":"string","const":"open-group"},"fetched_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified":{"type":"boolean","const":true},"calculation":{"description":"Present when the whole query is arithmetic; computed by code, not by a model.","type":"object","properties":{"expression":{"type":"string"},"value":{"type":"number"},"source":{"type":"string","const":"calculator"}},"required":["expression","value","source"],"additionalProperties":false}},"required":["results","scope","source","fetched_at","verified"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","q","state","locale","created_at","updated_at","result"],"additionalProperties":false}},"required":["task"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/plans":{"get":{"summary":"List your plans, most recently updated first (at most 100)","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"space_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"query":{"type":"string"},"locale":{"type":"string"},"rev":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"criteria":{"type":"object","properties":{"q":{"type":"string"},"intent":{"type":"string","enum":["home","item","event","any"]}},"required":["q","intent"],"additionalProperties":{}},"comparison":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"matches":{"type":"array","items":{"type":"string"}},"misses":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}}},"required":["key","matches","misses","unknown"],"additionalProperties":{}}},"real_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"demo_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gaps":{"type":"array","items":{"type":"string"}}},"required":["candidates","real_count","demo_count","gaps"],"additionalProperties":{}},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["save_shortlist","watch_search","source_favorite","source_saved_search","resolve_missing"]},"state":{"type":"string","enum":["prepared","authorized","dispatched","confirmed","failed","cancelled"]},"records":{"type":"array","items":{"type":"string"}}},"required":["id","kind","state","records"],"additionalProperties":{}}},"summary":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"highlights":{"type":"array","items":{"type":"object","properties":{"record":{"type":"string"},"reason":{"type":"string"}},"required":["record","reason"],"additionalProperties":false}},"provenance":{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}}},"required":["text","highlights","provenance"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","space_id","query","locale","rev","criteria","comparison","steps","summary"],"additionalProperties":{}}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Turn a query into a plan: live-search records from Open Group apps (no model call), compared on their own fields with demo records labelled, typed next steps, and an optional summary that cites only plan records. The plan is kept in a Space.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":2,"maxLength":200},"locale":{"type":"string","enum":["pt-PT","en","es"]},"assist":{"type":"boolean"}},"required":["q"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"space_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"query":{"type":"string"},"locale":{"type":"string"},"rev":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"criteria":{"type":"object","properties":{"q":{"type":"string"},"intent":{"type":"string","enum":["home","item","event","any"]}},"required":["q","intent"],"additionalProperties":{}},"comparison":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"matches":{"type":"array","items":{"type":"string"}},"misses":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}}},"required":["key","matches","misses","unknown"],"additionalProperties":{}}},"real_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"demo_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gaps":{"type":"array","items":{"type":"string"}}},"required":["candidates","real_count","demo_count","gaps"],"additionalProperties":{}},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["save_shortlist","watch_search","source_favorite","source_saved_search","resolve_missing"]},"state":{"type":"string","enum":["prepared","authorized","dispatched","confirmed","failed","cancelled"]},"records":{"type":"array","items":{"type":"string"}}},"required":["id","kind","state","records"],"additionalProperties":{}}},"summary":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"highlights":{"type":"array","items":{"type":"object","properties":{"record":{"type":"string"},"reason":{"type":"string"}},"required":["record","reason"],"additionalProperties":false}},"provenance":{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}}},"required":["text","highlights","provenance"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","space_id","query","locale","rev","criteria","comparison","steps","summary"],"additionalProperties":{}},"summary_status":{"type":"string"},"timings":{"type":"object","properties":{"retrieve_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"summary_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["retrieve_ms","summary_ms"],"additionalProperties":false},"inference_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["plan","summary_status","timings","inference_calls"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/plans/{id}":{"get":{"summary":"Read one of your plans","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"space_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"query":{"type":"string"},"locale":{"type":"string"},"rev":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"criteria":{"type":"object","properties":{"q":{"type":"string"},"intent":{"type":"string","enum":["home","item","event","any"]}},"required":["q","intent"],"additionalProperties":{}},"comparison":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"matches":{"type":"array","items":{"type":"string"}},"misses":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}}},"required":["key","matches","misses","unknown"],"additionalProperties":{}}},"real_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"demo_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gaps":{"type":"array","items":{"type":"string"}}},"required":["candidates","real_count","demo_count","gaps"],"additionalProperties":{}},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["save_shortlist","watch_search","source_favorite","source_saved_search","resolve_missing"]},"state":{"type":"string","enum":["prepared","authorized","dispatched","confirmed","failed","cancelled"]},"records":{"type":"array","items":{"type":"string"}}},"required":["id","kind","state","records"],"additionalProperties":{}}},"summary":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"highlights":{"type":"array","items":{"type":"object","properties":{"record":{"type":"string"},"reason":{"type":"string"}},"required":["record","reason"],"additionalProperties":false}},"provenance":{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}}},"required":["text","highlights","provenance"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","space_id","query","locale","rev","criteria","comparison","steps","summary"],"additionalProperties":{}}},"required":["plan"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a plan (its Space and saved records stay)","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/plans/{id}/refine":{"post":{"summary":"Rebuild the plan for a new query. Send the plan revision you saw; 409 when it changed.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":2,"maxLength":200},"rev":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"assist":{"type":"boolean"}},"required":["q","rev"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"space_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"query":{"type":"string"},"locale":{"type":"string"},"rev":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"criteria":{"type":"object","properties":{"q":{"type":"string"},"intent":{"type":"string","enum":["home","item","event","any"]}},"required":["q","intent"],"additionalProperties":{}},"comparison":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"matches":{"type":"array","items":{"type":"string"}},"misses":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}}},"required":["key","matches","misses","unknown"],"additionalProperties":{}}},"real_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"demo_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gaps":{"type":"array","items":{"type":"string"}}},"required":["candidates","real_count","demo_count","gaps"],"additionalProperties":{}},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["save_shortlist","watch_search","source_favorite","source_saved_search","resolve_missing"]},"state":{"type":"string","enum":["prepared","authorized","dispatched","confirmed","failed","cancelled"]},"records":{"type":"array","items":{"type":"string"}}},"required":["id","kind","state","records"],"additionalProperties":{}}},"summary":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"highlights":{"type":"array","items":{"type":"object","properties":{"record":{"type":"string"},"reason":{"type":"string"}},"required":["record","reason"],"additionalProperties":false}},"provenance":{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}}},"required":["text","highlights","provenance"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","space_id","query","locale","rev","criteria","comparison","steps","summary"],"additionalProperties":{}},"summary_status":{"type":"string"},"timings":{"type":"object","properties":{"retrieve_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"summary_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["retrieve_ms","summary_ms"],"additionalProperties":false},"inference_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["plan","summary_status","timings","inference_calls"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/plans/{id}/steps/{step}/run":{"post":{"summary":"Run one step (save shortlist, watch search, Open List favorite or saved search). Requires an Idempotency-Key per tap; retrying with the same key never repeats a write. A step is confirmed only after reading the result back from its destination; otherwise 502 with error_key and retryable.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"step","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[a-z0-9-]{1,40}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rev":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"timezone":{"type":"string","maxLength":64}},"required":["rev"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"space_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"query":{"type":"string"},"locale":{"type":"string"},"rev":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"criteria":{"type":"object","properties":{"q":{"type":"string"},"intent":{"type":"string","enum":["home","item","event","any"]}},"required":["q","intent"],"additionalProperties":{}},"comparison":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"matches":{"type":"array","items":{"type":"string"}},"misses":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}}},"required":["key","matches","misses","unknown"],"additionalProperties":{}}},"real_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"demo_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gaps":{"type":"array","items":{"type":"string"}}},"required":["candidates","real_count","demo_count","gaps"],"additionalProperties":{}},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["save_shortlist","watch_search","source_favorite","source_saved_search","resolve_missing"]},"state":{"type":"string","enum":["prepared","authorized","dispatched","confirmed","failed","cancelled"]},"records":{"type":"array","items":{"type":"string"}}},"required":["id","kind","state","records"],"additionalProperties":{}}},"summary":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"highlights":{"type":"array","items":{"type":"object","properties":{"record":{"type":"string"},"reason":{"type":"string"}},"required":["record","reason"],"additionalProperties":false}},"provenance":{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}}},"required":["text","highlights","provenance"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","space_id","query","locale","rev","criteria","comparison","steps","summary"],"additionalProperties":{}},"outcome":{"type":"string","enum":["confirmed","failed"]},"replayed":{"type":"boolean"},"error_key":{"type":"string"},"retryable":{"type":"boolean"}},"required":["plan"],"additionalProperties":{}}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/plans/{id}/steps/{step}/cancel":{"post":{"summary":"Cancel a step that is not confirmed yet","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"step","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[a-z0-9-]{1,40}$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rev":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["rev"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"space_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"query":{"type":"string"},"locale":{"type":"string"},"rev":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"criteria":{"type":"object","properties":{"q":{"type":"string"},"intent":{"type":"string","enum":["home","item","event","any"]}},"required":["q","intent"],"additionalProperties":{}},"comparison":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"matches":{"type":"array","items":{"type":"string"}},"misses":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}}},"required":["key","matches","misses","unknown"],"additionalProperties":{}}},"real_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"demo_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gaps":{"type":"array","items":{"type":"string"}}},"required":["candidates","real_count","demo_count","gaps"],"additionalProperties":{}},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["save_shortlist","watch_search","source_favorite","source_saved_search","resolve_missing"]},"state":{"type":"string","enum":["prepared","authorized","dispatched","confirmed","failed","cancelled"]},"records":{"type":"array","items":{"type":"string"}}},"required":["id","kind","state","records"],"additionalProperties":{}}},"summary":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"highlights":{"type":"array","items":{"type":"object","properties":{"record":{"type":"string"},"reason":{"type":"string"}},"required":["record","reason"],"additionalProperties":false}},"provenance":{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}}},"required":["text","highlights","provenance"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","space_id","query","locale","rev","criteria","comparison","steps","summary"],"additionalProperties":{}}},"required":["plan"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/connections/sources":{"get":{"summary":"Your connections to Open Group source apps (names, scopes and dates; never tokens)","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"connected":{"type":"boolean"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["source","connected","scopes"],"additionalProperties":{}}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/connections/openlist/start":{"post":{"summary":"Start the Open List OAuth 2.1 + PKCE authorization (scopes account:read listings:manage). Web: navigate to authorize_url. iOS: platform \"ios\", then POST complete.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"platform":{"type":"string","enum":["web","ios"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"authorize_url":{"type":"string","format":"uri"},"redirect_uri":{"type":"string"}},"required":["authorize_url","redirect_uri"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/connections/openlist/complete":{"post":{"summary":"Finish connecting with your session: the code and state from the iOS private-use scheme redirect, or from the fragment the web callback hands to /app/u/plans (platform \"web\"). The state must belong to your session.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string"},"state":{"type":"string"},"iss":{"type":"string"},"platform":{"type":"string","enum":["web","ios"]}},"required":["code","state"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"connected":{"type":"boolean","const":true},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"]}},"required":["connected","scopes","expires_at"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/connections/openlist":{"delete":{"summary":"Disconnect Open List: revokes the token at Open List and forgets it","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"disconnected":{"type":"boolean","const":true},"revoked_at_source":{"type":"boolean"}},"required":["disconnected","revoked_at_source"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/captures/{id}/extract":{"post":{"summary":"Extract search criteria from a text capture: deterministic first; the functional model (private) only when needed. Every field has a confidence; uncertain and price fields are flagged for review.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"locale":{"type":"string","enum":["pt-PT","en","es"]},"use_model":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"extraction":{"type":"object","properties":{"capture_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"type":"string","enum":["deterministic","model"]},"result":{"type":"object","properties":{"kind":{"type":"string","enum":["home","item","event","other"]},"search_query":{"type":"string","minLength":2,"maxLength":120},"fields":{"type":"object","properties":{"location":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_max":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_min":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"bedrooms":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":10},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"operation":{"type":"object","properties":{"value":{"type":"string","enum":["rent","buy"]},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"date":{"type":"object","properties":{"value":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"item":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false}},"additionalProperties":false},"transcript":{"type":"string","maxLength":4000},"ambiguities":{"default":[],"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","search_query","fields","ambiguities"],"additionalProperties":false},"needs_review":{"type":"array","items":{"type":"string"}},"effective_query":{"type":"string"},"provenance":{"anyOf":[{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}},{"type":"null"}]}},"required":["capture_id","method","result","needs_review","effective_query","provenance"],"additionalProperties":{}},"inference_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["extraction","inference_calls"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/captures/extract-image":{"post":{"summary":"Extract search criteria from a photo (JPEG, PNG or WebP up to 3 MiB). Creates a capture holding the text read from it; the photo is not kept.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"extraction":{"type":"object","properties":{"capture_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"type":"string","enum":["deterministic","model"]},"result":{"type":"object","properties":{"kind":{"type":"string","enum":["home","item","event","other"]},"search_query":{"type":"string","minLength":2,"maxLength":120},"fields":{"type":"object","properties":{"location":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_max":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_min":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"bedrooms":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":10},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"operation":{"type":"object","properties":{"value":{"type":"string","enum":["rent","buy"]},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"date":{"type":"object","properties":{"value":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"item":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false}},"additionalProperties":false},"transcript":{"type":"string","maxLength":4000},"ambiguities":{"default":[],"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","search_query","fields","ambiguities"],"additionalProperties":false},"needs_review":{"type":"array","items":{"type":"string"}},"effective_query":{"type":"string"},"provenance":{"anyOf":[{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}},{"type":"null"}]}},"required":["capture_id","method","result","needs_review","effective_query","provenance"],"additionalProperties":{}},"inference_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["extraction","inference_calls"],"additionalProperties":{}}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"415":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/captures/{id}/extraction":{"get":{"summary":"Read the extraction of your capture","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"extraction":{"type":"object","properties":{"capture_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"type":"string","enum":["deterministic","model"]},"result":{"type":"object","properties":{"kind":{"type":"string","enum":["home","item","event","other"]},"search_query":{"type":"string","minLength":2,"maxLength":120},"fields":{"type":"object","properties":{"location":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_max":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_min":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"bedrooms":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":10},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"operation":{"type":"object","properties":{"value":{"type":"string","enum":["rent","buy"]},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"date":{"type":"object","properties":{"value":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"item":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false}},"additionalProperties":false},"transcript":{"type":"string","maxLength":4000},"ambiguities":{"default":[],"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","search_query","fields","ambiguities"],"additionalProperties":false},"needs_review":{"type":"array","items":{"type":"string"}},"effective_query":{"type":"string"},"provenance":{"anyOf":[{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}},{"type":"null"}]}},"required":["capture_id","method","result","needs_review","effective_query","provenance"],"additionalProperties":{}}},"required":["extraction"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Correct fields (null clears), mark reviewed, or link the plan it produced","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fields":{"default":{},"type":"object","properties":{"location":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"price_max":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"price_min":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"bedrooms":{"anyOf":[{"type":"integer","minimum":0,"maximum":10},{"type":"null"}]},"operation":{"anyOf":[{"type":"string","enum":["rent","buy"]},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"item":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"reviewed":{"default":true,"type":"boolean"},"plan_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"extraction":{"type":"object","properties":{"capture_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"type":"string","enum":["deterministic","model"]},"result":{"type":"object","properties":{"kind":{"type":"string","enum":["home","item","event","other"]},"search_query":{"type":"string","minLength":2,"maxLength":120},"fields":{"type":"object","properties":{"location":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_max":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"price_min":{"type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"bedrooms":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":10},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"operation":{"type":"object","properties":{"value":{"type":"string","enum":["rent","buy"]},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"date":{"type":"object","properties":{"value":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false},"item":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["value","confidence"],"additionalProperties":false}},"additionalProperties":false},"transcript":{"type":"string","maxLength":4000},"ambiguities":{"default":[],"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","search_query","fields","ambiguities"],"additionalProperties":false},"needs_review":{"type":"array","items":{"type":"string"}},"effective_query":{"type":"string"},"provenance":{"anyOf":[{"type":"object","properties":{"app":{"type":"string","const":"openbrain.run"},"lane":{"type":"string","enum":["text","functional"]},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"},"effort":{"type":"string"},"fallback":{"type":"boolean"}},"required":["app","lane","provider","model","effort","fallback"],"additionalProperties":{}},{"type":"null"}]}},"required":["capture_id","method","result","needs_review","effective_query","provenance"],"additionalProperties":{}}},"required":["extraction"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete the extraction (the capture stays)","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/google/nonce":{"post":{"summary":"Get a single-use nonce for Google Sign-In (10 minutes)","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"nonce":{"type":"string"},"expires_in":{"type":"number","const":600}},"required":["nonce","expires_in"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/google/verify":{"post":{"summary":"Verify a Google ID token (signature from the provider JWKS, issuer, audience, expiry and the nonce). intent sign-in starts a session (201 for a new account); link adds it to the signed-in account (fresh session required); reauth refreshes this session. Email addresses are never merged automatically.","security":[{},{"openBrainSession":[]}],"x-openbrain-credential":"request body (provider ID token, one-time code or password)","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id_token":{"type":"string","minLength":20,"maxLength":8192},"nonce":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"intent":{"default":"sign-in","type":"string","enum":["sign-in","link","reauth"]}},"required":["id_token","nonce"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false},{"type":"object","properties":{"linked":{"type":"boolean","const":true}},"required":["linked"],"additionalProperties":false},{"type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}]}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false},{"type":"object","properties":{"linked":{"type":"boolean","const":true}},"required":["linked"],"additionalProperties":false},{"type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}]}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/apple/nonce":{"post":{"summary":"Get a single-use nonce for Apple Sign-In (10 minutes)","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"nonce":{"type":"string"},"expires_in":{"type":"number","const":600}},"required":["nonce","expires_in"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/apple/verify":{"post":{"summary":"Verify a Apple ID token (signature from the provider JWKS, issuer, audience, expiry and the nonce as SHA-256 hex). intent sign-in starts a session (201 for a new account); link adds it to the signed-in account (fresh session required); reauth refreshes this session. Email addresses are never merged automatically.","security":[{},{"openBrainSession":[]}],"x-openbrain-credential":"request body (provider ID token, one-time code or password)","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id_token":{"type":"string","minLength":20,"maxLength":8192},"nonce":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"intent":{"default":"sign-in","type":"string","enum":["sign-in","link","reauth"]}},"required":["id_token","nonce"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false},{"type":"object","properties":{"linked":{"type":"boolean","const":true}},"required":["linked"],"additionalProperties":false},{"type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}]}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false},{"type":"object","properties":{"linked":{"type":"boolean","const":true}},"required":["linked"],"additionalProperties":false},{"type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}]}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/apple/notifications":{"post":{"summary":"Apple server-to-server notifications. consent-revoked and account-delete remove the Apple identity and sign out its account.","x-openbrain-credential":"signed payload","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payload":{"type":"string","description":"Apple's signed server-to-server notification JWT"}},"required":["payload"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"received":{"type":"boolean","const":true}},"required":["received"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/whatsapp/start":{"post":{"summary":"Send a 6-digit code by WhatsApp to an E.164 phone number (valid 10 minutes, 5 attempts; limited per phone and per address)","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"phone":{"type":"string","minLength":8,"maxLength":32}},"required":["phone"]}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sent":{"type":"boolean","const":true},"expires_in":{"type":"number","const":600}},"required":["sent","expires_in"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/whatsapp/verify":{"post":{"summary":"Check the WhatsApp code from the same browser. intent works as for Google and Apple.","security":[{},{"openBrainSession":[]}],"x-openbrain-credential":"request body (provider ID token, one-time code or password)","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","pattern":"^[0-9]{6}$"},"intent":{"default":"sign-in","type":"string","enum":["sign-in","link","reauth"]}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false},{"type":"object","properties":{"linked":{"type":"boolean","const":true}},"required":["linked"],"additionalProperties":false},{"type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}]}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false},{"type":"object","properties":{"linked":{"type":"boolean","const":true}},"required":["linked"],"additionalProperties":false},{"type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}]}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/email/register":{"post":{"summary":"Start an email and password account. Weak or breached passwords return 400; the email link (15 minutes) creates the account.","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254},"password":{"type":"string","minLength":1,"maxLength":1024}},"required":["email","password"]}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":false,"description":"Same response whether or not the address has an account"}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/email/register/verify":{"post":{"summary":"Create the account from a verification link token","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"}},"required":["token"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/email/sign-in":{"post":{"summary":"Sign in with email and password. Unknown address and wrong password answer the same.","x-openbrain-credential":"request body (provider ID token, one-time code or password)","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254},"password":{"type":"string","minLength":1,"maxLength":1024}},"required":["email","password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/email/reset":{"post":{"summary":"Email a password reset link (15 minutes) if the address has a password","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254}},"required":["email"]}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":false,"description":"Same response whether or not the address has an account"}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/email/reset/complete":{"post":{"summary":"Set a new password from a reset link token. Signs out every other session and starts a new one.","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"password":{"type":"string","minLength":1,"maxLength":1024}},"required":["token","password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/email/change":{"post":{"summary":"Change the account email (fresh session required). The new address gets a confirmation link; the old one is told.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254}},"required":["email"]}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":false,"description":"Same response whether or not the address has an account"}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/email/change/confirm":{"post":{"summary":"Confirm an email change from the link sent to the new address","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"changed":{"type":"boolean","const":true}},"required":["changed"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/password":{"post":{"summary":"Set or change the password of the account email (fresh session required; current is required when a password exists)","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"current":{"type":"string","minLength":1,"maxLength":1024},"password":{"type":"string","minLength":1,"maxLength":1024}},"required":["password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"changed":{"type":"boolean","const":true}},"required":["changed"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/magic-link":{"post":{"summary":"Email a single-use sign-in link (15 minutes). The token is in the URL fragment.","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254}},"required":["email"]}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":false,"description":"Same response whether or not the address has an account"}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/magic-link/verify":{"post":{"summary":"Spend a sign-in link token after the click. 201 when it created the account.","parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false},"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}},"required":["user","session"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/identities":{"get":{"summary":"List your sign-in methods (linked identities and passkeys), whether a password is set and whether the session is fresh","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"methods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["identity","passkey"]},"provider":{"type":"string","enum":["google","apple","whatsapp","email","passkey"]},"label":{"description":"The owner's address, a masked phone number, or null for passkeys","type":["string","null"]},"private_relay":{"type":"boolean","description":"Apple private relay address"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","provider","label","private_relay","created_at","last_used_at"],"additionalProperties":false}},"has_password":{"type":"boolean"},"fresh":{"type":"boolean"}},"required":["methods","has_password","fresh"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/identities/{id}":{"delete":{"summary":"Unlink a linked identity (fresh session required). The last remaining method cannot be removed.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/passkeys/{id}":{"delete":{"summary":"Remove a passkey (fresh session required). The last remaining method cannot be removed.","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/passkeys/add/options":{"post":{"summary":"Start adding a passkey to the signed-in account (fresh session required)","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"challenge":{"type":"string"}},"required":["challenge"],"additionalProperties":{},"description":"WebAuthn options for @simplewebauthn/browser"}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/passkeys/add/verify":{"post":{"summary":"Finish adding a passkey","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"rawId":{"type":"string"},"type":{"type":"string","const":"public-key"},"response":{"type":"object","properties":{},"additionalProperties":{}}},"required":["id","rawId","type","response"],"additionalProperties":{}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"added":{"type":"boolean","const":true}},"required":["added"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/reauth/passkey/options":{"post":{"summary":"Start a passkey reauthentication for this session (409 auth.noPasskey without one)","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"challenge":{"type":"string"}},"required":["challenge"],"additionalProperties":{},"description":"WebAuthn options for @simplewebauthn/browser"}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/reauth/passkey/verify":{"post":{"summary":"Finish the passkey reauthentication. Sensitive changes are allowed for 5 minutes.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"rawId":{"type":"string"},"type":{"type":"string","const":"public-key"},"response":{"type":"object","properties":{},"additionalProperties":{}}},"required":["id","rawId","type","response"],"additionalProperties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/reauth/password":{"post":{"summary":"Reauthenticate this session with the account password. Sensitive changes are allowed for 5 minutes.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"password":{"type":"string","minLength":1,"maxLength":1024}},"required":["password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reauthenticated":{"type":"boolean","const":true}},"required":["reauthenticated"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/sessions":{"get":{"summary":"List your active sessions, newest first, and which one is current","security":[{"openBrainSession":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"current":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","created_at","expires_at"],"additionalProperties":false}}},"required":["current","sessions"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/sessions/{id}":{"delete":{"summary":"Revoke one of your sessions","security":[{"openBrainSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string"}},{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/sessions/revoke-others":{"post":{"summary":"Sign out every other session of your account","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revoked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["revoked"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/token-exchange":{"post":{"summary":"Issue a 60-second, single-use EdDSA token for one configured Open Group audience","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"audience":{"type":"string","minLength":1,"maxLength":200}},"required":["audience"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"audience":{"type":"string"},"expires_in":{"type":"number","const":60}},"required":["token","token_type","audience","expires_in"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/token-exchange/redeem":{"post":{"summary":"Spend an exchange token as its audience. A second redemption fails.","x-openbrain-credential":"exchange token in the request body","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":4096},"audience":{"type":"string","minLength":1,"maxLength":200}},"required":["token","audience"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sub":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"aud":{"type":"string"},"jti":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["sub","aud","jti"],"additionalProperties":false}}}},"400":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/auth/jwks.json":{"get":{"summary":"Public Ed25519 key that signs exchange tokens","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"kty":{"type":"string","const":"OKP"},"crv":{"type":"string","const":"Ed25519"},"x":{"type":"string"},"kid":{"type":"string"},"alg":{"type":"string","const":"EdDSA"},"use":{"type":"string","const":"sig"}},"required":["kty","crv","x","kid","alg","use"],"additionalProperties":false}}},"required":["keys"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/account/delete":{"post":{"summary":"Erase an account that has no passkey (fresh session required). Accounts with a passkey use DELETE /api/v1/account.","security":[{"openBrainSession":[]}],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uri"}},{"name":"X-OpenBrain-Auth","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false}}}},"401":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/admin/identity":{"get":{"summary":"Operator view of sign-in readiness and identity counts (no secrets, emails or phone numbers). 404 without the admin token.","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^Bearer .+"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revision":{"type":"object","properties":{"sha":{"type":"string"},"built_at":{"type":["string","null"]}},"required":["sha","built_at"],"additionalProperties":false},"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"missing":{"type":"array","items":{"type":"string"}}},"required":["id","enabled","missing"],"additionalProperties":false}},"identities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Linked identity counts per provider; no addresses or subjects"}},"required":["revision","providers","identities"],"additionalProperties":false}}}},"404":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Error envelope","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message_key":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message_key"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}}},"components":{"securitySchemes":{"openBrainSession":{"type":"apiKey","in":"cookie","name":"__Host-openbrain-session"}}}}