API referenceInstance API
GUIDE & REFERENCE

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.

MethodPathOperation
GET/v1/kv/consistencyKv consistency
GET/v1/keyspacesList keyspaces
POST/v1/keyspacesCreate keyspace
GET/v1/keyspaces/:nameGet keyspace
DELETE/v1/keyspaces/:nameDelete keyspace
POST/v1/primitives/importImport domain primitives
POST/v1/primitives/exportExport domain primitives
POST/v1/:keyspacePut item
GET/v1/:keyspace/:idGet item
DELETE/v1/:keyspace/:idDelete item
POST/v1/:keyspace/queryQuery items
GET/v1/statsStats

GET /v1/kv/consistency

Kv consistency

AvailabilitySource contract
Registrationalways registered
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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.

report

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:3289. Registration: akasha-daemon/src/main.rs:4349.

GET /v1/keyspaces

List keyspaces

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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.

keyspaces

Errors 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

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

JsonCreateKeyspaceRequest

FieldRust typeRequired on inputNotes
nameStringYes
modelStringYes
dimsOption<usize>No; optional or defaulted
domainOption<String>No; optional or defaultedSerde: default
schema_versionOption<u32>No; optional or defaultedSerde: default
schemaOption<serde_json::Value>No; optional or defaultedSerde: default
strictOption<bool>No; optional or defaultedSerde: default
metadataOption<HashMap<String, serde_json::Value>>No; optional or defaultedSerde: default
descriptionOption<String>No; optional or defaultedSerde: 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

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

PathString

{
  "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.

ks

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:3970. Registration: akasha-daemon/src/main.rs:4609.

DELETE /v1/keyspaces/:name

Delete keyspace

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

PathString

{
  "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

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

JsonPrimitiveImportRequest

FieldRust typeRequired on inputNotes
keyspaceStringYes
recordsVec<serde_json::Value>Yes
schema_versionOption<u32>No; optional or defaulted
upsertboolNo; optional or defaultedSerde: 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.

summary

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:3999. Registration: akasha-daemon/src/main.rs:4613.

POST /v1/primitives/export

Export domain primitives

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

JsonPrimitiveExportRequest

FieldRust typeRequired on inputNotes
keyspaceStringYes
schema_versionOption<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.

bundle

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:4015. Registration: akasha-daemon/src/main.rs:4614.

POST /v1/:keyspace

Put item

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

PathString

{
  "type": "string"
}

JsonPutRequest

FieldRust typeRequired on inputNotes
dataserde_json::ValueYes
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

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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

PathString

{
  "type": "string"
}

JsonQueryRequest

FieldRust typeRequired on inputNotes
filterStringYes
limitOption<usize>No; optional or defaulted
offsetOption<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

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee 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.

s

Errors 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.

On this page