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
- 200
- 400
- 401
- 403
- 404
- 409
- 501
get returns { exists, value?, revision? }; set returns { ok: true }; compare-and-set returns { applied, revision? }; knowledge-mutation returns a document or deletion result.
The address, storageKind, scope, projectId binding, conversationId, key, value, expectedRevision, or knowledge-mutation input is invalid.
workflow-code standard error response.
The caller cannot read or run the consumer project, the related grant is insufficient, knowledge.manage is missing, or a project declaration forbids server storage.
A related project is unavailable or pending confirmation, or the document selected by knowledge-mutation does not exist.
The document ID created by knowledge-mutation already exists.
The server does not have PostgreSQL storage enabled.