{"openapi":"3.1.0","info":{"title":"innernet API","version":"2026-06-11","description":"Versioned, structured context for AI — over plain REST. Two resource families: **context** (projects → dimensions → captures: the versioned world-model innernet maintains) and **memories** (a flat, namespaced store for apps you build — scope rows to your own users, agents, and runs). Plus ranked full-text **search** across everything."},"servers":[{"url":"https://innernet.live/api"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (innernet_…) from https://innernet.live/developers, or an OAuth 2.1 access token. Keys carry read and/or write scopes."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"Project":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["product","code","brand","creative","org"]},"tagline":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"},"head":{"type":["string","null"],"description":"Current commit head of the context map"}}},"Memory":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"user_id":{"type":["string","null"],"description":"Your end-user namespace (not the innernet account)"},"agent_id":{"type":["string","null"]},"run_id":{"type":["string","null"]},"project_slug":{"type":["string","null"]},"content":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"SearchResult":{"type":"object","properties":{"kind":{"type":"string","enum":["dimension","node","capture","project","memory"]},"project_slug":{"type":["string","null"]},"ref":{"type":"string","description":"Dimension name, node id, commit hash, or memory id"},"title":{"type":"string"},"snippet":{"type":"string","description":"Highlighted match fragments (<b>…</b>)"},"rank":{"type":"number"},"updated_at":{"type":"string","format":"date-time"}}}}},"paths":{"/v1/projects":{"get":{"operationId":"listProjects","summary":"List projects","description":"All context maps owned by the caller, most recently updated first.","tags":["context"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}":{"get":{"operationId":"getProject","summary":"Load a context map","description":"The full map: manifest, every dimension (markdown), every node, recent commits, and the per-project capture protocol.","tags":["context"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"include_self","in":"query","schema":{"type":"boolean","default":false},"description":"Append a disclosure-gated slice of the account owner's Self Map (personal_context)"}],"responses":{"200":{"description":"The full context map"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/dimensions/{name}":{"get":{"operationId":"getDimension","summary":"Read a dimension","tags":["context"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Dimension name + markdown content"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"putDimension","summary":"Create or replace a dimension","description":"Replaces the dimension body and writes a commit to the project history.","tags":["context"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"Full markdown body"},"commit_message":{"type":"string"}}}}}},"responses":{"200":{"description":"Saved"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteDimension","summary":"Delete a dimension","description":"Removes the dimension and records the deletion in the commit log.","tags":["context"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/captures":{"post":{"operationId":"createCapture","summary":"Capture into a project","description":"Append a note/decision/insight to the project commit log. The background consolidator folds captures into dimensions on the next sync.","tags":["context"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Captured"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/memories":{"post":{"operationId":"addMemory","summary":"Add a memory","description":"Store a memory scoped to your application. Namespace it with user_id / agent_id / run_id to keep each of your end-users’ memories separate.","tags":["memories"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","maxLength":32000},"user_id":{"type":"string","description":"Your end-user id"},"agent_id":{"type":"string"},"run_id":{"type":"string"},"project":{"type":"string","description":"Optional innernet project slug to associate"},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"memory":{"$ref":"#/components/schemas/Memory"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listMemories","summary":"List memories","tags":["memories"],"parameters":[{"name":"user_id","in":"query","schema":{"type":"string"}},{"name":"agent_id","in":"query","schema":{"type":"string"}},{"name":"run_id","in":"query","schema":{"type":"string"}},{"name":"project","in":"query","schema":{"type":"string"}},{"name":"tag","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"memories":{"type":"array","items":{"$ref":"#/components/schemas/Memory"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/memories/{id}":{"get":{"operationId":"getMemory","summary":"Get a memory","tags":["memories"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateMemory","summary":"Update a memory","tags":["memories"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Updated"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteMemory","summary":"Delete a memory","tags":["memories"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/commits":{"get":{"operationId":"listCommits","summary":"List commits","description":"The project's append-only history, newest first — every save, capture, sync, and merge.","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"head + commits[] (hash, parent_hash, summary, trigger, committed_at)"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/commits/{hash}":{"get":{"operationId":"getCommit","summary":"Get a commit","description":"One commit with its full diff payload (capture content, merge diffs).","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"hash","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The commit"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/branches":{"get":{"operationId":"listBranches","summary":"List branches","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"branches[] (name, status, fork_from, overlay keys)"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createBranch","summary":"Fork a branch","description":"Fork the context map at its current head. The branch gets a full snapshot (overlay) of trunk dimensions + nodes; trunk stays untouched until merge.","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Branch name (slug-like)"},"summary":{"type":"string"}}}}}},"responses":{"201":{"description":"Created"},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/branches/{name}":{"get":{"operationId":"getBranch","summary":"Get a branch","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Branch metadata + overlay keys"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"parkBranch","summary":"Park / unpark a branch","description":"status \"parked\" archives without merging (overlay preserved); \"active\" revives.","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["parked","active"]}}}}}},"responses":{"200":{"description":"Updated"},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/branches/{name}/diff":{"get":{"operationId":"diffBranch","summary":"Diff branch vs trunk","description":"added / modified / removed / unchanged for dimensions and nodes.","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The diff"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/branches/{name}/merge":{"post":{"operationId":"mergeBranch","summary":"Merge a branch","description":"Apply the branch to trunk (branch wins; removed-in-branch deletes from trunk), record a merge commit, bump the head, mark the branch merged.","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Merged — returns the commit hash + applied diff"},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/branches/{name}/dimensions/{dim}":{"get":{"operationId":"getBranchDimension","summary":"Read a branch dimension","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"dim","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Markdown content from the overlay"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"putBranchDimension","summary":"Write a dimension into a branch","description":"Edits the branch overlay only — trunk is untouched until merge.","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"dim","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"Full markdown body"}}}}}},"responses":{"200":{"description":"Saved to overlay"},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteBranchDimension","summary":"Remove a dimension from a branch","description":"Merging afterwards deletes it from trunk.","tags":["versioning"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"dim","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removed from overlay"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/artifacts":{"get":{"operationId":"listArtifacts","summary":"List artifacts","description":"The project's live auto-maintained documents.","tags":["context"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"artifacts[]"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{slug}/artifacts/{id}":{"get":{"operationId":"getArtifact","summary":"Read an artifact","tags":["context"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Full document (markdown) + metadata"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/self/facts":{"get":{"operationId":"getSelfFacts","summary":"Read Self Map facts","description":"The account owner's Personal Memory, gated by disclosure ceiling. `private` never crosses the API regardless of the requested ceiling.","tags":["self"],"parameters":[{"name":"dimension","in":"query","schema":{"type":"string"}},{"name":"max_disclosure","in":"query","schema":{"type":"string","enum":["self","trusted","work","public"],"default":"trusted"}}],"responses":{"200":{"description":"facts[] (dimension, statement, disclosure, confidence)"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/self/capture":{"post":{"operationId":"selfCapture","summary":"Capture a Self candidate","description":"Queue a fact-candidate about the account owner; the consolidator distills it on next sync.","tags":["self"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string"},"dimension_hint":{"type":"string"},"project_context":{"type":"string"}}}}}},"responses":{"201":{"description":"Queued"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/self/status":{"get":{"operationId":"getSelfStatus","summary":"Self Map status","tags":["self"],"responses":{"200":{"description":"Counts by dimension and disclosure class"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/search":{"get":{"operationId":"search","summary":"Search everything","description":"Ranked full-text search across dimensions, nodes, captures, projects, and memories, with highlighted snippets.","tags":["search"],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"project","in":"query","schema":{"type":"string"},"description":"Limit to one project slug"},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}