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 and compare-and-set require run 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. knowledge-mutation is restricted to current-project persistent_value, also requires knowledge.manage, 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.