Skip to content
Developer previewBack to Kernall
Browse documentation
DocumentationReference

Reference

HTTP API

The complete current HTTP surface for agents and project owners.

Conventions

Use your instance’s origin as the base URL. Send JSON bodies with Content-Type: application/json. Responses are JSON with Cache-Control: no-store. These are unversioned preview routes.

Agent means a project Bearer key. Owner means the signed-in owner; localhost supplies a development identity. Check and status routes support CORS preflight with OPTIONS returning 204. CORS does not make public exposure of a project key safe.

Endpoint index

Method and pathAuthPurpose
POST /api/checkAgentEvaluate and log an action
GET /api/confirmations/:id/statusAgentPoll a review
POST /api/projects/bootstrapOwnerCreate or load a project
POST /api/api-keys/rotateOwnerRevoke active keys and issue a new key
GET /api/policyOwnerRead policy
PATCH /api/policyOwnerReplace the complete policy
GET /api/logsOwnerQuery audit records
GET /api/confirmationsOwnerList reviews
GET /api/confirmations/:idOwnerRead a review and action metadata
POST /api/confirmations/:id/resolveOwnerApprove or deny one review

Check request and response

The check guide covers request fields, limits, and idempotency. Legacy body-based key authentication remains accepted by the check route; new clients should send the header.

Selected response fields
{
  "decision": "requires_human",
  "reason": "Action \"submit\" requires human confirmation for this project.",
  "confirmation_id": "<confirmation-id>",
  "confirmation_url": "http://localhost:3000/dashboard/confirmations/<confirmation-id>",
  "data_type_detected": null,
  "check_id": "<check-id>"
}
FieldMeaning
decisionapproved, denied, or requires_human.
reasonOptional explanation provided by a matching rule.
data_type_detectedOne category or null.
check_idAudit-record ID.
confirmation_id / confirmation_urlPresent for review checks. The current URL leads to the demo dashboard.
idempotent_replaytrue when an existing check was returned.
logid, timestamp, project_id, action_type, destination, task_context, data_type_detected, decision, and reason. No raw data.

Management shapes

The paths in this table are relative to /api. Success is HTTP 200 unless noted.

EndpointRequestResponse
POST /projects/bootstrapOptional {"name":"My project"}201 on creation or 200 on reload: project, policy, api_keys; raw api_key on creation only.
POST /api-keys/rotateNo body required.api_key and api_keys metadata.
GET /policyNo body.{ policy: { allowlistedDomains, flaggedTypes, requiresHumanActions } }
PATCH /policyAll three arrays.{ policy: updatedPolicy }
GET /logsdecision, from, to, before, limit.{ logs: [...], next_before: timestampOrNull }
GET /confirmationsstatus: pending/approved/denied. limit defaults to 100, maximum 200.{ confirmations: [...] }
GET /confirmations/:idThe confirmation ID, not the check ID.{ confirmation: { id, log_id, status, created_at, resolved_at, action_type, destination, task_context, data_type_detected, reason } }
POST /confirmations/:id/resolve{"decision":"approved"} or {"decision":"denied"}{ confirmation: resolvedRecord }
GET /confirmations/:id/statusAgent key, no body.{ confirmation_id, status, decision, resolved_at }

Errors and status codes

Error envelope
{
  "error": {
    "code": "invalid_request",
    "message": "Request body must be valid JSON."
  }
}
HTTP / error codeMeaningNext step
400 · invalid_requestInvalid JSON, wrong field type, unsupported filter/rule, or a limit violation.Correct the request before retrying.
401 · invalid_api_keyMissing, malformed, unknown, or revoked key.Use an active key for this instance.
401 · authentication_requiredOwner endpoint has no authenticated viewer.Use the owner session or local walkthrough.
404 · project_not_initializedOwner has no project.Bootstrap first.
404 · not_foundNo matching review in this project.Check the ID and project.
409 · already_resolvedThe opposite outcome is already recorded.Respect the existing resolution.
429 · rate_limit_exceededCheck quota exhausted.Wait Retry-After seconds; reuse the same action key.
500 · internal_errorThe operation failed on the server.Keep blocked; inspect logs and cautiously retry transient failures.

Hosting errors can have a different body, including an HTML sign-in page. Invalid JSON or an unexpected response is a failed check, not permission to proceed.

Limits and unsupported operations

Check quota: 120 new evaluations per project per minute. Character limits: action 64; data 20,000; destination 2,048; task context 1,000; idempotency key 200. See policy limits for configuration sizes.

No public run-execution, webhook, project-delete, log-delete, review-cancel, team-management, inference, or file-upload endpoint is implemented. Future versions may change this preview contract.