Skip to main content

Access current-project or related-project storage

POST 

/api/project-storage

context.storage.server.kv and context.storage.server.persistentValue share this HTTP endpoint, while storageKind keeps them in mandatory separate storage domains. Scope is only project or conversation. A current-project request supplies projectId, and entry.projectId must match it. A related-project request supplies only consumerProjectId and alias, fixes storageKind to kv, and must not put a target UUID in the entry. Server resolves the target from both projects' current projectInfo and checks its grant on every operation.

get requires read access to the consumer project; set, compare-and-set and delete require data write access to it. Related access does not require target-project membership. compare-and-set uses the revision returned by get and returns { applied: false } on a mismatch. delete removes one existing entry and returns { removed: boolean }; an absent entry returns { removed: false } rather than an error. knowledge-mutation is restricted to current-project persistent_value, also requires project data write access, and updates Knowledge indexes and bodies in one PostgreSQL transaction.

Request​

Responses​

get returns { exists, value?, revision? }; set returns { ok: true }; compare-and-set returns { applied, revision? }; knowledge-mutation returns a document or deletion result.