Documentation/Reference
Reference · v0.0.1

API & automation

Automate ClusterPilot with scoped machine identities, idempotent writes, stable errors, and durable OperationRuns.

AudienceIntegration engineers, platform developersReading time16 minCommands in context6 guided stepsReviewed sourcefcc5871 · 30 July 2026
RC

Exact release scope. This page documents the reviewed v0.0.1 source at fcc5871. Check release status before enabling a gated capability.

Headless contract principles

  • Use a service_principal and scoped API key for machine calls; do not automate with a copied browser session.
  • Send and retain an idempotency key for write endpoints that require one.
  • Treat HTTP status plus ProblemDetails error_code and extensions as the diagnostic contract.
  • Use returned resource/run IDs and correlation IDs; never infer success from a closed connection.
  • Poll or stream bounded read endpoints and handle rate limits, cursor gaps, expiry, and terminal states.
  • Feature availability and authorization are independent; callers must handle disabled/gated capabilities.

Authentication and request envelope

Illustrative request
curl --request POST \
  --url https://clusterpilot.example.com/api/v1/clusters/<cluster-id>/conformance/runs \
  --header "Authorization: Bearer $CLUSTERPILOT_API_KEY" \
  --header "Idempotency-Key: 7ea97a3e-<unique-request-id>" \
  --header "Content-Type: application/json" \
  --data '{"mode":"quick"}'

Inject the API key from the caller’s secret manager. Do not paste a real key into shell history, CI logs, example files, or tickets. Confirm the exact request/response schema in the OpenAPI document shipped by your release.

Endpoint families

FamilyRepresentative operations
/api/v1/providersProvider account CRUD, validation, rotation/reset, SSH keys, provider-specific discovery.
/api/v1/clustersList/detail, quotas, ingress/HA, nodes, infrastructure, create, scale, upgrade, replace, delete, inventory purge.
/api/v1/clusters/{id}/addonsCatalog, plans, DNS/preflight, install, installed state, Harbor promotion; upgrade/uninstall remain gated stubs.
/api/v1/clusters/{id}/custom-addonsList/create/update, bundle upload, validate, promote, install.
/api/v1/clusters/{id}/conformanceAdmission preview, start/list, result, artifact download/raw, purge, cancel, retry.
/api/v1/runsList/detail, cancel, retry, events/logs/commands, plan diff/export, artifacts.
/api/v1/agentHeartbeat, active fleet, compatible work polling, ordered execution ingest.
/api/v1/adminBuild, agents, users/teams/roles, configuration, diagnostics and protected administration.

ProblemDetails and error codes

Illustrative failure
{
  "type": "https://clusterpilot.example/errors/runs-retry-conflict",
  "title": "Retry conflicts with active work",
  "status": 409,
  "error_code": "RUNS_RETRY_CONFLICT",
  "nextAction": "wait_for_active_run",
  "correlationId": "c-...",
  "runId": "r-..."
}
HTTPTypical interpretation
400Schema/input invalid; correct the request.
401 / 403Identity invalid or scope/role insufficient; do not retry unchanged.
404Resource absent or not visible in the caller scope.
409State, revision, idempotency, active-run, or compatibility conflict.
412 / 422Admission, policy, compatibility, or semantic validation blocked the request.
429Caller/platform/provider limit; honor retry guidance and reduce concurrency.
5xxDependency or internal failure; preserve correlation ID and determine replay safety.

Idempotency and polling

Reuse an idempotency key only for the identical semantic request. A payload mismatch must fail instead of creating ambiguous work. After a timeout, query by the returned resource/run ID or retry the identical request with the same key before generating a new key.

Versioning and compatibility

The path is versioned as /api/v1, while run and agent contracts have their own negotiated versions. Clients should ignore additive unknown response fields, preserve stable codes, and test against the target release’s OpenAPI and compatibility manifest before rollout.