Skip to content

API Reference

KSquad exposes two API surfaces:

  1. CRDs — the desired-state objects under ksquad.io/v1alpha1, reconciled by the operator.
  2. The apiserver REST/BFF APIs — the durable coordination record, memory, source-control mirror, dashboards, search, and auth/admin.

Auto-generated. The per-field CRD reference below is generated from the Go API types (the canonical source of truth). This page describes the structure of that reference and the stable object catalog; the field-level tables are produced by the docs build from the CRD OpenAPI schemas so they never drift from the code.

Each CRD’s reference page is generated from its Go type and lists every spec/status field, its type, whether it’s required, defaults, and validation. The object catalog:

KindScopePurposeConcept page
TeamNamespacedSquad = tenancy boundary (projects[], agents[], namespaceStrategy)Squads
AgentNamespacedOne agent (runtimeRef, roleRef, skillRefs[], credentialSecretRef, model, modelEndpointRef?, fallbackModel?, capabilityOverrides?)Agents
AgentRuntimeNamespacedCoding-agent flavor + CLI version policy (type, image, cliVersion, capabilities{docker,github,packageInstall})Agents
RoleNamespacedBehavior profile (promptRef, defaultSkills[], runtimeClassHint)Roles
SkillNamespacedGranted capability (source{inline|git}, mcpToolRefs[], permissions, requires{toolchains[],sidecars[]})Skills
ProjectNamespacedRepo + workspace (repo{url,ref,sync}, workspacePVC, egressPolicyRef, goals, contextBudget)Projects
RunNamespacedUnit of work — spec: teamRef, projectRef, workItemRef, inputs, sandboxPolicy, agents[], retryPolicy; status: phase, sandboxRef, claimedAt, conditions, artifactRefsRuns
OTelConfigNamespacedOTLP export config (per-signal exporters{traces,metrics,logs})Observability
  • metadata.annotations[ksquad.io/created-by] — set by the apiserver at create time to the originating user; immutable, so a CRD’s origin is always auditable.
  • Runs additionally carry metadata.annotations[ksquad.io/initiated-by] — the human who triggered the Run (or a system sentinel for auto-retry/scheduled Runs).
  • status.conditions and status.observedGeneration — every reconciled object reports these.

Work items, comments, claims, artifacts, memory records, and users/memberships are not CRDs — they are durable rows in Postgres behind the apiserver APIs. The Run CRD references a work item via workItemRef; it never embeds it. See The coordination record.

The apiserver exposes the durable record and platform operations. These are the surfaces the console (and your integrations) use:

AreaWhat it covers
CoordinationWork items, claims/leases, comments, artifacts, audit trail
Runs & SSERun control and the live progress stream (Server-Sent Events)
MemoryThe knowledge record (served via an MCP server + pgvector)
Source-control mirrorSynced issues, PRs, and check runs
Dashboards & searchPer-project dashboards, consumption metering, RBAC-scoped global search
Auth & adminLogin/session, users, per-project memberships, settings

The concrete endpoint paths, request/response schemas, and the OpenAPI/Swagger document are generated and published alongside this reference. Authentication uses the session tokens issued at login; all endpoints enforce the RBAC model server-side.

Domain events (Run lifecycle, work-item transitions, artifacts, memory writes, sync results, credential refresh) are published on a versioned event catalog and delivered to plugins over NATS. See the Plugin SDK → Event reference for the subject taxonomy and event schemas.

v1alpha1 signals that the API may evolve. Changes to the event catalog and CRD schemas follow a pinned-adapter discipline — additive or gated, never ambient breakage — so integrations that pin a schema revision survive platform evolution.