Caura / docs
API Reference

Keystones

GET / POST / DELETE /api/v1/keystones — mandatory governance rules.

Keystones are MANDATORY policy rules served to every agent on session start. See Concepts → Keystones for what they're for and how scope + weight + trust gating work.

List

Open (no trust gate). The plugin fetches this on every session boot.

GET
/api/v1/keystones

Authorization

APIKeyHeader
headerX-API-Key<token>

Query Parameters

tenant_id*Tenant Id
fleet_id?string|null
agent_id?|

Agent whose rules to merge in. Without fleet_id, the agent's home fleet is used.

envelope?Envelope

C30/D1 opt-in: return {count, items} instead of the bare array. The bare array stays the default until a separate announced deprecation wave.

Defaultfalse

Response Body

Successful Response

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://example.com/api/v1/keystones?tenant_id=string'
Example Response
[  {    "id": "string",    "tenant_id": "string",    "fleet_id": "string",    "collection": "string",    "doc_id": "string",    "data": {      "title": "string",      "content": "string",      "weight": 0,      "scope": "string",      "agent_id": "string",      "author_user_id": "string"    },    "created_at": "string",    "updated_at": "string"  }]

Upsert

Trust ≥ 1 for scope=agent targeting the caller's own agent_id; trust ≥ 2 otherwise.

POST
/api/v1/keystones

Authorization

APIKeyHeader
headerX-API-Key<token>

Header Parameters

X-Agent-ID?string|null

Request Body

application/json
  1. body

Payload shape mirrors the storage-api validator one-for-one so we don't need to re-do the scope/weight/fleet shape checks here — the storage 422 propagates through.

tenant_id?Tenant Id

Tenant to operate on. Omit it and the tenant is resolved from the credential, which is what a tenant- or agent-scoped key already identifies — no prior /whoami call is needed. Supply it to act on a different tenant your credential may read (and for an admin key, which belongs to no single tenant, it is required).

Default""
fleet_id?string|null
agent_id?string|null
doc_id*Doc Id
Match^[a-z0-9][a-z0-9._-]{0,99}$
title*Title
Length1 <= length <= 200
content*Content
Length1 <= length <= 2000
scope*Scope
Value in"tenant""fleet""agent"
weight*Weight
Value in"low""med""high"
author_user_id?string|null

Response Body

Successful Response

application/json
  1. response
id*Id
tenant_id*Tenant Id
fleet_id*|

Null for tenant-scope rules.

collection*Collection

Always "_keystones".

doc_id*Doc Id
data*
created_at*Created At
updated_at*Updated At
Example Request
curl -X POST 'https://example.com/api/v1/keystones' \  -H 'Content-Type: application/json' \  -d '{  "doc_id": "string",  "title": "string",  "content": "string",  "scope": "tenant",  "weight": "low"}'
Example Response
{  "id": "string",  "tenant_id": "string",  "fleet_id": "string",  "collection": "string",  "doc_id": "string",  "data": {    "title": "string",    "content": "string",    "weight": 0,    "scope": "string",    "agent_id": "string",    "author_user_id": "string"  },  "created_at": "string",  "updated_at": "string"}

Delete

Same dynamic trust gating as upsert. The platform fetches the stored row first to read its scope/agent_id before computing the required trust level.

DELETE
/api/v1/keystones/{doc_id}

Authorization

APIKeyHeader
headerX-API-Key<token>

Path Parameters

doc_id*Doc Id
Match^[a-z0-9][a-z0-9._-]{0,99}$

Query Parameters

tenant_id*Tenant Id

Header Parameters

X-Agent-ID?string|null

Response Body

Successful Response

application/json
  1. response
deleted*Deleted
doc_id*Doc Id
Example Request
curl -X DELETE 'https://example.com/api/v1/keystones/string?tenant_id=string'
Example Response
{  "deleted": true,  "doc_id": "string"}

On this page