API referenceInstance API
GUIDE & REFERENCE

Namespaces Replication

Every registered namespaces replication instance operation, with source-derived inputs, outputs, access policy, and errors.

This reference covers 5 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/dataspacesDataspaces list
POST/v1/namespace/switchNamespace switch
POST/v1/replication/linksReplication create
POST/v1/replication/stopReplication stop
POST/v1/replication/statusReplication status

GET /v1/dataspaces

Dataspaces list

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.

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.

serde_json::to_value(list).unwrap_or(serde_json::json!([])),

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

POST /v1/namespace/switch

Namespace switch

AvailabilitySource contract
Registrationconfig.enable_kv
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesKV

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonNamespaceSwitchReq

FieldRust typeRequired on inputNotes
tenant_idStringYes
reservoir_idStringYes
agent_idStringYes
dataspace_idStringYes
struct NamespaceSwitchReq {
    tenant_id: String,
    reservoir_id: String,
    agent_id: String,
    dataspace_id: 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,
        "namespace": {
            "tenant_id": namespace.tenant_id.to_string(),
            "reservoir_id": namespace.reservoir_id.to_string(),
            "agent_id": namespace.agent_id.to_string(),
            "dataspace_id": namespace.dataspace_id.to_string(),
        }
    })

Errors and validation

Directly referenced error variants: Internal, InvalidRequest, Unauthorized. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:3484. Registration: akasha-daemon/src/main.rs:4585.

POST /v1/replication/links

Replication create

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.

Request

JsonReplicationCreateReq

FieldRust typeRequired on inputNotes
dest_data_dirStringYes
link_idOption<String>No; optional or defaulted
struct ReplicationCreateReq {
    dest_data_dir: String,
    link_id: 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!({"link_id": link_id.to_string()})

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

POST /v1/replication/stop

Replication stop

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.

Request

JsonReplicationIdReq

FieldRust typeRequired on inputNotes
idStringYes
struct ReplicationIdReq {
    id: 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!({"stopped": 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:3583. Registration: akasha-daemon/src/main.rs:4587.

POST /v1/replication/status

Replication status

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.

Request

JsonReplicationIdReq

FieldRust typeRequired on inputNotes
idStringYes
struct ReplicationIdReq {
    id: 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!({"running": running})

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

On this page