Skip to content
kimbap
Contents

API

Kimbap exposes a REST surface when running kimbap serve.

CLI remains the primary interface; the API is primarily for server-mode integrations.

Base path: /v1

Authentication and scopes

  • GET /v1/health, GET /v1/actions, and GET /v1/actions/{service}/{action} are public.
  • All other /v1/* endpoints require Authorization: Bearer <token>.
  • Access is scope-gated (for example: actions:execute, audit:read, tokens:write, webhooks:read).

Response envelope

All API responses use a common envelope:

  • success (boolean)
  • data (present on success responses)
  • error (present on error responses)
  • request_id (string)

data and error are omitted when empty (they are not serialized as null).

Success example

json
{
  "success": true,
  "data": {"status": "ok"},
  "request_id": "req_01..."
}

Error example

json
{
  "success": false,
  "error": {
    "code": "ERR_VALIDATION_FAILED",
    "message": "url is required",
    "retryable": false,
    "details": {}
  },
  "request_id": "req_01..."
}

CLI equivalents

API (/v1/...)CLI (kimbap ...)
/v1/actions/{svc}/{action}:executekimbap call <svc>.<action>
/v1/actions/validatekimbap call ... --help / local schema validation flows
/v1/approvalskimbap approve list
/v1/approvals/{id}:approvekimbap approve accept <id>
/v1/approvals/{id}:denykimbap approve deny <id> --reason ...
/v1/auditkimbap audit tail / kimbap audit export
/v1/policieskimbap policy set / kimbap policy get
/v1/policies:evaluatekimbap policy evaluation workflows
/v1/vaultkimbap vault list / kimbap vault set
/v1/tokenskimbap token ...
/v1/webhooksNo direct CLI equivalent (API-only in serve mode)

Endpoint index

Public endpoints

MethodPathDescription
GET/healthServer health/version
GET/actionsList actions (supports namespace, resource, verb, limit)
GET/actions/{service}/{action}Describe one action

Authenticated endpoints

MethodPathScopeDescription
POST/actions/{service}/{action}:executeactions:executeExecute action with input payload
POST/actions/validatetoken requiredValidate input against schema
GET/vaultvault:readList stored secret metadata
POST/tokenstokens:writeCreate API token
GET/tokenstokens:readList tokens
GET/tokens/{id}tokens:readInspect token metadata
DELETE/tokens/{id}tokens:writeRevoke token
GET/policiespolicies:readGet active policy document
PUT/policiespolicies:writeReplace active policy document
POST/policies:evaluatepolicies:readEvaluate hypothetical policy request
GET/approvalsapprovals:readList approvals (status filter supported)
POST/approvals/{id}:approveapprovals:writeApprove request
POST/approvals/{id}:denyapprovals:writeDeny request
GET/auditaudit:readQuery audit events (from, to, agent_name, service, action, status, limit, offset)
GET/audit/exportaudit:readExport audit events (`format=jsonlcsv`)
GET/webhookswebhooks:readList webhook subscriptions
POST/webhookswebhooks:writeCreate webhook subscription
DELETE/webhooks/{id}webhooks:writeDelete webhook subscription
GET/webhooks/eventswebhooks:readList webhook events (limit, capped at 1000)

Webhook endpoints

  • GET /v1/webhooks (scope: webhooks:read)
  • POST /v1/webhooks (scope: webhooks:write)
  • DELETE /v1/webhooks/{id} (scope: webhooks:write)
  • GET /v1/webhooks/events (scope: webhooks:read)

Webhook validation and constraints

  • Webhook URL must use https.
  • Private/loopback targets are rejected at registration time.
  • GET /v1/webhooks/events enforces a bounded limit (capped at 1000).

Common request payloads

Execute action

POST /v1/actions/{service}/{action}:execute

json
{
  "input": {
    "key": "value"
  }
}

Validate action input

POST /v1/actions/validate

json
{
  "schema": {
    "type": "object",
    "properties": {
      "title": {"type": "string"}
    }
  },
  "input": {
    "title": "hello"
  }
}

Create token

POST /v1/tokens

json
{
  "tenant_id": "tenant-a",
  "agent_name": "agent-a",
  "scopes": ["actions:execute", "audit:read"],
  "ttl_seconds": 3600
}

Create webhook

POST /v1/webhooks

json
{
  "url": "https://example.com/webhook",
  "secret": "optional-shared-secret",
  "events": ["approval.requested", "approval.denied"]
}

See cli-reference.md for full CLI command coverage.