Key Value
Every registered key value instance operation, with source-derived inputs, outputs, access policy, and errors.
This reference covers 12 HTTP operations registered by the Akasha daemon. Call these paths on your instance base URL. See authentication, errors, and coverage before integrating.
| Method | Path | Operation |
|---|---|---|
GET | /v1/kv/consistency | Kv consistency |
GET | /v1/keyspaces | List keyspaces |
POST | /v1/keyspaces | Create keyspace |
GET | /v1/keyspaces/:name | Get keyspace |
DELETE | /v1/keyspaces/:name | Delete keyspace |
POST | /v1/primitives/import | Import domain primitives |
POST | /v1/primitives/export | Export domain primitives |
POST | /v1/:keyspace | Put item |
GET | /v1/:keyspace/:id | Get item |
DELETE | /v1/:keyspace/:id | Delete item |
POST | /v1/:keyspace/query | Query items |
GET | /v1/stats | Stats |
GET /v1/kv/consistency
Kv consistency
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
reportErrors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3289. Registration: akasha-daemon/src/main.rs:4349.
GET /v1/keyspaces
List keyspaces
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Read, None).
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
JSON field accesses in handler: name. Nested lookups are included; this list alone does not establish requiredness.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
keyspacesErrors and validation
Directly referenced error variants: Internal. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3947. Registration: akasha-daemon/src/main.rs:4608.
POST /v1/keyspaces
Create keyspace
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Admin, Some(&req.name)).
Request
Json — CreateKeyspaceRequest
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
name | String | Yes | |
model | String | Yes | |
dims | Option<usize> | No; optional or defaulted | |
domain | Option<String> | No; optional or defaulted | Serde: default |
schema_version | Option<u32> | No; optional or defaulted | Serde: default |
schema | Option<serde_json::Value> | No; optional or defaulted | Serde: default |
strict | Option<bool> | No; optional or defaulted | Serde: default |
metadata | Option<HashMap<String, serde_json::Value>> | No; optional or defaulted | Serde: default |
description | Option<String> | No; optional or defaulted | Serde: default |
struct CreateKeyspaceRequest {
name: String,
model: String,
dims: Option<usize>,
#[serde(default)]
domain: Option<String>,
#[serde(default)]
schema_version: Option<u32>,
#[serde(default)]
schema: Option<serde_json::Value>,
#[serde(default)]
strict: Option<bool>,
#[serde(default)]
metadata: Option<HashMap<String, serde_json::Value>>,
#[serde(default)]
description: Option<String>,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"ok":true})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Explicit status constants: CREATED.
Source: akasha-daemon/src/main.rs:3984. Registration: akasha-daemon/src/main.rs:4608.
GET /v1/keyspaces/:name
Get keyspace
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Read, Some(&name)).
Request
Path — String
{
"type": "string"
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
ksErrors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3970. Registration: akasha-daemon/src/main.rs:4609.
DELETE /v1/keyspaces/:name
Delete keyspace
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Admin, Some(&id)).
Request
Path — String
{
"type": "string"
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"ok":true})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:4031. Registration: akasha-daemon/src/main.rs:4609.
POST /v1/primitives/import
Import domain primitives
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Write, Some(&req.keyspace)).
Request
Json — PrimitiveImportRequest
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
keyspace | String | Yes | |
records | Vec<serde_json::Value> | Yes | |
schema_version | Option<u32> | No; optional or defaulted | |
upsert | bool | No; optional or defaulted | Serde: default |
struct PrimitiveImportRequest {
keyspace: String,
records: Vec<serde_json::Value>,
schema_version: Option<u32>,
#[serde(default)]
upsert: bool,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
summaryErrors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3999. Registration: akasha-daemon/src/main.rs:4613.
POST /v1/primitives/export
Export domain primitives
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Query, Some(&req.keyspace)).
Request
Json — PrimitiveExportRequest
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
keyspace | String | Yes | |
schema_version | Option<u32> | No; optional or defaulted |
struct PrimitiveExportRequest {
keyspace: String,
schema_version: Option<u32>,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
bundleErrors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:4015. Registration: akasha-daemon/src/main.rs:4614.
POST /v1/:keyspace
Put item
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Write, Some(&keyspace)).
Request
Path — String
{
"type": "string"
}Json — PutRequest
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
data | serde_json::Value | Yes |
struct PutRequest {
data: serde_json::Value,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"id": id})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Explicit status constants: CREATED.
Source: akasha-daemon/src/main.rs:4045. Registration: akasha-daemon/src/main.rs:4615.
GET /v1/:keyspace/:id
Get item
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Read, Some(&keyspace)).
Request
Path — (String, String)
{
"x-rust-type": "(String, String)",
"description": "Wire schema unresolved by the source extractor; no fields are invented."
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"data": item})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:4061. Registration: akasha-daemon/src/main.rs:4616.
DELETE /v1/:keyspace/:id
Delete item
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Delete, Some(&keyspace)).
Request
Path — (String, String)
{
"x-rust-type": "(String, String)",
"description": "Wire schema unresolved by the source extractor; no fields are invented."
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"deleted": deleted})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:4076. Registration: akasha-daemon/src/main.rs:4616.
POST /v1/:keyspace/query
Query items
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Query, Some(&keyspace)).
Request
Path — String
{
"type": "string"
}Json — QueryRequest
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
filter | String | Yes | |
limit | Option<usize> | No; optional or defaulted | |
offset | Option<usize> | No; optional or defaulted |
struct QueryRequest {
filter: String,
limit: Option<usize>,
offset: Option<usize>,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"rows": results})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:4091. Registration: akasha-daemon/src/main.rs:4617.
GET /v1/stats
Stats
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Read, None).
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
sErrors and validation
Directly referenced error variants: Internal. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:4120. Registration: akasha-daemon/src/main.rs:4618.