[Unreleased] - 2024-02-13
Changed - API Spec Restructure
Complete rewrite of OpenAPI specifications to align with MVP requirements from the k0rdent API Spec Google Sheet. This represents a major restructuring of the API surface to match the enterprise platformβs MVP scope. All changes are based on the Google Sheet defining 48 unique endpoints across 11 API domains as the source of truth.Breaking Changes
- Path prefix: All paths migrated from singular
/v1/region/to plural/v1/regions/ - Arc API β Compute API: Restructured with focus on clusters, VMs, and SDN (14 endpoint groups)
- Atlas API β Infrastructure API: Restructured for bare-metal server lifecycle and inventory (8 endpoint groups)
- Auth API β Auth + IAM API: Consolidated authentication and identity/access management (10 endpoint groups)
- Organizations extracted: Org/project management moved from individual specs to dedicated
organizationsspec
API Domain Changes
Compute API (formerly Arc)
- 14 endpoint groups: clusters, VMs, networks, subnets, addresses, load balancers, peering, interconnects, firewalls
- All paths:
/v1/regions/{region}/compute/* - Removed: Organization/project paths (moved to organizations spec), storage endpoints, nested network sub-paths
- New endpoints:
/v1/regions/{region}/compute/vms- Virtual machine lifecycle/v1/regions/{region}/compute/subnets- Network IP mapping/v1/regions/{region}/compute/addresses- IPAM: IP address allocations/v1/regions/{region}/compute/loadbalancers- Network load balancing/v1/regions/{region}/compute/peering- Within-region routing/v1/regions/{region}/compute/interconnects- Region-to-region routing/v1/regions/{region}/compute/firewalls- Network policy/v1/regions/{region}/compute/clusters/{clusterId}/kubeconfigs- Kubeconfig issuance/v1/regions/{region}/compute/clusters/{clusterId}/nodes/{nodeId}/ssh- Node SSH access
Infrastructure API (formerly Atlas)
- 8 endpoint groups: servers CRUD, batch enrollment, batch/single actions, logs, profiles, switches
- All paths:
/v1/regions/{region}/infrastructure/* - Removed: Organization/project/quota paths, compute paths, storage paths
- New endpoints:
/v1/regions/{region}/infrastructure/servers/batch- Bulk server enrollment (POST with array)/v1/regions/{region}/infrastructure/servers/actions- Batch actions on multiple servers (POST with{action, ids})/v1/regions/{region}/infrastructure/servers/{id}/actions- Single server actions (provision, validate, state transitions)/v1/regions/{region}/infrastructure/servers/{id}/logs- Host provisioning & status logs/v1/regions/{region}/infrastructure/profiles- Profiles/Persona CRUD/v1/regions/{region}/infrastructure/switches- Network management
Auth + IAM API (formerly Auth)
- 10 endpoint groups: tokens, sessions, users, user profiles, roles, groups, policies, service accounts, API keys, identity providers
- All paths:
/v1/regions/global/auth/*and/v1/regions/global/iam/* - Removed: Old auth paths (me, signup, invitations, organizations, members)
- New endpoints:
/v1/regions/global/auth/tokens- OAuth2/OIDC token acquire/refresh/revoke/v1/regions/global/auth/sessions- Session login/logout, list active sessions, MFA/v1/regions/global/iam/users- Tenant user lifecycle/v1/regions/global/iam/users/profile- Self-service profile/v1/regions/global/iam/roles- Authorization/RBAC role definitions/v1/regions/global/iam/groups- Group management (SSO-driven, IAM policy bindings)/v1/regions/global/iam/policies- Role bindings at org/project/resource level/v1/regions/global/iam/service-accounts- Machine identity for automation/v1/regions/global/iam/apikeys- API key lifecycle management/v1/regions/global/iam/providers- Identity provider configuration (SSO)
Organizations API (new)
- 6 endpoint groups: organizations CRUD, org invitations, org quotas, folders (stub), projects, project quotas
- All paths:
/v1/regions/global/organizations/*and/v1/regions/global/projects/* - New spec consolidating org/project management previously scattered across arc, atlas, auth
- Key decision: Projects are top-level at
/v1/regions/global/projects(org context from auth token, not URL nesting) - Endpoints:
/v1/regions/global/organizations- Organization CRUD/v1/regions/global/organizations/{orgId}/invitations- Organization invitations/v1/regions/global/organizations/quotas- Customer org quota management/v1/regions/global/organizations/folders- Folder management (stub β hierarchy TBD)/v1/regions/global/projects- Top-level project management/v1/regions/global/projects/quotas- Project quota management
Webhooks API (new)
- 3 endpoint groups: webhooks, subscriptions, delivery history
- All paths:
/v1/regions/global/webhooks/* - Endpoints:
/v1/regions/global/webhooks- Webhook management/v1/regions/global/webhooks/subscriptions- Webhook subscriptions/v1/regions/global/webhooks/subscriptions/{id}/deliveries- Delivery history
Workflows API (new, internal-only)
- 4 endpoint groups: workflow definitions, workflow runs, run logs, metrics
- All paths:
/v1/regions/global/workflows/* - Marked as internal-only β for platform orchestration, not public API
- Endpoints:
/v1/regions/global/workflows- Workflow definitions/orchestration/v1/regions/global/workflows/{id}/runs- Workflow execution instances/v1/regions/global/workflows/{id}/runs/{runId}/logs- Workflow run logs/v1/regions/global/workflows/metrics- Aggregate performance stats
Observability API (new, stub)
- 1 endpoint: stub for future analytics & observability
- Path:
/v1/regions/global/observability
Audit API (simplified)
- Path changed from
/v1/region/{region}/audit/eventsto/v1/regions/global/audit - Single collection endpoint per spreadsheet spec
Billing API (simplified)
- Path changed from
/v1/region/global/billing/accounts/...to/v1/regions/global/projects/billing - Single endpoint per spreadsheet spec
Regions API (renamed)
- Path changed from
/v1/region/global/regionsto/v1/regions/global/locations
Notifications API (prefix update)
- Prefix updated from
/v1/region/global/to/v1/regions/global/ - Existing endpoint structure preserved
Schema Changes
Common Schemas (added)
Quota- Resource quota configuration with enforcement policies (hard/soft)Folder- Project organization hierarchy (stub β full design TBD)
Compute Schemas (new)
VM- Virtual machine definitionSubnet- Network subnet configurationAddress- IPAM IP address allocationLoadBalancer- Load balancer configurationPeeringConnection- Within-region network routingInterconnect- Region-to-region network routingFirewall- Network policy rules
Infrastructure Schemas (new)
Profile- Server profile/persona definitionSwitch- Network switch managementServerAction- Action enum: provision, validate, start, stop, restart, decommission
Auth + IAM Schemas (new)
Token- OAuth2/OIDC tokenSession- User sessionUser- Tenant userRole- RBAC role definitionGroup- User groupPolicy- IAM policy (role bindings)ServiceAccount- Machine identityApiKey- API key credentialIdentityProvider- SSO provider configuration
Organizations Schemas
Organization,Project,Member,Invitation- Moved to organizations spec (previously scattered)Folder- Stub for project hierarchyQuota- Resource quota (shared schema)
Key Design Decisions
- Path naming: Plural
/v1/regions/per Google Sheet (singular was incorrect) - Project URLs: Flat top-level
/v1/regions/global/projects(org context from auth token, not URL nesting) β cleaner, less cluttered - IAM consolidation: IAM endpoints folded into auth spec (single identity domain)
- Workflows visibility: Internal-only (still documented for platform developers)
- Instance types: Dropped for MVP (not in spreadsheet)
- Infrastructure actions: Both single (
/servers/{id}/actions) and batch (/servers/actions) endpoints for flexibility - Batch enrollment: Dedicated
/servers/batchendpoint (POST array of servers) - Folders: Stub only (GCP-style hierarchy design TBD)
- VMs vs Instances: Use
/compute/vmsterminology (not/compute/instances)
Files Changed
Source specs edited (7):content/docs/api-docs/src/arc.base.json- Rewritten as Compute APIcontent/docs/api-docs/src/atlas.base.json- Rewritten as Infrastructure APIcontent/docs/api-docs/src/auth.base.json- Rewritten as Auth + IAM APIcontent/docs/api-docs/src/audit.base.json- Simplified to single endpointcontent/docs/api-docs/src/billing.base.json- Simplified to single endpointcontent/docs/api-docs/src/regions.base.json- Path renamed to /locationscontent/docs/api-docs/src/notifications.base.json- Prefix updated
content/docs/api-docs/src/organizations.base.json- New Organizations APIcontent/docs/api-docs/src/webhooks.base.json- New Webhooks APIcontent/docs/api-docs/src/workflows.base.json- New Workflows API (internal)content/docs/api-docs/src/observability.base.json- New Observability stub
content/docs/api-docs/common/schemas.json- Added Quota and Folder schemas
- All corresponding
*.jsonfiles incontent/docs/api-docs/anddocs/api-docs/ - Auto-generated MDX documentation in
content/docs/(generated)/
Statistics
- 38 files changed: +16,571 insertions, -77,336 deletions (net -60,765 lines)
- 11 API specs: arc, atlas, auth, audit, billing, notifications, observability, organizations, regions, webhooks, workflows
- 48 unique endpoints from Google Sheet MVP requirements
- 100+ MDX pages generated via fumadocs-openapi
Build Pipeline
Migration Notes
BetterAuth Migration Strategy
Current state: BetterAuth (better-auth.json) handles 48+ endpoints for social auth, sessions, org management, email verification, password reset. The new auth.base.json represents the target API surface β a clean, enterprise-grade abstraction.
Recommended approach: 4-Phase Hybrid Adapter
-
Phase 1 (Month 1): Adapter Facade
- Proxy layer wraps BetterAuth endpoints into standardized
{success, data, meta}envelope - New clients use
/v1/regions/global/auth/*and/v1/regions/global/iam/* - Existing BetterAuth clients continue unchanged
- Why: Zero disruption, standardizes API now
- Proxy layer wraps BetterAuth endpoints into standardized
-
Phase 2 (Months 2-3): Core Auth Service
- Build native session management (stateless JWT, not BetterAuth tokens)
- Implement user registration + email verification
- Migrate sessions to JWT at token refresh (90-day forced rotation)
- Why: JWT is portable; BetterAuth session tokens are not
-
Phase 3 (Months 4-6): Organization & RBAC
- Build org CRUD, member management, RBAC independently
- Dual-write: both BetterAuth and new service (validate consistency)
- Gradual client migration with feature flags
- Why: Owning org/RBAC prevents vendor lock-in
-
Phase 4 (Months 7-12): Full Migration
- Retire BetterAuth endpoints
- Remove adapter layer
- Single auth backend
- Why: Eliminates dependency, reduces attack surface
- Standardize on JWT now (not BetterAuth tokens)
- Abstract OAuth/SSO provider config in portable format
- Codify RBAC independently of BetterAuth internals
- API contract versioning: OpenAPI spec IS the contract
- Keep
better-auth.jsonas reference until fully migrated
Verification
- β
pnpm bundle-openapi- 11 specs bundled successfully - β
pnpm generate-docs- 100+ MDX pages generated - β
pnpm build- Site builds successfully (209+ pages) - β
Path prefix verification - Zero singular
/v1/region/paths remain - β Spreadsheet coverage - All 48 MVP endpoints mapped
References
- Source of Truth: k0rdent API Spec Google Sheet
- Implementation Plan:
.claude/plans/velvety-doodling-willow.md
Removed
better-auth.json- Moved todocs/hidden/better-auth.jsonas reference during migration