{"openapi":"3.1.0","info":{"title":"AppSynergy","description":"AppSynergy control plane API.","license":{"name":"Apache-2.0","identifier":"Apache-2.0"},"version":"1.0.0"},"servers":[{"url":"/api/v1","description":"v1 (current)"}],"paths":{"/agents/heartbeat":{"post":{"summary":"Unified fleet heartbeat: liveness + per-capability telemetry + fingerprints. Admits joined and paused agents; flags server-side fingerprint drift.","operationId":"agents_heartbeat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentHeartbeatRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentHeartbeatResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/agents/join":{"post":{"summary":"Trade a one-time JT_ join token for a fleet-agent bearer; the agt_ plaintext is returned exactly once and only its hash is stored. Anonymous; single-use enforced.","operationId":"agents_join","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentJoinRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentJoinResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/agents/me":{"get":{"summary":"Fleet agent reads its own record (status, operator-set expected_version) plus the per-capability resource ids it owns. Joined agents only; self-scoped to the bearer.","operationId":"agents_me","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/agents/me/binary":{"get":{"summary":"Fleet agent resolves its operator-pinned self-update artifact URL (+ cosign signature) for a requested arch. Joined agents only; self-scoped to the bearer; downgrade-prevented (only the operator-pinned expected_version, only if allowlisted).","operationId":"agents_binary","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentBinaryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/agents/me/config":{"get":{"summary":"Fleet agent polls its operating config (operator-set expected_version + per-capability config block); content-derived ETag + ?wait long-poll. Joined agents only; self-scoped to the bearer.","operationId":"agents_config","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentConfigResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/agents/me/image":{"get":{"summary":"Fleet agent resolves its operator-pinned OS-image artifact metadata (sha256, size, url + cosign signature url) for a requested arch. Joined agents only; self-scoped to the bearer; downgrade-prevented (only the operator-pinned expected_image_version, only from the agent's channel, only if catalogued).","operationId":"agents_image","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentImageResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}},"post":{"summary":"Fleet agent reports its running OS-image version and boot-slot state; the control plane records both and the derived image-pending state clears once the running image reaches the operator-pinned expected_image_version. Joined agents only; self-scoped to the bearer.","operationId":"agents_image_report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentImageReportRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentImageReportResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/agents/me/pets":{"get":{"summary":"Fleet agent fetches its operator-declared desired pet set (name, image, desired state), absent removal tombstones included for tuple-matched removal. Joined agents only; self-scoped to the bearer.","operationId":"agents_pets","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetsPollResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}},"post":{"summary":"Fleet agent reports observed pet states, tuple-confirmed removals (which hard-delete their absent tombstones), and undeclared-container drift. Joined agents only; self-scoped to the bearer.","operationId":"agents_pets_report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetsReportRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetsReportResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/agents/me/version":{"post":{"summary":"Fleet agent reports its post-self-update reported_version; the control plane records it and the derived update-pending state clears once it reaches the operator-pinned expected_version. Joined agents only; self-scoped to the bearer.","operationId":"agents_version","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/agents/ws":{"get":{"summary":"Upgrade to the live operator-dashboard WebSocket. The control plane pushes pending_added / config_changed / pause / unpause / drain / force_resync / rotate_key events; the agent acks each by event_id. Opportunistic — the HTTP long-poll on /router/bindings/pending is the disconnect fallback. Joined agents only; self-scoped to the bearer.","operationId":"agents_ws","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentWsServerFrame"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/analytics/beat":{"post":{"summary":"Heartbeat upsert for an analytics_sessions row (semi-public; OptionalJWT).","operationId":"beat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsBeatRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsBeatResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/analytics/record":{"post":{"summary":"Record one analytics event (semi-public; OptionalJWT).","operationId":"record","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsRecordRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsRecordResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/analytics/session/close":{"post":{"summary":"Close an analytics_sessions row (semi-public; OptionalJWT; idempotent).","operationId":"session_close","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSessionCloseRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSessionCloseResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/auth/2fa/challenge":{"post":{"summary":"Complete a TOTP-gated login with a 6-digit code; mints the session.","operationId":"totp_challenge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpChallengeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/2fa/disable":{"post":{"summary":"Turn off authenticator-app codes. Needs a re-authenticated session (POST /auth/me/elevation, purpose account); otherwise 403 reauth_required.","operationId":"totp_disable","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpDisableResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/2fa/enroll":{"post":{"summary":"Generate a pending TOTP enrollment (otpauth URI + base32 secret). Needs a re-authenticated session (POST /auth/me/elevation, purpose account); otherwise 403 reauth_required.","operationId":"totp_enroll","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpEnrollResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/2fa/recovery":{"post":{"summary":"Complete a TOTP-gated login with a single-use backup code; consumes the code and mints the session.","operationId":"recovery_login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryLoginRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/2fa/recovery-codes":{"get":{"summary":"Report the caller's backup-code counts (total + remaining); never returns the codes.","operationId":"recovery_codes_status","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodesStatusResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Generate a fresh set of single-use 2FA backup codes (replaces any prior set); the plaintext is returned exactly once. Needs a re-authenticated session (POST /auth/me/elevation, purpose account); otherwise 403 reauth_required.","operationId":"recovery_codes_generate","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodesGenerateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/2fa/verify-enrollment":{"post":{"summary":"Confirm a pending TOTP enrollment with the first authenticator code.","operationId":"totp_verify_enrollment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpVerifyEnrollmentRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpVerifyEnrollmentResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/account/restore":{"post":{"summary":"Restore a deleted account in its grace period with the link from the closing or reminder email. 410 restore_link_invalid for an unknown, used or expired link.","operationId":"account_restore","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRestoreRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRestoreResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/billing-email/confirm":{"post":{"summary":"Confirm an organization's billing email with the one-time link mailed to it.","operationId":"billing_email_confirm","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingEmailConfirm"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingEmailConfirmed"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/challenge":{"post":{"summary":"Issue a single-use human-check challenge for logging in by email.","operationId":"challenge_issue","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChallengeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChallengeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/device-link/start":{"post":{"summary":"Mint a short-lived device-link code (W-42 first-device-connect wizard). User-authenticated. The user types the returned 8-char code into the CLI/app, which redeems it via POST /auth/device-link/verify. Single-use, 5-minute TTL, per-IP rate-limited.","operationId":"device_link_start","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLinkStartRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLinkStartResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/device-link/verify":{"post":{"summary":"Redeem a device-link code minted by POST /auth/device-link/start (W-42). Anonymous; the code body field is the credential. Returns 200 + cdv_ bearer (once) + new client_devices.id, or invalid_code / expired_code / forbidden / device_name_taken. Per-IP rate-limited.","operationId":"device_link_verify","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLinkVerifyRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLinkVerifyResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/exchange_nonce_for_code":{"post":{"summary":"Get a verification code for a login link opened in a browser that did not ask for it. Logs nobody in.","operationId":"exchange_nonce_for_code","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeNonceForCodeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeNonceForCodeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/logout":{"post":{"summary":"Revoke the caller's current JWT-bound session and clear the session cookie.","operationId":"logout","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/me":{"get":{"summary":"Read the caller's own user profile.","operationId":"me_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete the caller's account: it closes now (subscriptions cancelled with a prorated refund, teams handed over) and is erased 30 days later unless restored. Needs a re-authentication in the last 10 minutes (POST /auth/me/elevation, purpose delete_account); otherwise 403 recent_reauth_required.","operationId":"me_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update the caller's display name and / or library avatar.","operationId":"me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserProfileRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/me/activation-dismiss":{"post":{"summary":"Mark the caller's activation checklist dismissed so the dashboard stops surfacing it.","operationId":"me_activation_dismiss","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationDismissResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/me/active-org":{"post":{"summary":"Switch the caller's active org (workspace switcher).","operationId":"me_active_org_set","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetActiveOrgRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/me/closure":{"get":{"summary":"What deleting the caller's own account would do: subscriptions cancelled (with the refund due), resources deleted, teams left, handed over or dissolved, the grace period, and anything to settle first.","operationId":"me_closure_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionImpact"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/auth/me/elevation":{"get":{"summary":"Whether the caller's session is elevated (sudo mode), until when, and which purposes it satisfies.","operationId":"me_elevation_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElevationStatus"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Ask to re-authenticate for a purpose (staff, account, delete_account). The next sign-in on the sign-in pages within 15 minutes that proves enough elevates its session for an hour. Returns the ways the sign-in page offers.","operationId":"me_elevation_request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElevationRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOutcome"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"delete":{"summary":"End the caller's elevated session (sudo mode) now.","operationId":"me_elevation_end","parameters":[{"name":"pending_only","in":"query","description":"Only discard the pending sign-in challenge.","required":false,"schema":{"type":["boolean","null"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElevationEndResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/me/oauth/device/approve":{"post":{"summary":"User approves a pending OAuth device-flow user_code (RFC 8628 §3.3). Marks the oauth_device_codes row as approved + pins the calling user's default org. The bearer is delivered to the *device* by the future POST /oauth/device/token poll endpoint, never to the user.","operationId":"oauth_device_approve","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OauthDeviceApproveRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OauthDeviceApproveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/me/orgs":{"get":{"summary":"List the orgs the caller belongs to (workspace switcher).","operationId":"me_orgs_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyOrgsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/auth/notifications":{"get":{"summary":"List the caller's own notifications (cursor-paginated).","operationId":"list_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/auth/notifications/preferences":{"get":{"summary":"Read the caller's effective notification-preference matrix.","operationId":"prefs_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferencesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Merge the caller's notification-preference changes.","operationId":"prefs_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationPreferencesRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferencesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/notifications/read-all":{"post":{"summary":"Mark all of the caller's notifications read.","operationId":"mark_all_read","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationUnreadResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/notifications/{id}/read":{"post":{"summary":"Mark one of the caller's own notifications read.","operationId":"mark_read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationUnreadResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/oauth/device/code":{"post":{"summary":"Initiate OAuth 2.0 Device Authorization Grant (RFC 8628). Anonymous. Mints a device_code (returned once) + user_code (entered by the user on the dashboard verification page) and creates a pending oauth_device_codes row. The device then polls POST /oauth/device/token until the user approves on the dashboard.","operationId":"oauth_device_start","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OauthDeviceStartRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OauthDeviceStartResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/oauth/device/token":{"post":{"summary":"Device polls for an approved OAuth device-flow code (RFC 8628 §3.4). Anonymous; the device_code body field is the credential. Returns 200 + cdv_ bearer (once) + new client_devices.id when the user has approved, otherwise an RFC-style polling error: authorization_pending, access_denied, expired_token, or invalid_grant.","operationId":"oauth_device_token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OauthDeviceTokenRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OauthDeviceTokenResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/passkey/credentials":{"get":{"summary":"List the caller's registered passkey credentials.","operationId":"passkey_credentials_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyCredentialListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/auth/passkey/credentials/{id}":{"delete":{"summary":"Delete one of the caller's own passkey credentials.","operationId":"passkey_credential_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyCredentialDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Rename one of the caller's own passkey credentials.","operationId":"passkey_credential_rename","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyCredentialRenameRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyCredentialSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/passkey/login/begin":{"post":{"summary":"Open a WebAuthn authentication session for the supplied email.","operationId":"passkey_login_begin","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyLoginBeginRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyLoginBeginResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/passkey/login/complete":{"post":{"summary":"Close a WebAuthn authentication session, mint a JWT v2, and set the auth_token cookie.","operationId":"passkey_login_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyLoginCompleteRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyLoginCompleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/passkey/passwordless/begin":{"post":{"summary":"Open a discoverable WebAuthn authentication session (no email).","operationId":"passkey_passwordless_begin","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyPasswordlessBeginResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/passkey/passwordless/complete":{"post":{"summary":"Close a discoverable WebAuthn authentication session and mint a JWT v2.","operationId":"passkey_passwordless_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyPasswordlessCompleteRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyPasswordlessCompleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/passkey/register/begin":{"post":{"summary":"Open a WebAuthn registration session for the caller. Needs a re-authenticated session (POST /auth/me/elevation, purpose account); otherwise 403 reauth_required.","operationId":"passkey_register_begin","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyRegisterBeginResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/passkey/register/complete":{"post":{"summary":"Close a WebAuthn registration session and persist the credential.","operationId":"passkey_register_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyRegisterCompleteRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyRegisterCompleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/passkey/settings":{"get":{"summary":"Read the caller's passkey-enabled / enforce-passkey settings.","operationId":"passkey_settings_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeySettings"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Toggle the caller's enforce_passkey setting. Turning it on needs a re-authenticated session (POST /auth/me/elevation, purpose account); otherwise 403 reauth_required.","operationId":"passkey_settings_update","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeySettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeySettings"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/send_magic_link":{"post":{"summary":"Mail a login link to the address. Signing up and logging in are the same request.","operationId":"send_magic_link","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMagicLinkRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMagicLinkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/sessions":{"get":{"summary":"List the caller's currently-valid session rows.","operationId":"sessions_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/auth/sessions/terminate-all":{"post":{"summary":"Revoke every one of the caller's sessions and deny-list each JWT.","operationId":"sessions_terminate_all","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionsTerminateAllResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/sessions/{id}":{"delete":{"summary":"Revoke one of the caller's own sessions; deny-list its JWT.","operationId":"sessions_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionRevokeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/auth/sso/{org_slug}/callback":{"get":{"summary":"Verify the IdP's OIDC callback, mint a JWT, and set the session cookie.","operationId":"sso_callback","parameters":[{"name":"org_slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoCallbackResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/sso/{org_slug}/redirect":{"get":{"summary":"Begin the OIDC authorization-code flow for the configured provider on an org.","operationId":"sso_redirect","parameters":[{"name":"org_slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoRedirectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/sso/{org_slug}/saml/callback":{"post":{"summary":"Verify the IdP's signed SAML2 assertion, mint a JWT, and set the session cookie.","operationId":"sso_saml_callback","parameters":[{"name":"org_slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/SamlCallbackForm"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoSamlCallbackResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/sso/{org_slug}/saml/redirect":{"get":{"summary":"Begin the SAML2 HTTP-Redirect-binding flow for the configured provider on an org.","operationId":"sso_saml_redirect","parameters":[{"name":"org_slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoSamlRedirectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/auth/verify_magic_link":{"post":{"summary":"Log in with the login link (method nonce) in the browser that asked for it, or with the verification code (method code) shown on another device.","operationId":"verify_magic_link","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyMagicLinkRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyMagicLinkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/billing/addons/{subscription_addon_id}":{"delete":{"summary":"Cancel an addon at period end (preserves expires_at).","operationId":"addons_self_cancel","parameters":[{"name":"subscription_addon_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/card":{"get":{"summary":"The organization's card on file, and whether a valid one is needed.","operationId":"card_status","parameters":[{"name":"org_id","in":"query","description":"The organization. Defaults to the caller's personal org.","required":false,"schema":{"type":["string","null"],"format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardStatusRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/checkout/crypto":{"post":{"summary":"Quote a paid plan in BTC/ETH/LTC and return the wallet address + payment URI.","operationId":"checkout_crypto","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoCheckoutRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoPaymentRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/checkout/stripe":{"post":{"summary":"Mint a Stripe-hosted checkout session for a paid plan.","operationId":"checkout_stripe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeCheckoutRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeCheckoutRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/crypto/payments":{"get":{"summary":"List crypto payments for the caller's orgs.","operationId":"crypto_payments_self_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoPaymentListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/crypto/payments/{crypto_payment_id}":{"get":{"summary":"Read a single crypto payment by id.","operationId":"crypto_payments_self_get","parameters":[{"name":"crypto_payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoPaymentRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/crypto/payments/{crypto_payment_id}/check":{"post":{"summary":"Manually re-verify a crypto payment; transitions past-expiry pending rows.","operationId":"crypto_payments_self_check","parameters":[{"name":"crypto_payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoPaymentRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/crypto/rates":{"get":{"summary":"List supported crypto-currency exchange rates.","operationId":"crypto_rates_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoRateListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/billing/invoices/{invoice_id}":{"get":{"summary":"Read one invoice: Stripe's with links to its hosted page and PDF, internal ones with their lines.","operationId":"invoices_self_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/invoices/{invoice_id}/pdf":{"get":{"summary":"Download a platform invoice as PDF (card invoices: use Stripe's PDF link).","operationId":"invoice_pdf","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/orgs/{org_id}/details":{"get":{"summary":"Read the org's billing details (the buyer on its invoices).","operationId":"org_billing_details_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgBillingDetailsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"put":{"summary":"Save the org's billing details; pushed to its Stripe customer when it has one.","operationId":"org_billing_details_put","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgBillingDetails"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgBillingDetailsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/orgs/{org_id}/invoices":{"get":{"summary":"List the org's invoices, newest first, with links to Stripe's hosted page and PDF.","operationId":"invoices_self_list","parameters":[{"name":"cursor","in":"query","description":"Opaque cursor from the previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size, `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/path-tier-presets":{"get":{"summary":"List active path-tier presets (the 5-button picker).","operationId":"path_tier_presets_catalog","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierPresetCatalogResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/billing/path-tiers":{"get":{"summary":"List active, visible network-path-tier SKUs for the pricing page.","operationId":"path_tiers_catalog","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierCatalogResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/billing/payments":{"get":{"summary":"List payments received (paid invoices, crypto) and failed or open attempts for the caller's orgs.","operationId":"payments_self_list","parameters":[{"name":"cursor","in":"query","description":"Opaque cursor from the previous page.","required":false,"schema":{"type":["string","null"]}},{"name":"limit","in":"query","description":"Page size, 1–200 (default 50).","required":false,"schema":{"type":["integer","null"],"format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org (the console's workspace). An org the caller may not\nread lists nothing.","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"status","in":"query","description":"Only rows with this normalised status.","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/plans":{"get":{"summary":"List active, visible billing plans for the pricing page.","operationId":"plans_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/billing/plans/{id}":{"get":{"summary":"Read a single active, visible billing plan by id.","operationId":"plans_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/billing/plans/{id}/servers":{"get":{"summary":"List the active servers offered by a published billing plan.","operationId":"plans_servers_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanServerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/billing/portal":{"post":{"summary":"Mint a Stripe billing-portal session for the caller's customer.","operationId":"portal_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPortalRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPortalRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions":{"get":{"summary":"List subscriptions for the caller's orgs.","operationId":"subscriptions_self_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from the previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":["string","null"]}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":["integer","null"],"format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's subscriptions (the workspace the console is on).\nAn org the caller may not read lists nothing.","required":false,"schema":{"type":["string","null"],"format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Refused: every plan, the free plan included, starts through POST /billing/checkout/stripe.","operationId":"subscriptions_self_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}":{"get":{"summary":"Read a single subscription by id.","operationId":"subscriptions_self_get","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Cancel a subscription at period end; service continues until then.","operationId":"subscriptions_self_cancel","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}/addons":{"get":{"summary":"List addons attached to a single subscription.","operationId":"addons_self_list","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Add an add-on (tunnel or static_ip slot); paid ones are added to the Stripe subscription with proration now.","operationId":"addons_self_create","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}/addons/preview":{"post":{"summary":"Preview the charge for adding an add-on (prorated for the rest of the period).","operationId":"addons_preview","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonPreviewRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}/bandwidth/history":{"get":{"summary":"List per-day bandwidth-history buckets for a subscription (trailing 90 days).","operationId":"bandwidth_history_list","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BandwidthHistoryListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/subscriptions/{subscription_id}/overages":{"patch":{"summary":"Flip the customer-controlled overage gate (allow_overages) for a subscription.","operationId":"subscription_overages_patch","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOverageUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOverageGate"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}/path-tiers":{"get":{"summary":"List the path tiers a subscription's plan grants, with active-period usage and the overage state.","operationId":"subscription_path_tiers","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPathTiersResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/subscriptions/{subscription_id}/path-usage":{"get":{"summary":"Per-tier daily-bucket usage time series for a subscription (trailing 90 days).","operationId":"subscription_path_usage","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathUsageListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/subscriptions/{subscription_id}/plan-change":{"post":{"summary":"Change the plan or cycle: upgrades now with proration, other changes at period end.","operationId":"plan_change_apply","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChangeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChangeRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"delete":{"summary":"Withdraw a plan change scheduled for the end of the period.","operationId":"plan_change_withdraw","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}/plan-change/preview":{"post":{"summary":"Preview a plan or cycle change: when it applies and what is charged now.","operationId":"plan_change_preview","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChangeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChangePreviewRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}/protocol-usage":{"get":{"summary":"List per-protocol bandwidth usage for a subscription's active period.","operationId":"protocol_usage_list","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolUsageListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/billing/subscriptions/{subscription_id}/reactivate":{"post":{"summary":"Reactivate a cancel-at-period-end subscription while still inside the paid window.","operationId":"subscriptions_self_reactivate","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/billing/subscriptions/{subscription_id}/usage":{"get":{"summary":"Read derived usage counters for a subscription (tunnels, static IPs, bandwidth).","operationId":"subscriptions_self_usage","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionUsageRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/client/heartbeat":{"post":{"summary":"Client device liveness + telemetry heartbeat. Admits joined and paused devices via manual identity gate; revoked / unknown / non-cdv_ bearer ⇒ uniform 401.","operationId":"client_heartbeat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientHeartbeatRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientHeartbeatResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/join":{"post":{"summary":"Trade a one-time CT_ join token for a client-device bearer; the cdv_ plaintext is returned exactly once and only its hash is stored. Anonymous; single-use enforced.","operationId":"clients_join","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientJoinRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientJoinResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"auth","nist_controls":["AC-7","AU-2","IA-2","IA-5","SI-10"],"owasp":["A07:2021"]}}},"/client/me":{"get":{"summary":"Client device reads its own record (status, platform, join-time capability slugs). Joined devices only; self-scoped to the cdv_ bearer — no id is accepted, so a device can only ever read itself.","operationId":"client_me","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDeviceMeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}},"delete":{"summary":"Client device revokes its own enrolment (self-logout) and closes any active session. Joined devices only; self-scoped to the cdv_ bearer — no id is accepted, so a device can only ever revoke itself.","operationId":"client_me_delete","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/binary":{"get":{"summary":"Client device resolves its operator-pinned self-update artifact URL (+ cosign signature) for a requested arch. Joined devices only; self-scoped to the cdv_ bearer; downgrade-prevented (only the operator-pinned expected_version, only if allowlisted).","operationId":"client_binary","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientBinaryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/client/me/cert":{"post":{"summary":"Device enrolls an mTLS certificate: submit a self-generated CSR, receive the signed leaf plus the issuing device-CA cert. Re-enrollment supersedes (revokes) the device's prior active cert.","operationId":"device_cert_enroll","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCertEnrollRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCertEnrollResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/config":{"get":{"summary":"Client device polls its operating config (operator-set expected_version + per-capability config block); content-derived ETag + ?wait long-poll. Joined devices only; self-scoped to the cdv_ bearer.","operationId":"client_config","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConfigResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/client/me/connection":{"post":{"summary":"Open a client_connections row when the daemon brings up a tunnel session. Joined-only manual identity gate; cross-org / mis-bound tunnel ⇒ 422.","operationId":"client_connection_open","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConnectionOpenRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConnectionOpenResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/connection/{id}":{"patch":{"summary":"ClientDevice updates telemetry (bytes + RTT + loss + last handshake) on its own open connection. Cross-device / ended / unknown ⇒ uniform 404 connection_not_found; degraded samples emit one audit row.","operationId":"client_connection_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConnectionPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConnectionPatchResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/connection/{id}/end":{"post":{"summary":"ClientDevice closes its own open connection. Stamps ended_at, records ended_reason + optional final byte counters. Joined-or-paused admitted; double-close / cross-device / unknown ⇒ uniform 404.","operationId":"client_connection_end","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConnectionEndRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConnectionEndResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/profiles":{"get":{"summary":"ClientDevice lists the WG profiles it is allowed to connect to. Read-only; joined-only via ResolvePrincipal; cross-org profiles structurally invisible (JOIN keyed on caller's org_id).","operationId":"client_profiles_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientProfilesListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/client/me/quic-profiles":{"get":{"summary":"ClientDevice lists the QUIC tunnels it is allowed to dial. Read-only; joined-only via ResolvePrincipal; cross-org and WireGuard profiles structurally invisible (JOIN keyed on caller's org_id, type='quic').","operationId":"quic_client_profiles","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicClientProfilesListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/client/me/services":{"get":{"summary":"List exposed services on the caller's own client device. Joined-or-paused (read-only). Ordered by protocol then port.","operationId":"client_me_services_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}},"post":{"summary":"Expose a service on the caller's own client device. Joined-only manual identity gate; UNIQUE (client_device_id, protocol, port) collision ⇒ 409.","operationId":"client_me_services_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/services/{svc_id}":{"delete":{"summary":"Withdraw an exposed service on the caller's own client device. Joined-only manual identity gate; unknown / cross-device / already-removed all collapse to 404 service_not_found.","operationId":"client_me_services_delete","parameters":[{"name":"svc_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/subnet-routes":{"post":{"summary":"Advertise a subnet route from the caller's own client device. Joined-only manual identity gate; admin must approve via the staff-only endpoint before the hub routes the subnet.","operationId":"client_me_subnet_routes_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientMeSubnetRouteCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSubnetRouteRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/me/tunnel":{"post":{"summary":"Provision (or idempotently re-fetch) the caller device's own device-keyed WireGuard tunnel. The daemon supplies its public key; the server never holds the private key. Joined-only manual identity gate.","operationId":"client_tunnel_provision","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTunnelProvisionRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTunnelProvisionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/client/ws":{"get":{"summary":"Upgrade to the live customer-dashboard WebSocket. The control plane pushes profile_updated / acl_changed / disconnect_requested / connect_requested / config_changed / revoked events; the daemon acks each by event_id with ok|<error>. Opportunistic — the HTTP long-poll on /client/me/config?wait is the disconnect fallback. Joined devices only; self-scoped to the cdv_ bearer.","operationId":"client_ws","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientWsServerFrame"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"client_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dashboard/ws":{"get":{"summary":"Upgrade to the live topology + flow stream WebSocket.","operationId":"dashboard_ws","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardServerEvent"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/devices":{"get":{"summary":"List devices in the caller's orgs.","operationId":"devices_list","parameters":[{"name":"status","in":"query","description":"Optional `client_devices.status` filter.","required":false,"schema":{"type":"string"}},{"name":"org_id","in":"query","description":"Optional `client_devices.org_id` filter (still gated by\n`EXISTS (org_members)` on the caller).","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Enrol a new client device.","operationId":"devices_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCreateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/install-channels":{"get":{"summary":"List per-platform client install channels (W-42 connect-device wizard step 2). Operator-managed rows from install_channels; {origin} is substituted server-side.","operationId":"install_channels_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallChannelListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/devices/join-tokens":{"get":{"summary":"List the calling user's pending client-device join tokens.","operationId":"client_device_join_tokens_list","parameters":[{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDeviceJoinTokenListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Mint a one-time-use client-device join token (the CT_ plaintext is returned exactly once and only its hash is stored).","operationId":"client_device_join_tokens_mint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDeviceJoinTokenMintRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDeviceJoinTokenMintResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/join-tokens/{id}":{"delete":{"summary":"Revoke a pending client-device join token.","operationId":"client_device_join_tokens_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDeviceJoinTokenRevokeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/mesh/bridges":{"get":{"summary":"List mesh bridges in the caller's orgs.","operationId":"mesh_bridges_list","parameters":[{"name":"status","in":"query","description":"Filter by `mesh_bridges.status`.","required":false,"schema":{"type":"string"}},{"name":"role","in":"query","description":"Filter by `mesh_bridges.role`.","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshBridgeListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Propose a mesh bridge from an owned client device.","operationId":"mesh_bridges_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshBridgeCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshBridgeRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/mesh/bridges/{id}/approve":{"post":{"summary":"Approve a proposed mesh bridge (org_admin only).","operationId":"mesh_bridges_approve","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshBridgeRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/mesh/bridges/{id}/revoke":{"post":{"summary":"Revoke a mesh bridge (owner or org_admin).","operationId":"mesh_bridges_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshBridgeRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/mesh/paths":{"get":{"summary":"List peer-paths in the caller's orgs.","operationId":"mesh_paths_list","parameters":[{"name":"cursor","in":"query","description":"Opaque cursor from a previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeerPathListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/devices/mesh/paths/{src_device_id}/{dst_device_id}":{"get":{"summary":"Read a single peer-path and its decision rationale.","operationId":"mesh_paths_get","parameters":[{"name":"src_device_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"dst_device_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeerPathDetail"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/devices/mesh/probe":{"post":{"summary":"Request an out-of-band RTT probe between two devices.","operationId":"mesh_probe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshProbeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshProbeAckResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}":{"get":{"summary":"Read a single device with services + subnet routes.","operationId":"devices_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceDetail"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Revoke an enrolled client device and close any active session.","operationId":"devices_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update a device's name / policy flags.","operationId":"devices_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevicePatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceDetail"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/cert/revoke":{"post":{"summary":"Revoke a client device's active mTLS certificate. Leaves the device's cdv_ bearer untouched.","operationId":"device_cert_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCertRevokeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/connect":{"post":{"summary":"Request that one device apply a specific tunnel profile.","operationId":"devices_connect","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceConnectRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceConnectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/connections":{"get":{"summary":"Cursor-paginated session log for one device (newest first).","operationId":"device_connections_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceConnectionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/devices/{id}/disconnect":{"post":{"summary":"Request that one device drop its current tunnel session.","operationId":"devices_disconnect","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceDisconnectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/revoke":{"post":{"summary":"Revoke an enrolled client device.","operationId":"devices_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRevokeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/services":{"get":{"summary":"List services declared on a device the caller can see.","operationId":"device_services_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Register an exposed service on an owned device.","operationId":"device_services_create","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/services/{svc_id}":{"delete":{"summary":"Remove an exposed service from an owned device.","operationId":"device_services_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"svc_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceServiceDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/subnet-routes":{"get":{"summary":"List subnet routes advertised by a device the caller can see.","operationId":"device_subnet_routes_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSubnetRouteListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Advertise a subnet route from an owned device (admin must approve).","operationId":"device_subnet_routes_create","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSubnetRouteCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSubnetRouteRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/devices/{id}/subnet-routes/{route_id}":{"delete":{"summary":"Withdraw a subnet route from an owned device.","operationId":"device_subnet_routes_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"route_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSubnetRouteDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/assignments":{"get":{"summary":"List DNS assignments for the caller's orgs.","operationId":"assignments_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from a previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAssignmentListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a DNS assignment for the caller's org.","operationId":"assignments_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAssignmentCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAssignmentRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/assignments/{id}":{"get":{"summary":"Get a single DNS assignment.","operationId":"assignments_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAssignmentRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a DNS assignment.","operationId":"assignments_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAssignmentDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update a DNS assignment's filter list.","operationId":"assignments_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAssignmentUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAssignmentRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/filter-lists":{"get":{"summary":"List selectable public DNS filter-list SKUs (name/slug/description).","operationId":"filter_lists_catalog","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsFilterListListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/dns/query-logs":{"get":{"summary":"List DNS query logs for a subscription in the caller's org.","operationId":"query_logs_list","parameters":[{"name":"subscription_id","in":"query","description":"Subscription whose query logs to read. Required; must belong to\nan org the caller is a member of, else 404.","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from a previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsQueryLogListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/dns/servers":{"get":{"summary":"List selectable public DNS resolvers (location/status/transports).","operationId":"servers_catalog","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsServerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/dns/usage":{"get":{"summary":"Trailing-30-day DNS usage aggregate for a subscription.","operationId":"dns_usage","parameters":[{"name":"subscription_id","in":"query","description":"Subscription whose usage to aggregate. Required; must belong to\nan org the caller is a member of, else 404.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsUsageResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/dns/zones":{"get":{"summary":"List authoritative DNS zones across the caller's orgs.","operationId":"zones_list","parameters":[{"name":"cursor","in":"query","description":"Opaque cursor from a previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create an authoritative DNS zone in the org named by org_id, else the caller's selected workspace (an API token's own org).","operationId":"zones_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/zones/{zone_id}":{"get":{"summary":"Read a single authoritative DNS zone.","operationId":"zones_get","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a DNS zone (cascades to records and DNSSEC keys).","operationId":"zones_delete","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Partial update of a DNS zone's SOA timers / primary_ns / contact.","operationId":"zones_patch","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZonePatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/zones/{zone_id}/dnssec/enable":{"post":{"summary":"Enable DNSSEC on a zone (mints KSK + ZSK; bumps SOA serial).","operationId":"dnssec_enable","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnssecEnableResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/zones/{zone_id}/dnssec/rotate-zsk":{"post":{"summary":"Rotate the active ZSK on a zone (mints new, demotes old; bumps SOA serial).","operationId":"dnssec_rotate_zsk","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnssecRotateZskResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/zones/{zone_id}/export":{"get":{"summary":"Render an authoritative zone as RFC 1035 zonefile text.","operationId":"zone_export","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneExportResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/dns/zones/{zone_id}/import":{"post":{"summary":"Replace zone records with the parsed contents of an uploaded zonefile.","operationId":"zone_import","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneImportRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneImportResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/zones/{zone_id}/records":{"get":{"summary":"List records in an authoritative DNS zone the caller can access.","operationId":"records_list","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a DNS record in an authoritative zone.","operationId":"records_create","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns/zones/{zone_id}/records/{record_id}":{"get":{"summary":"Read a single DNS record in an authoritative zone.","operationId":"records_get","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a DNS record (bumps zone SOA serial).","operationId":"records_delete","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Partial update of a DNS record (bumps zone SOA serial).","operationId":"records_patch","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns_agent/assignments":{"get":{"summary":"DNS resolver agent reads the assignment set it must serve (subscription, filter list, source clamp); ETag + ?wait long-poll.","operationId":"assignments_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentAssignmentsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/config":{"get":{"summary":"Read the DNS resolver agent's operating parameters (heartbeat/log-batch cadence, max log batch, allowed zones).","operationId":"config_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentConfigRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/filter-lists":{"get":{"summary":"DNS resolver agent reads the distinct filter lists referenced by its active assignments; each row carries the relative entries_url for the streamed entry set.","operationId":"filter_lists_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentFilterListsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/filter-lists/{id}/entries":{"get":{"summary":"DNS resolver agent streams the cursor-paginated entry set ({ domain, action, rewrite_to? }) of one filter list referenced by its active assignments.","operationId":"filter_list_entries_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentFilterListEntriesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/heartbeat":{"post":{"summary":"DNS resolver agent posts liveness + telemetry; rolls dns_servers.telemetry_json and bumps dns_servers.last_seen_at.","operationId":"heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsHeartbeatRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsHeartbeatResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns_agent/infra-records":{"get":{"summary":"DNS resolver agent reads the active infra split-horizon records (name, record_type, value, ttl) it compiles into its exact-name override map. Infra-global; every DNS agent gets the same set.","operationId":"infra_records_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentInfraRecordsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/net-policy-domains":{"get":{"summary":"DNS resolver agent reads the per-tunnel domain/category network-policy rules it enforces at DNS-answer time (categories pre-expanded to member domains); ETag-cacheable.","operationId":"net_policy_domains_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentNetPolicyDomainsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/query-log":{"post":{"summary":"DNS resolver agent uploads a batched query-log set (<=1000 rows); idempotent on (server_id, ts, subscription_id, query_name) so retries don't double-count.","operationId":"query_log_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsQueryLogUploadRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsQueryLogUploadResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/dns_agent/zones":{"get":{"summary":"DNS agent reads the authoritative zone roster it must serve (SOA tuple, dnssec flag, record count; live-subscription orgs only); ETag + ?wait long-poll.","operationId":"zones_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentZonesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/zones/{zone_id}/dnssec-keys":{"get":{"summary":"DNS agent reads one dnssec-enabled zone's active signing keys (kind, algorithm, public key, private seed) for online RRSIG/NSEC3 signing; live-subscription orgs only.","operationId":"zone_dnssec_keys_get","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentZoneDnssecKeysResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/dns_agent/zones/{zone_id}/records":{"get":{"summary":"DNS agent transfers the cursor-paginated record set (name, type, value, ttl, priority/weight/port) of one authoritative zone owned by a live subscription.","operationId":"zone_records_get","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsAgentZoneRecordsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/external_exit/assignments":{"get":{"summary":"Exit-driver agent's assignment roster (id + slug + kind + status + unsealed config + capability hints). Caller's agt_ bearer resolves to an exit-driver agent; rows are scoped to operator_agent_id so cross-agent isolation is structural. Stable id order keeps unchanged re-fetches byte-identical.","operationId":"external_exit_assignments","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalExitAssignmentsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/external_exit/telemetry":{"post":{"summary":"Exit-driver agent reports per-exit health + 5-minute counters. Updates last_health_check_at/_ok; three consecutive failures flip active->degraded (audited), one success recovers degraded->active (audited). Reports are scoped to operator_agent_id; a non-owned exit rejects the whole request.","operationId":"external_exit_telemetry","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalExitTelemetryRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalExitTelemetryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/health":{"get":{"summary":"Liveness + DB-reachable check.","operationId":"health","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/iam/assume":{"post":{"summary":"Exchange a base JWT for an assumed-role JWT scoped to the target org.","operationId":"iam_assume","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IamAssumeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IamAssumeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs":{"post":{"summary":"Create a new org and install an org_admin member.","operationId":"org_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}":{"get":{"summary":"Read an org's metadata.","operationId":"org_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete an org.","operationId":"org_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update an org's metadata (rename).","operationId":"org_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/acl-rules":{"get":{"summary":"List ACL rules configured for an org.","operationId":"org_acl_rules_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAclRuleListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Add an ACL rule to an org's catalog.","operationId":"org_acl_rules_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAclRuleCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAclRuleSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/acl-rules/{rule_id}":{"delete":{"summary":"Remove one ACL rule from an org's catalog.","operationId":"org_acl_rules_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAclRuleDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Rewrite one ACL rule's configuration on an org.","operationId":"org_acl_rules_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAclRuleUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAclRuleSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/activation-status":{"get":{"summary":"Return the org's four-step activation checklist with live completion state and the caller's dismissal stamp.","operationId":"org_activation_status","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationStatus"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/iam/orgs/{org_id}/assume-grants":{"get":{"summary":"List cross-org assume grants the target org has authorised.","operationId":"org_assume_grants_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrossOrgAssumeGrantListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Issue a cross-org assume grant authorising a foreign principal to act in this org.","operationId":"org_assume_grants_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAssumeGrantCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrossOrgAssumeGrantSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/assume-grants/{grant_id}":{"delete":{"summary":"Revoke a cross-org assume grant within an org.","operationId":"org_assume_grants_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgAssumeGrantDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/audit-events":{"get":{"summary":"List audit events for an org.","operationId":"audit_events_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/iam/orgs/{org_id}/device-policy":{"get":{"summary":"Read the org's device-compliance policy (require_disk_encryption, require_screen_lock, require_firewall, min_os_version, min_agent_version, enforcement_mode). Resolves to the report-only default when unset.","operationId":"org_device_policy_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgDevicePolicyRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the org's device-compliance policy (require_disk_encryption, require_screen_lock, require_firewall, min_os_version, min_agent_version, enforcement_mode). Upserts on first write; pushes ConfigChanged to every joined device in the org.","operationId":"org_device_policy_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgDevicePolicyUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgDevicePolicyRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/device-policy/compliance":{"get":{"summary":"Per-device posture-compliance verdicts against the org's device-compliance policy: compliant/non-compliant with a per-check breakdown for every joined/paused device.","operationId":"org_device_policy_compliance_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgDevicePostureComplianceResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/iam/orgs/{org_id}/effective-actions":{"get":{"summary":"List the caller's grantable actions for an org.","operationId":"effective_actions_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveActionsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/iam/orgs/{org_id}/grants":{"get":{"summary":"List resource-level grants defined within an org.","operationId":"org_resource_grants_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceGrantListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new resource-level grant within an org.","operationId":"org_resource_grants_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResourceGrantCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceGrantSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/grants/{grant_id}":{"delete":{"summary":"Delete a resource-level grant within an org.","operationId":"org_resource_grants_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResourceGrantDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/invite":{"post":{"summary":"Add an existing platform user as a member of an org.","operationId":"member_invite","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberInviteRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMember"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/magic-dns":{"get":{"summary":"Return the org's magic-DNS zone + per-device tunnel_ip and service registrations.","operationId":"magic_dns_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicDnsView"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/iam/orgs/{org_id}/managed-config":{"get":{"summary":"Read the org's managed device configuration (enforced_dns_filter, default_kill_switch, default_auto_connect, allowed_networks, blocked_networks, update_channel). Resolves to the no-overrides default when unset.","operationId":"org_managed_config_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgManagedConfigRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the org's managed device configuration (enforced_dns_filter, default_kill_switch, default_auto_connect, allowed_networks, blocked_networks, update_channel). Upserts on first write; pushes ConfigChanged to every joined device in the org.","operationId":"org_managed_config_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgManagedConfigUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgManagedConfigRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/members":{"get":{"summary":"List members of an org.","operationId":"org_members_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/iam/orgs/{org_id}/members/{user_id}":{"get":{"summary":"Read a single org member by user id.","operationId":"member_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMember"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Remove a member from an org.","operationId":"member_remove","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberRemoveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/members/{user_id}/role":{"patch":{"summary":"Reassign a member's role within an org.","operationId":"member_role_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRoleAssignRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMember"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/policy-conditions":{"get":{"summary":"List policy conditions defined within an org.","operationId":"org_policy_conditions_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyConditionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Attach a new policy condition within an org.","operationId":"org_policy_conditions_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPolicyConditionCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyConditionSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/policy-conditions/{condition_id}":{"delete":{"summary":"Detach a policy condition within an org.","operationId":"org_policy_conditions_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"condition_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPolicyConditionDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/roles":{"get":{"summary":"List custom roles defined within an org.","operationId":"org_custom_roles_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCustomRoleListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new custom role within an org.","operationId":"org_custom_role_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCustomRoleCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCustomRoleRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/roles/{role_id}":{"get":{"summary":"Read a single custom role by id within an org.","operationId":"org_custom_role_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"role_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCustomRoleRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a custom role within an org.","operationId":"org_custom_role_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"role_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCustomRoleDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update a custom role's metadata or action set within an org.","operationId":"org_custom_role_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"role_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCustomRoleUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCustomRoleRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/service-accounts":{"get":{"summary":"List service accounts for an org.","operationId":"service_accounts_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new service account in an org.","operationId":"service_account_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/sso-providers":{"get":{"summary":"List SSO providers configured within an org.","operationId":"org_sso_providers_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoProviderListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Configure a new SSO provider on an org.","operationId":"org_sso_providers_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoProviderCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoProviderSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/sso-providers/{provider_id}":{"delete":{"summary":"Decommission an SSO provider on an org.","operationId":"org_sso_providers_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoProviderDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update an existing SSO provider configuration on an org.","operationId":"org_sso_providers_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoProviderUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoProviderSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/sso-providers/{provider_id}/test":{"post":{"summary":"Validate the configured discovery doc + signing keys for an SSO provider on an org.","operationId":"org_sso_providers_test","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSsoProviderTestResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/orgs/{org_id}/tokens":{"get":{"summary":"List API tokens for an org.","operationId":"token_list","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Issue a new user-owned API token in an org.","operationId":"token_create","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenCreateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/release-assume":{"post":{"summary":"Exit an assumed session, exchanging the assumed-role JWT for a base JWT.","operationId":"iam_release_assume","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IamReleaseAssumeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IamReleaseAssumeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/service-accounts/{service_account_id}":{"get":{"summary":"Read a single service account by id.","operationId":"service_account_get","parameters":[{"name":"service_account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Disable a service account (soft-delete) and revoke its API tokens.","operationId":"service_account_delete","parameters":[{"name":"service_account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update a service account's metadata (rename).","operationId":"service_account_patch","parameters":[{"name":"service_account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/tokens":{"get":{"summary":"List the caller's own API tokens.","operationId":"tokens_self_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/iam/tokens/{token_id}":{"get":{"summary":"Read a single API token by id.","operationId":"token_get","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenListItem"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Revoke an API token (soft-delete via `revoked = 1`).","operationId":"token_revoke","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRevokeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/iam/tokens/{token_id}/rotate":{"post":{"summary":"Rotate an API token's secret material in place; the row id is preserved.","operationId":"token_rotate","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRotateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/net-policy/bindings/{binding_id}":{"get":{"summary":"Read a binding's network policy (profile, forwards, rules).","operationId":"net_policy_get","parameters":[{"name":"binding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetPolicyView"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Set a binding's network policy (profile, forwards, rules).","operationId":"net_policy_set","parameters":[{"name":"binding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetPolicySetRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetPolicyView"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/account-deletions":{"get":{"summary":"Account deletions (staff-only), newest first, with their step and last failure; ?status=failed lists those waiting for staff.","operationId":"platform_account_deletions_list","parameters":[{"name":"status","in":"query","description":"Only this status: `scheduled`, `purging`, `completed`, `failed`,\n`cancelled`.","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/account-deletions/{id}/retry":{"post":{"summary":"Retry a failed account deletion from the step that failed (staff-only, elevated session). 409 deletion_not_failed otherwise.","operationId":"platform_account_deletions_retry","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionRetryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/addons":{"get":{"summary":"List subscription addons across every org (staff-only, cursor-paginated).","operationId":"platform_addons_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from the previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":["string","null"]}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":["integer","null"],"format":"int32","minimum":0}},{"name":"subscription_id","in":"query","description":"Only this subscription's add-ons.","required":false,"schema":{"type":["string","null"],"format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAddonListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Manually grant a tunnel/static-IP addon outside Stripe (staff-only comp path; priced at zero).","operationId":"platform_addons_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAddonCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAddonRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/addons/{id}":{"delete":{"summary":"Force-cancel one subscription addon (staff-only). Idempotent on already-cancelled.","operationId":"platform_addons_cancel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAddonRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agent-join-tokens":{"get":{"summary":"List the minted fleet-agent join tokens with derived pending/used/expired status (staff-only, cursor-paginated).","operationId":"join_tokens_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentJoinTokenListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Mint a one-time-use fleet-agent join token (staff-only); the JT_ plaintext is returned exactly once and only its hash is stored.","operationId":"join_tokens_mint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentJoinTokenMintRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentJoinTokenMintResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agent-join-tokens/{id}":{"delete":{"summary":"Revoke a one-time-use fleet-agent join token (staff-only); sets expires_at = now() so it can never mint an agent. Idempotent.","operationId":"join_tokens_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentJoinTokenRevokeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agents":{"get":{"summary":"List the fleet's running agents with status, capabilities, last_seen_at, and derived version skew (staff-only, cursor-paginated).","operationId":"agents_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/agents/image-rollouts":{"get":{"summary":"List fleet OS-image rollouts (open + terminal history), newest first, cursor-paginated. Staff-only.","operationId":"agent_image_rollouts_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRolloutListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Open a staged rollout of an OS-image version across the joined, un-pinned agents on one release channel (deterministic hash-bucket waves). Staff-only; target must be catalogued in release_images; at most one open rollout per channel.","operationId":"agent_image_rollouts_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRolloutCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRolloutRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agents/image-rollouts/{id}":{"get":{"summary":"Read one fleet image rollout with live adoption stats (cohort, wave size, adopted, pinned) derived from agent-reported image versions on the channel. Staff-only.","operationId":"agent_image_rollouts_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRolloutDetailResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Advance or gate a fleet image rollout: raise wave_percent (never decreases), pause/resume, or close terminal (completed/cancelled — immutable after). Staff-only.","operationId":"agent_image_rollouts_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRolloutUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRolloutRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agents/{id}":{"get":{"summary":"Fetch one fleet agent's full record plus the routing_servers / dns_servers / servers rows linked to it by agent_id (staff-only).","operationId":"agents_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetailResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Retire a fleet-agent record (staff-only): status -> retired and the bearer is invalidated. Refused 409 while any live binding references the agent's routing_server. Idempotent.","operationId":"agents_retire","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRetireResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit a fleet agent's operator-controlled columns (name, location, expected_version, status). Staff-only. Omitted fields are unchanged; empty string clears location / expected_version.","operationId":"agents_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agents/{id}/pets":{"get":{"summary":"List one fleet agent's declared pet containers (name, image, desired state, last agent-reported state), absent removal tombstones included. Staff-only.","operationId":"agent_pets_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetsListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Declare a new pet container (name, image, desired state) on a fleet agent. The agent reconciles the device toward the declared set on its next poll. Staff-only; at most 32 pets per agent; names unique per agent.","operationId":"agent_pets_create","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agents/{id}/pets/{pet_id}":{"delete":{"summary":"Remove a pet declaration. Never-reported pets are hard-deleted immediately; provisioned pets become an absent tombstone the agent must tuple-confirm before the row is hard-deleted. Staff-only.","operationId":"agent_pets_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"pet_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit a declared pet's image or desired state (running|stopped). An image change makes the agent replace the container (destroy + re-create from the new image). Absent removal tombstones are immutable. Staff-only.","operationId":"agent_pets_update","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"pet_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPetRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/agents/{id}/rotate-key":{"post":{"summary":"Rotate a fleet-agent's bearer credential in place (staff-only); the agt_ plaintext is returned exactly once and only its hash is stored. The previous bearer is invalidated atomically on commit; a retired agent is refused 409.","operationId":"agents_rotate_key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRotateKeyResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/analytics/list":{"get":{"summary":"List analytics events (cross-org, staff-only, cursor-paginated).","operationId":"list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsEventListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/analytics/live":{"get":{"summary":"Live (open, recently-beating) analytics-session count (staff-only).","operationId":"live","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsLiveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/analytics/purge":{"delete":{"summary":"Delete analytics rows (full table, or older than N days).","operationId":"purge","parameters":[{"name":"older_than_days","in":"query","description":"Delete only rows whose `created_at` is strictly older than\n`now() - N days`. Absent ⇒ purge every row.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsPurgeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/analytics/summary":{"get":{"summary":"Aggregate analytics counts (cross-org, staff-only).","operationId":"summary","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSummaryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/api-tokens":{"get":{"summary":"List api tokens (staff-only, cursor-paginated; optional org_id / revoked filters).","operationId":"platform_api_tokens_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformApiTokenListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/audit-events":{"get":{"summary":"List audit events across every org (staff-only).","operationId":"platform_audit_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from the previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/audit/first-anchor":{"post":{"summary":"Sign the first audit-chain anchor for a chain pruned before anchors existed (staff-only, one-time).","operationId":"first_anchor","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditFirstAnchorResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/audit/verify-integrity":{"post":{"summary":"Walk the audit chain and report any HMAC / prev-hmac divergence (staff-only).","operationId":"verify_integrity","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditVerifyIntegrityResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/bgp/peers":{"get":{"summary":"List configured BGP peers (staff-only, cursor-paginated; optional agent_id / status filter). password_ct is never projected.","operationId":"platform_bgp_peers_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"agent_id","in":"query","description":"Optional owning-agent filter (`agents.id`).","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Optional `status` filter (`enabled` / `disabled`).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpPeerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Configure a BGP peer for an agent (staff-only). Validates the agent carries bgp_speaker, seals the password into password_ct, ships disabled; returns the created row without the ciphertext.","operationId":"platform_bgp_peers_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpPeerCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpPeerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/bgp/peers/{id}":{"delete":{"summary":"Delete one BGP peer (staff-only). 404 on unknown id; the audit row records the prior agent_id / peer_address.","operationId":"platform_bgp_peers_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpPeerDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit one BGP peer (staff-only). Omitted fields unchanged; status enabled/disabled is the on/off toggle; password null-clears / re-seals into password_ct. Returns the row without the ciphertext.","operationId":"platform_bgp_peers_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpPeerUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpPeerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/bgp/peers/{id}/withdraw":{"post":{"summary":"Push a bgp_withdraw command to the peer's owning agent (staff-only maintenance verb). Row state untouched; delivered=false means the agent socket is down.","operationId":"platform_bgp_peers_withdraw","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpWithdrawResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/bgp/sessions":{"get":{"summary":"List configured BGP neighbours joined with live session state from agent telemetry (staff-only, cursor-paginated). Unreported peers show state=unknown.","operationId":"platform_bgp_sessions_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BgpSessionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/bindings":{"get":{"summary":"List bindings (staff-only, cursor-paginated; optional status / public_ip_id / tunnel_id / routing_server_id filters).","operationId":"platform_bindings_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"status","in":"query","description":"Optional `status` filter.","required":false,"schema":{"type":"string"}},{"name":"public_ip_id","in":"query","description":"Optional `public_ip_id` filter (UUIDv7).","required":false,"schema":{"type":"string"}},{"name":"tunnel_id","in":"query","description":"Optional `tunnel_id` filter (UUIDv7).","required":false,"schema":{"type":"string"}},{"name":"routing_server_id","in":"query","description":"Optional `routing_server_id` filter (UUIDv7).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformBindingListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/bindings/migrate":{"post":{"summary":"Batch-migrate live bindings from one rule_type to another and re-queue them through the agent (staff-only). Historical rows keep their original rule_type. dry_run=true counts without mutating; from == to is 422.","operationId":"platform_bindings_migrate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingsMigrateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingsMigrateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/bindings/reset-pending":{"post":{"summary":"Bulk re-queue every binding stuck in pending/failed past stuck_after_minutes (staff-only; default 15 min). failed rows flip back only when their IP has no other live binding. dry_run=true counts without mutating.","operationId":"platform_bindings_reset_pending_bulk","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingsResetPendingBulkRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingsResetPendingBulkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/bindings/{id}":{"get":{"summary":"Read one binding (staff-only). 404 on unknown id.","operationId":"platform_bindings_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformBindingRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Hard-delete one stuck binding row (staff-only escape hatch). The audit row preserves the pre-delete fact set; unknown id is 404.","operationId":"platform_bindings_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformBindingRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Override one binding's priority and/or status (staff-only). Empty patch is 422; a flip into a live status checks the one-live-binding-per-IP invariant (409 ip_already_bound); unknown id is 404.","operationId":"platform_bindings_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformBindingPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformBindingRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/bindings/{id}/exit-server":{"patch":{"summary":"Set or clear one binding's inter-hub egress relay (staff-only). A uuid sets bindings.exit_server_id after validating the target server exists, its agent is joined, the binding has an ingress hub, no conflicting external_exit_id, and an internal cross-hub pop_links carrier connects the ingress PoP to the target PoP (or the target shares the ingress PoP); any miss is 422. Explicit null clears it; an absent key is 422; an unknown binding id is 404.","operationId":"bindings_set_exit_server","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingExitServerRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingExitServerResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/bindings/{id}/reset-pending":{"post":{"summary":"Re-queue one stuck binding through the agent (staff-only). pending clears last_error; failed flips back to pending (one-live-per-IP checked, 409 ip_already_bound); other states are 409 bad_transition; unknown id is 404.","operationId":"platform_bindings_reset_pending","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformBindingRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/card-exceptions":{"get":{"summary":"List card screening exceptions, newest first (staff-only).","operationId":"platform_card_exceptions_list","parameters":[{"name":"org_id","in":"query","description":"Only this organization's.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"include_revoked","in":"query","description":"Include revoked exceptions.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardExceptionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Accept an organization's card on file despite a failed CVC or postal-code check (staff-only).","operationId":"platform_card_exceptions_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardExceptionCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardExceptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/card-exceptions/cards":{"get":{"summary":"The cards on file of a user's organizations, and the exception each has (staff-only).","operationId":"platform_card_exceptions_cards","parameters":[{"name":"user_id","in":"query","description":"The account whose cards to show.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCardsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/card-exceptions/{id}":{"delete":{"summary":"Revoke a card screening exception; a card it covered is refused again, with a fresh grace period (staff-only).","operationId":"platform_card_exceptions_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardExceptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/crypto/payments":{"get":{"summary":"List crypto payments (staff-only, cursor-paginated; optional org_id / status / currency filters).","operationId":"platform_crypto_payments_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformCryptoPaymentListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/crypto/payments/{payment_id}/resolve":{"post":{"summary":"Record that a received but unapplied crypto payment was refunded or applied by hand (staff-only).","operationId":"platform_crypto_payments_resolve","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoPaymentResolve"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoPaymentResolved"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/devices":{"get":{"summary":"List devices with live-health across every org (staff-only, cursor-paginated; optional org_id / status filters).","operationId":"platform_devices_list","parameters":[{"name":"org_id","in":"query","description":"Optional `client_devices.org_id` filter — the support console\nalways sets this once staff picks a customer via\n`GET /platform/orgs`.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Optional `client_devices.status` filter.","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDeviceListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/devices/rollouts":{"get":{"summary":"List client rollouts (open + terminal history), newest first, cursor-paginated. Staff-only.","operationId":"client_rollouts_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRolloutListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Open a staged rollout of a client version across the joined, un-pinned device fleet (deterministic hash-bucket waves). Staff-only; target must be allowlisted; at most one open rollout at a time.","operationId":"client_rollouts_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRolloutCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRolloutRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/devices/rollouts/{id}":{"get":{"summary":"Read one client rollout with live adoption stats (cohort, wave size, adopted, pinned) derived from device-reported versions. Staff-only.","operationId":"client_rollouts_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRolloutDetailResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Advance or gate a client rollout: raise wave_percent (never decreases), pause/resume, or close terminal (completed/cancelled — immutable after). Staff-only.","operationId":"client_rollouts_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRolloutUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRolloutRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/devices/subnet-routes":{"get":{"summary":"List customer-advertised subnet routes across every org (staff-only, cursor-paginated).","operationId":"platform_subnet_routes_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from the previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"pending","in":"query","description":"When `true`, return only routes still awaiting approval\n(`approved_at IS NULL`). Absent / `false` ⇒ every route.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubnetRouteListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/devices/{id}/subnet-routes/{route_id}/approve":{"post":{"summary":"Approve a customer device's advertised subnet route (staff-only).","operationId":"device_subnet_routes_approve","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"route_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSubnetRouteApproveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/devices/{id}/version":{"patch":{"summary":"Set or clear a client device's manual expected_version pin — the per-device override that beats any rollout wave. Empty string clears. Staff-only; joined devices only; set targets must be allowlisted.","operationId":"platform_device_version_pin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceVersionPinRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceVersionPinResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/filter-lists":{"get":{"summary":"List DNS filter-list catalog rows (staff-only, cursor-paginated; optional is_active filter).","operationId":"platform_dns_filter_lists_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterListListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a DNS filter-list SKU (staff-only).","operationId":"platform_dns_filter_lists_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterListCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterListRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/filter-lists/{id}":{"delete":{"summary":"Delete a DNS filter-list SKU (staff-only; refuses while in use by an assignment).","operationId":"platform_dns_filter_lists_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterListDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit a DNS filter-list SKU (staff-only; name/description/source_url/is_active).","operationId":"platform_dns_filter_lists_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterListPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterListRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/filter-lists/{id}/entries":{"get":{"summary":"List a DNS filter-list's per-domain entries (staff-only, cursor-paginated). 404 on unknown list.","operationId":"platform_dns_filter_entries_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterEntryListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Add a per-domain rule to a DNS filter list (staff-only). rewrite_to required iff action=rewrite; duplicate domain → 409.","operationId":"platform_dns_filter_entries_create","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterEntryCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterEntryRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/filter-lists/{id}/entries/{entry_id}":{"delete":{"summary":"Remove a per-domain rule from a DNS filter list (staff-only). 404 when the entry is absent or belongs to another list.","operationId":"platform_dns_filter_entries_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsFilterEntryDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/infra-records":{"get":{"summary":"List the infra split-horizon DNS records (staff-only). Returned whole, (name, record_type) ordered.","operationId":"platform_infra_dns_records_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfraDnsRecordListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create an infra split-horizon DNS record (staff-only). record_type A/AAAA; value must be an IP of that family; duplicate (name, record_type) → 409.","operationId":"platform_infra_dns_records_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfraDnsRecordCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfraDnsRecordRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/infra-records/{id}":{"delete":{"summary":"Remove an infra split-horizon DNS record (staff-only). 404 when absent.","operationId":"platform_infra_dns_records_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfraDnsRecordDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/query-logs":{"get":{"summary":"List recursive-resolver query telemetry (staff-only, cross-org; cursor-paginated; optional subscription_id / blocked filters).","operationId":"platform_dns_query_logs_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsQueryLogListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/dns/servers":{"get":{"summary":"List DNS resolver fleet members (staff-only, cursor-paginated; optional status filter).","operationId":"platform_dns_servers_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsServerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Pre-provision a DNS resolver row (staff-only). The agent-join back-fill links to it by name; status defaults to inactive.","operationId":"platform_dns_servers_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsServerCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsServerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/servers/{id}":{"get":{"summary":"Read one DNS resolver fleet member (staff-only). 404 on unknown id.","operationId":"platform_dns_servers_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsServerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Decommission a DNS resolver (staff-only). Refuses while assignments reference it (409 server_in_use) or an agent is linked (409 agent_linked).","operationId":"platform_dns_servers_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsServerDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update a DNS resolver's name/location/status/capabilities (staff-only). public_ip_id is immutable; empty patch → 422.","operationId":"platform_dns_servers_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsServerPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDnsServerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/dns/zones":{"get":{"summary":"List authoritative DNS zones across every org (staff-only, cursor-paginated): identity, SOA serial, DNSSEC flag, record count.","operationId":"zones_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZoneAdminListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/dns/zones/{id}/force-resign":{"post":{"summary":"Force a fresh DNSSEC sign of one authoritative zone (staff-only incident response): bumps the SOA serial so the agent re-signs with the active keys. 409 when DNSSEC is not enabled.","operationId":"force_resign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceResignResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/external-exits":{"get":{"summary":"List external-exit driver rows (staff-only, cursor-paginated; optional kind / status filters).","operationId":"platform_external_exits_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create an external-exit driver catalog row (staff-only). Seals the plaintext config into config_ct; validates kind / status / slug; returns the created row without the ciphertext.","operationId":"platform_external_exits_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/external-exits/{id}":{"get":{"summary":"Fetch one external-exit driver row by id (staff-only). config_ct and operator_agent_id are never projected.","operationId":"platform_external_exits_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete one external-exit driver row (staff-only). Refused 409 while any binding, path-tier, or usage row references it (the ON DELETE RESTRICT FKs); 404 on unknown id.","operationId":"platform_external_exits_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit one external-exit driver row (staff-only). Omitted fields unchanged; a supplied config is re-sealed into config_ct; slug re-validated for grammar + uniqueness; config_ct never echoed.","operationId":"platform_external_exits_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/external-exits/{id}/health-check":{"post":{"summary":"Probe an external exit's driver state (staff-only): push a one-shot health probe to the owning agent over its WebSocket and return the reported connection state. Read-only — no traffic egresses through the exit. 404 unknown exit; 409 no owning agent; 503 agent offline or no reply in time.","operationId":"platform_external_exits_health_check","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeOutcome"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/external-exits/{id}/test":{"post":{"summary":"Test an external exit end-to-end (staff-only): push a one-shot reachability probe to the owning agent, which probes a target derived from the exit's own sealed config (never operator-supplied — no SSRF surface) THROUGH the exit and returns the result. 404 unknown exit; 409 no owning agent; 503 agent offline or no reply in time.","operationId":"platform_external_exits_test","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeOutcome"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/external-exits/{id}/usage":{"get":{"summary":"Read one external-exit driver's cross-org usage rollup (staff-only): bytes + cost per period per subscription, cursor-paginated newest-period-first. 404 on unknown driver id.","operationId":"platform_external_exits_usage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformExternalExitUsageResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/host-routes":{"get":{"summary":"List infra host-routes (staff-only, cursor-paginated). Excludes removed rows.","operationId":"platform_host_routes_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostRouteListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Claim a public IP for infra use and route it to an internal host (staff-only; the non-tunnel sibling of the customer bind).","operationId":"platform_host_routes_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHostRouteRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostRouteRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/host-routes/{id}":{"delete":{"summary":"Tear down an infra host-route: moves it to removing for agent teardown and releases the public IP back to available (staff-only).","operationId":"platform_host_routes_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostRouteRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/invoices":{"get":{"summary":"List invoices across all orgs (staff-only, cursor-paginated; optional org_id / status filters).","operationId":"platform_invoices_list","parameters":[{"name":"cursor","in":"query","description":"Opaque cursor from the previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size, `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's invoices (UUID).","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Only invoices in this status: `draft`, `open`, `paid`,\n`uncollectible` or `void`.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/invoices/seller":{"get":{"summary":"Read the seller details printed on platform invoices (staff-only).","operationId":"invoice_seller_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSeller"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"put":{"summary":"Save the seller details printed on platform invoices (staff-only).","operationId":"invoice_seller_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSeller"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSeller"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/invoices/stripe-ops":{"get":{"summary":"List Stripe follow-ups (schedule releases, invoice voids) and their state (staff-only).","operationId":"stripe_pending_ops_list","parameters":[{"name":"all","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripePendingOpList"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/invoices/stripe-ops/{op_id}/dismiss":{"post":{"summary":"Dismiss a Stripe follow-up with a note after handling it by hand (staff-only).","operationId":"stripe_pending_ops_dismiss","parameters":[{"name":"op_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripePendingOpDismiss"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripePendingOp"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/invoices/sync-stripe":{"post":{"summary":"Backfill the invoice mirror from Stripe for every known Stripe customer (staff-only); returns counts.","operationId":"platform_invoices_sync","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSyncReport"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/invoices/{id}":{"get":{"summary":"Read one invoice of any org, with its lines (staff-only).","operationId":"platform_invoices_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/invoices/{id}/pdf":{"get":{"summary":"Download a platform invoice of any org as PDF (staff-only).","operationId":"platform_invoice_pdf","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/ip-pools":{"get":{"summary":"List IPv4 pools (staff-only).","operationId":"platform_ip_pools_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIpPoolListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create an IP pool (staff-only).","operationId":"platform_ip_pools_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIpPoolCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIpPoolRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/ip-pools/{id}":{"get":{"summary":"Read one IP pool with live usage counters (staff-only). 404 on unknown id.","operationId":"platform_ip_pools_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIpPoolRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete an IP pool (staff-only; refuses while it holds public IPs).","operationId":"platform_ip_pools_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIpPoolDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit an IP pool (staff-only; name/location/notes/prefix_id).","operationId":"platform_ip_pools_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIpPoolPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIpPoolRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/leads":{"get":{"summary":"List captured marketing leads (staff-only, cursor-paginated).","operationId":"leads_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from the previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/network-prefixes":{"get":{"summary":"List network-prefix topology rows (staff-only, cursor-paginated; optional homing / address_family filters).","operationId":"platform_network_prefixes_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformNetworkPrefixListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a network-prefix row (staff-only). Validates CIDR + family match, the address_family / homing enums, the homing↔home_pop_id invariant, and home_pop existence; UNIQUE prefix maps to 422 prefix_taken. Returns the created row.","operationId":"platform_network_prefixes_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformNetworkPrefixCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformNetworkPrefixRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/network-prefixes/{id}":{"delete":{"summary":"Delete one network-prefix row (staff-only). Refused 409 while any IP pool references it (the ip_pools.prefix_id ON DELETE RESTRICT FK); 404 on unknown id.","operationId":"platform_network_prefixes_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformNetworkPrefixDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit one network-prefix row (staff-only). Omitted fields unchanged; text columns empty-string-clear; prefix re-validated for CIDR + family match + uniqueness; the homing↔home_pop_id invariant + home_pop existence re-checked.","operationId":"platform_network_prefixes_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformNetworkPrefixUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformNetworkPrefixRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/notification-templates":{"get":{"summary":"List every notification template (staff-only). The copy the dispatcher renders per (kind, channel, locale); bounded catalog, returned in full ordered by (kind, channel, locale).","operationId":"platform_templates_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTemplateListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Upsert one notification template by (kind, channel, locale) (staff-only). Validates kind against the dispatcher catalog and channel against email/sms/in_app; creates or replaces the subject/body copy. Returns the stored row.","operationId":"platform_templates_upsert","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTemplateUpsertRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTemplateRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"delete":{"summary":"Delete one notification template by (kind, channel, locale) query (staff-only). 404 when absent.","operationId":"platform_templates_delete","parameters":[{"name":"kind","in":"query","description":"Dispatcher event slug.","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","description":"Delivery channel.","required":true,"schema":{"type":"string"}},{"name":"locale","in":"query","description":"Locale tag. Absent ⇒ `\"en\"`.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTemplateDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/notifications":{"get":{"summary":"List notifications across every org (staff-only).","operationId":"platform_list_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformNotificationListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/orgs":{"get":{"summary":"Look up orgs across the platform by name/id/member-email (staff-only, cursor-paginated).","operationId":"platform_orgs_list","parameters":[{"name":"q","in":"query","description":"Free-text lookup: matched against `orgs.name` (substring,\ncase-insensitive), `orgs.id` (exact), and member `users.email`\n(exact). Absent ⇒ no filter.","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous page's `next_cursor`.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformOrgListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/orgs/{id}/beta-features":{"patch":{"summary":"Toggle an org's beta-feature flags, e.g. the QUIC cohort (staff-only).","operationId":"org_beta_features_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgBetaFeaturesUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgBetaFeaturesRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/path-tiers":{"get":{"summary":"List every network-path-tier SKU (incl. hidden / inactive) with the operator-managed columns, for staff path-tier administration (staff-only, unpaginated, operator-curated order).","operationId":"path_tiers_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierAdminListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new tradeable network-path-tier SKU (staff-only). Validates slug grammar + uniqueness and the >= 0 cost CHECKs; returns the created row.","operationId":"path_tiers_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/path-tiers/{id}":{"get":{"summary":"Fetch one network-path-tier SKU's full admin row by id, including the operator-managed columns and hidden / inactive tiers (staff-only).","operationId":"path_tiers_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete one tradeable network-path-tier SKU (staff-only). Refused 409 while any binding references the tier (the bindings.path_tier_id ON DELETE RESTRICT FK); 404 on unknown id.","operationId":"path_tiers_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit one tradeable network-path-tier SKU's operator-controlled columns (staff-only). Omitted fields are unchanged; empty-string clears description; explicit null clears included_gb_per_month; slug re-validated for grammar + uniqueness.","operationId":"path_tiers_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathTierAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/payments":{"get":{"summary":"List payments received and failed or open attempts across all orgs (staff-only), with server-side totals on the first page.","operationId":"platform_payments_list","parameters":[{"name":"cursor","in":"query","description":"Opaque cursor from the previous page.","required":false,"schema":{"type":["string","null"]}},{"name":"limit","in":"query","description":"Page size, 1–200 (default 50).","required":false,"schema":{"type":["integer","null"],"format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org.","required":false,"schema":{"type":["string","null"]}},{"name":"status","in":"query","description":"Only rows with this normalised status.","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/plan-path-tiers":{"get":{"summary":"List every plan↔path-tier grant (included vs overage), optionally filtered by plan_id and / or path_tier_id, for staff path-tier administration (staff-only, unpaginated, id-ascending order).","operationId":"plan_path_tiers_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPathTierAdminListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create one plan↔path-tier grant (included vs overage) for staff path-tier administration (staff-only). Verifies plan_id / path_tier_id reference existing rows (422 not_found), enforces UNIQUE (plan_id, path_tier_id) (409 conflict); returns the created row.","operationId":"plan_path_tiers_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPathTierCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPathTierAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plan-path-tiers/{id}":{"delete":{"summary":"Delete one plan↔path-tier grant (staff-only). plan_path_tiers is a leaf join (nothing references it) so there is no RESTRICT guard; 404 on unknown id.","operationId":"plan_path_tiers_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPathTierDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit one plan↔path-tier grant's included flag and / or optional per-grant overage cap (staff-only). Omitted fields are unchanged; explicit null clears overage_limit_gb_per_month; plan_id / path_tier_id are the grant identity and not patchable.","operationId":"plan_path_tiers_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPathTierUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPathTierAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plan-servers":{"post":{"summary":"Link a server to a plan (staff-only).","operationId":"platform_plan_servers_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanServerCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanServerJoinRow"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plan-servers/{id}":{"delete":{"summary":"Remove a plan↔server link (staff-only).","operationId":"platform_plan_servers_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanServerDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit a plan↔server link (staff-only). Partial update; plan_id/server_id are immutable here.","operationId":"platform_plan_servers_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanServerUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanServerJoinRow"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plans":{"get":{"summary":"List every billing plan including drafts/hidden (staff-only).","operationId":"platform_plans_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new billing plan (staff-only).","operationId":"platform_plans_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plans/{id}":{"get":{"summary":"Read a single plan including draft/hidden columns (staff-only).","operationId":"platform_plans_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a plan (staff-only). 409 when referenced by subscriptions / plan-servers / addons.","operationId":"platform_plans_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit an existing plan (staff-only). Partial update.","operationId":"platform_plans_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plans/{id}/addon-prices":{"put":{"summary":"Set the Stripe prices of a plan's add-ons, per kind and cycle (staff-only).","operationId":"platform_plans_addon_prices","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonStripePrices"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plans/{id}/import-stripe":{"post":{"summary":"Bulk-import existing Stripe subscriptions for this plan (staff-only; idempotent re-runs, unmatched customers skipped, dry_run supported).","operationId":"platform_plans_import_stripe","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanImportStripeRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanImportStripeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/plans/{id}/servers":{"get":{"summary":"List plan-server associations including inactive ones (staff-only).","operationId":"platform_plans_servers_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanServerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/pops":{"get":{"summary":"List PoP topology rows (staff-only, cursor-paginated; optional status filter).","operationId":"platform_pops_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a point-of-presence row (staff-only). Validates slug grammar + uniqueness, status, peering_profile JSON, and the ipv6_only⇒ipv6_enabled CHECK; returns the created row.","operationId":"platform_pops_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/pops/{id}":{"get":{"summary":"Fetch one point-of-presence row by id (staff-only). Customers never see PoP IDs; this is admin topology introspection.","operationId":"platform_pops_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete one point-of-presence row (staff-only). Refused 409 while any server or network-prefix references it (the ON DELETE RESTRICT FKs); 404 on unknown id.","operationId":"platform_pops_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit one point-of-presence row (staff-only). Omitted fields unchanged; text columns empty-string-clear; asn null-clears; slug re-validated for grammar + uniqueness; the ipv6_only⇒ipv6_enabled CHECK is re-evaluated.","operationId":"platform_pops_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/pops/{id}/anycast-status":{"get":{"summary":"Per-prefix anycast advertisement status for one PoP (staff-only): which neighbours announce each advertised prefix, with live session state and the last hour's manual-withdraw count.","operationId":"platform_pops_anycast_status","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopAnycastStatusResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/pops/{id}/drain":{"post":{"summary":"Drain one point-of-presence (staff-only): flip status to draining (stops new ingress, keeps existing flows). 404 on unknown id; idempotent when already draining.","operationId":"platform_pops_drain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPopRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips":{"get":{"summary":"List public IPs (staff-only, cursor-paginated; optional status / org_id / claim_scope / pool_id filters).","operationId":"platform_public_ips_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"status","in":"query","description":"Optional `status` filter\n(`available` / `reserved` / `in_use` / `management` /\n`removed`).","required":false,"schema":{"type":"string"}},{"name":"org_id","in":"query","description":"Optional `org_id` filter (UUIDv7).","required":false,"schema":{"type":"string"}},{"name":"claim_scope","in":"query","description":"Optional `claim_scope` filter (`customer` / `infra` / `any`) —\nthe eligibility axis, independent of `status`.","required":false,"schema":{"type":"string"}},{"name":"pool_id","in":"query","description":"Optional `pool_id` filter (UUIDv7) — narrow to one `ip_pools`\nrow.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a public-IP row (staff-only). Starts available (default) or management; owned states are reached via assign/bind.","operationId":"platform_public_ips_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}":{"get":{"summary":"Read one public-IP row (staff-only). 404 on unknown id.","operationId":"platform_public_ips_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Hard-delete an unowned public-IP row (staff-only). Owned (reserved/in_use) → 409 not_deletable; referenced by any bindings or host_routes row → 409 ip_referenced.","operationId":"platform_public_ips_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}/assign":{"post":{"summary":"Reserve an available public IP for an org (staff-only). Only available → reserved is legal; anything else → 409 bad_transition. An infra-sectioned address → 409 ip_not_available_for_customer (re-section it first).","operationId":"platform_public_ips_assign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpAssignRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}/end-rest":{"post":{"summary":"End the 30-day rest of a released public IP early so it can be assigned again (staff-only). A reason is recorded.","operationId":"platform_public_ips_end_rest","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndRestRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}/force-release":{"post":{"summary":"Force-return a reserved/in_use/management public IP to the pool (staff-only). Refuses while a live binding references it (409 live_binding_exists) or a live infra host-route does (409 live_host_route_exists).","operationId":"platform_public_ips_force_release","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}/reserve-infrastructure":{"post":{"summary":"Reserve a public IP for platform infrastructure (staff-only): sets status=management and claim_scope=infra in one transaction. Idempotent; 404 on unknown id, 409 ip_not_available when the address is owned or not available.","operationId":"platform_public_ips_reserve_infra","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}/route":{"post":{"summary":"Create a pending binding routing an owned public IP into a same-org tunnel (staff-only admin mirror of the customer bind).","operationId":"platform_public_ips_route","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRouteRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformBindingRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}/scope":{"patch":{"summary":"Set a public IP's claim_scope (staff-only): customer / infra / any. Orthogonal to status except while status=management, where widening to customer/any is refused with 409 scope_locked_management (force-release the address first, then re-section it) while tightening to infra is allowed; 404 on unknown id, 422 claim_scope_invalid.","operationId":"platform_public_ips_set_scope","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpSetScopeRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/public-ips/{id}/unassign":{"post":{"summary":"Release a reserved public IP back to the pool (staff-only). in_use → 409 must_unbind_first; only reserved → available is legal.","operationId":"platform_public_ips_unassign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/qos-rules":{"get":{"summary":"List admin traffic-engineering QoS rules with their typed src/flow/target shapes, optionally filtered by org_id / active / priority_lt (staff-only, cursor-paginated, priority-ascending).","operationId":"qos_rules_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleAdminListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create one admin traffic-engineering QoS rule (staff-only). Strict src_match / flow_match / target shapes (unknown key ⇒ 422); action↔target consistency (422); optional org_id pre-checked against orgs (422 not_found); returns the created row.","operationId":"qos_rules_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/qos-rules/test":{"post":{"summary":"Dry-run the admin traffic-engineering rule-set against a sample flow (staff-only, read-only): returns the highest-precedence active in-scope rule the sample matches and its resolved action, or null. Reuses the qos_rule:read gate; no rule state changes.","operationId":"qos_rules_test","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleTestRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleTestResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/qos-rules/{id}":{"get":{"summary":"Fetch one admin traffic-engineering QoS rule's full row by id, including its typed src/flow/target shapes and inactive rules (staff-only).","operationId":"qos_rules_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete one admin traffic-engineering QoS rule (staff-only). qos_rules is a leaf table (nothing references it) so there is no RESTRICT guard; 404 on unknown id.","operationId":"qos_rules_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit one admin traffic-engineering QoS rule (staff-only). Omitted fields unchanged; explicit null clears org_id to a platform-wide rule; src_match / flow_match / target are whole-value-replaced with unknown-key rejection; the action↔target consistency is re-checked on the resolved pair.","operationId":"qos_rules_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QosRuleAdminEntry"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/quic-servers/{id}/bridges":{"get":{"summary":"List a QUIC server's bridge/alternate-endpoint set (staff-only, F-CENS3): the addresses distributed to clients alongside the primary endpoint so a censor blocking one address does not strand them. Ordered by priority ascending then id. 404 unknown server, 422 not a QUIC server.","operationId":"quic_server_bridges_list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeEndpointListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Provision an alternate reachable endpoint (bridge) for a QUIC server so clients are never pinned to one blockable address (staff-only, F-CENS3). Dialed with the server's existing pinned ed25519 identity. 404 unknown server, 422 not a QUIC server, 409 duplicate (server_id, endpoint).","operationId":"quic_server_bridges_create","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBridgeEndpointRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeEndpointRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/quic-servers/{id}/bridges/{bridge_id}":{"delete":{"summary":"Remove a bridge/alternate-endpoint from a QUIC server (staff-only, F-CENS3). Hard delete -- clients pick it up on their next profile poll. 404 unknown bridge or a bridge belonging to a different server.","operationId":"quic_server_bridges_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"bridge_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeEndpointRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/quic-servers/{id}/config":{"get":{"summary":"Read one QUIC infra server's operator-configurable settings (staff-only): quic_mode, quic_listener_count, quic_obfuscation_enabled, masque_enabled, masque_listen_addr, additional_ports, alpn_cutover_at, min_client_version, alpn_set, plus read-only backend_tier + ed25519_public_key + expected_quictun_core_version. ETag-cacheable; matching If-None-Match ⇒ 304.","operationId":"platform_quic_server_config_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Edit a QUIC infra server's operator-configurable settings (staff-only): partial update of quic_mode / quic_listener_count / quic_obfuscation_enabled / masque_enabled / masque_listen_addr / additional_ports / alpn_cutover_at / min_client_version / alpn_set. ed25519 identity, backend_tier, and expected_quictun_core_version are not patchable here.","operationId":"platform_quic_server_config_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerConfig"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/routing-servers":{"get":{"summary":"List routing-agent fleet members (staff-only, cursor-paginated).","operationId":"platform_routing_servers_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformRoutingServerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/routing-servers/{id}":{"get":{"summary":"Read one routing-agent fleet member (staff-only). 404 on unknown id.","operationId":"platform_routing_servers_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformRoutingServerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/security-groups":{"get":{"summary":"List security groups (staff-only, cursor-paginated newest-first; optional owner_scope filter).","operationId":"security_groups_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityGroupListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a security group (staff-only). Created empty and attached to nothing, so it changes no enforcement until a rule and an attachment exist. 409 group_name_taken on a duplicate name within the owner scope; 422 org_not_found when an org-scoped group names an unknown org.","operationId":"security_groups_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityGroupCreate"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityGroupRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/security-groups/{id}":{"get":{"summary":"Read one security group with its rules (oldest-first, the compiler's evaluation order) and its interface attachments (staff-only). 404 on unknown id.","operationId":"security_groups_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityGroupDetail"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a security group (staff-only). 404 on unknown id; 409 group_seeded for a platform default, group_in_use while any interface is still attached, group_referenced while another group's rule names it as a peer. Detach or rewrite those first so the change to enforcement is explicit.","operationId":"security_groups_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityGroupDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Rename or re-describe a security group (staff-only). Label only — rules and attachments have their own operations, so this cannot change what an interface admits. 404 on unknown id; 409 group_name_taken on a duplicate; 409 group_seeded when renaming a platform-seeded default.","operationId":"security_groups_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityGroupPatch"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityGroupRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/servers":{"get":{"summary":"List every WireGuard infra server (staff-only).","operationId":"platform_servers_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformServerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new WireGuard infra server (staff-only). private_key is sealed via AEAD and never echoed back.","operationId":"platform_servers_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformServerCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformServerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/servers/{id}":{"get":{"summary":"Read a single WireGuard infra server (staff-only).","operationId":"platform_servers_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformServerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a WireGuard infra server (staff-only). 409 when referenced as ingress by a binding.","operationId":"platform_servers_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformServerDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Edit a WireGuard infra server (staff-only). Partial update; keys not patchable here. pop_id re-homes the server to a points_of_presence row ('' clears; unknown id 422) — display-only downstream, never a listener restart.","operationId":"platform_servers_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformServerUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformServerRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/services":{"get":{"summary":"List the services this deployment offers (anonymous discovery).","operationId":"services_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/platform/services/{name}":{"get":{"summary":"Read a single service this deployment offers by name.","operationId":"services_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/platform/stripe/payments":{"get":{"summary":"List Stripe checkout sessions (staff-only, cursor-paginated; optional org_id / status filters).","operationId":"platform_stripe_payments_list","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStripePaymentListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/subscriptions":{"get":{"summary":"List subscriptions across every org (staff-only, cursor-paginated).","operationId":"platform_subscriptions_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from the previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Grant a comp/manual subscription to an org (staff-only).","operationId":"platform_subscriptions_grant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionGrantRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/subscriptions/enforce-sweep":{"post":{"summary":"Run an on-demand subscription lifecycle sweep (staff-only); returns per-pass counts.","operationId":"platform_subscriptions_enforce","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnforceSweepResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/subscriptions/sync-stripe":{"post":{"summary":"Reconcile Stripe-backed subscriptions against Stripe (staff-only); returns per-pass counts.","operationId":"platform_subscriptions_sync","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncStripeReport"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/subscriptions/{id}":{"get":{"summary":"Read one subscription by id (staff-only).","operationId":"platform_subscriptions_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Hard-delete a subscription (staff-only). 409 when public_ips / bindings still reference it.","operationId":"platform_subscriptions_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/subscriptions/{id}/bandwidth-limit":{"patch":{"summary":"Override the monthly bandwidth cap for one subscription (staff-only).","operationId":"platform_subscriptions_bandwidth_limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionBandwidthLimitRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionBandwidthLimitResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/subscriptions/{id}/cancel":{"post":{"summary":"Force-cancel a subscription (staff-only). A Stripe-billed one also ends at Stripe, only with stop_stripe_billing=true. Idempotent.","operationId":"platform_subscriptions_cancel","parameters":[{"name":"stop_stripe_billing","in":"query","description":"Required (`true`) for a Stripe-billed subscription: the cancel also\nends the subscription at Stripe now, which stops the customer's\nbilling. Without it a Stripe-billed subscription is refused with 409\n`stripe_cancel_confirmation_required`, so a local-only cancel can\nnever leave the customer paying for nothing.","required":false,"schema":{"type":["boolean","null"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/subscriptions/{id}/reassign":{"post":{"summary":"Re-bind a subscription to a different plan (staff-only). 422 plan_not_found if target unknown.","operationId":"platform_subscriptions_reassign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionReassignRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSubscriptionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/subscriptions/{subscription_id}/protocol-quotas/{protocol}":{"patch":{"summary":"Set monthly_limit_bytes on a subscription's active-period per-protocol quota row.","operationId":"protocol_quota_update","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"protocol","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolQuotaUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolUsageItem"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/suspensions":{"get":{"summary":"List suspensions (email, domain, IP / CIDR); active only unless include_inactive (staff-only).","operationId":"platform_suspensions_list","parameters":[{"name":"include_inactive","in":"query","description":"Include lifted and expired suspensions.","required":false,"schema":{"type":"boolean"}},{"name":"cursor","in":"query","description":"`next_cursor` of the previous page.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size, 1-500 (default 100).","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspensionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Suspend a normalised email, an email domain, or an IP / CIDR, with optional expiry (staff-only).","operationId":"platform_suspensions_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspensionCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspensionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/suspensions/{id}":{"delete":{"summary":"Lift a suspension; the row stays as history (staff-only).","operationId":"platform_suspensions_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspensionRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/topology/map":{"get":{"summary":"Whole-system topology snapshot: servers, agents, orgs with period usage, tunnels with live counters, devices (staff-only).","operationId":"platform_topology_map","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformTopologyMapResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/users":{"get":{"summary":"List users across every org (staff-only, cursor-paginated).","operationId":"platform_users_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from the previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"status","in":"query","description":"Status filter: `active`, `suspended`, `closed` (deleted, within\nthe grace period), `never_signed_in`, or by\naddress verification: `verified` (a login link mailed to the address\nhas been used), `unverified`, `sso`.","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Search: user id, part of the email, or the normalised mailbox\n(Gmail dots and `+tags` folded).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformUserListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/users/bulk-delete":{"post":{"summary":"Remove many spam or abuse accounts at once (staff-only, elevated session): each is erased at once with the note recorded; staff accounts are refused. Returns one result per account.","operationId":"platform_users_bulk_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/clear-stripe":{"post":{"summary":"Clear stripe_customer_id on every user row (staff-only recovery hammer).","operationId":"platform_users_bulk_clear_stripe","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformUserBulkClearStripeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}":{"get":{"summary":"Read a single user by id (staff-only).","operationId":"platform_users_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformUserRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete an account (staff-only, elevated session). standard: closes now, erased after 30 days unless restored. spam: erased at once, nobody emailed, a note required. Staff accounts only by a platform_admin; an admin always remains.","operationId":"platform_users_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Rewrite a user's email / name / platform-role membership (staff-only).","operationId":"platform_users_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformUserUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformUserRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/clear-stripe":{"post":{"summary":"Clear stripe_customer_id on a user (staff-only). Idempotent: NULL → NULL is success.","operationId":"platform_users_clear_stripe","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformUserClearStripeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/closure":{"get":{"summary":"What deleting an account would do (staff-only): subscriptions cancelled with the refund due, resources deleted, teams and memberships, refusals; or how its deletion stands.","operationId":"platform_users_closure_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionImpact"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/users/{id}/devices/{device}/revoke":{"post":{"summary":"Revoke one of a user's client devices; its tunnels disconnect (staff-only).","operationId":"platform_users_device_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"device","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedCount"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/moderation":{"get":{"summary":"Preview suspending an account: devices and tunnels it cuts, live subscription, addresses it could cover (staff-only).","operationId":"platform_users_moderation_preview","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationPreview"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/users/{id}/overview":{"get":{"summary":"Everything staff see about one account: identity, orgs, subscriptions, sessions, devices, sign-in methods, security events and suspensions.","operationId":"platform_users_overview","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOverview"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}}},"/platform/users/{id}/purge-hold":{"post":{"summary":"Place a purge hold on an account (staff-only): it is not erased after deletion until the hold is lifted.","operationId":"platform_users_purge_hold_place","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurgeHoldRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurgeHoldResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}},"delete":{"summary":"Lift an account's purge hold (staff-only, elevated session). A deletion past its grace period resumes on the next pass.","operationId":"platform_users_purge_hold_lift","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurgeHoldResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/reset-sign-in":{"post":{"summary":"Reset a locked-out user's sign-in (staff-only): passkey-only off, authenticator and recovery codes removed, every session signed out, user notified.","operationId":"platform_users_reset_sign_in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetSignInResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/restore":{"post":{"summary":"Restore a deleted account in its grace period (staff-only, elevated session). Sign-in works again; revoked sessions, tokens, devices, teams left and cancelled subscriptions stay as they are.","operationId":"platform_users_restore","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreUserResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/sessions/revoke":{"post":{"summary":"Revoke one of a user's sessions, or all of them (staff-only).","operationId":"platform_users_sessions_revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeSessionsRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedCount"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/suspend":{"post":{"summary":"Suspend an account (no sign-in; credentials and client devices revoked), optionally also its email address, domain and recent addresses (staff-only).","operationId":"platform_users_suspend","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspendRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/unlock":{"post":{"summary":"Clear a brute-force account lockout for a user (staff-only). Idempotent: a user with no lockout row is a success no-op. Unknown user id is 404.","operationId":"account_unlock","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUnlockResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/users/{id}/unsuspend":{"post":{"summary":"Lift an account suspension (staff-only). Email, domain and network suspensions stay until lifted; devices must be enrolled again.","operationId":"platform_users_unsuspend","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/vpn/tunnels":{"get":{"summary":"List tunnels with WG profile fields (staff-only, cursor-paginated; optional org_id / subscription_id / status / type filters).","operationId":"platform_tunnels_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Optional `org_id` filter (UUIDv7).","required":false,"schema":{"type":"string"}},{"name":"subscription_id","in":"query","description":"Optional `subscription_id` filter (UUIDv7).","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Optional `status` filter (`active` / `inactive` / `pending`).","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Optional tunnel-type filter (`wireguard` / `quic`). Aliased\nfrom `type=` on the wire because `type` is a reserved word in\nmany client query-builders.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformTunnelListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Generate a WireGuard tunnel under any org's subscription (staff-only white-glove path).","operationId":"platform_tunnels_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformTunnelCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/platform/vpn/tunnels/{id}":{"delete":{"summary":"Soft-delete any org's WireGuard tunnel (staff-only). Bound IPs flip to reserved; live bindings flip to removing for the agent.","operationId":"platform_tunnels_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/public/leads/contact":{"post":{"summary":"Capture a contact-form message (anonymous; rate-limited; kind in support/sales/press/security).","operationId":"lead_create_contact","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactLeadRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/public/leads/enterprise":{"post":{"summary":"Capture an enterprise sales lead (anonymous; rate-limited; free-email rejected).","operationId":"lead_create_enterprise","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseLeadRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/quic/tunnels":{"get":{"summary":"List QUIC tunnels for the caller's orgs.","operationId":"quic_tunnels_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from a previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new QUIC tunnel.","operationId":"quic_tunnels_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/quic/tunnels/{id}":{"get":{"summary":"Get a single QUIC tunnel.","operationId":"quic_tunnels_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a QUIC tunnel.","operationId":"quic_tunnels_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/quic/tunnels/{id}/config":{"get":{"summary":"Download the quictun-core TOML config for a QUIC tunnel.","operationId":"quic_tunnels_config","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicConfigRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/quic/tunnels/{id}/qr":{"get":{"summary":"Get a PNG QR code of the quictun-core config for a QUIC tunnel.","operationId":"quic_tunnels_qr","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelQrRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/quic/tunnels/{id}/regenerate":{"post":{"summary":"Rotate the ed25519 identity key pair for a QUIC tunnel.","operationId":"quic_tunnels_regenerate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelRegenerateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/quic/tunnels/{id}/usage":{"get":{"summary":"Current-period bandwidth usage for a QUIC tunnel.","operationId":"quic_tunnels_usage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelUsageRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/quic/tunnels/{id}/usage/history":{"get":{"summary":"Paginated traffic-sample history for a QUIC tunnel (90-day window).","operationId":"quic_tunnels_usage_history","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicTunnelUsageHistoryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/quic_server/config":{"get":{"summary":"QUIC infra agent polls its operating config (quic_mode + endpoint + expected_quictun_core_version + masque_enabled + masque_listen_addr). Content-derived ETag; matching If-None-Match ⇒ 304. Caller's agt_ bearer resolves to a servers row with protocol='quic'; wrong-protocol bearer ⇒ uniform 401.","operationId":"quic_server_config","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerConfigResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/quic_server/heartbeat":{"post":{"summary":"QUIC-infra server liveness + per-tick QUIC telemetry. Caller's agt_ bearer resolves to a servers row with protocol='quic'; cross-server / wrong-protocol isolation is structural. Updates last_seen_at + reported_version + appends one sample to the rolling telemetry blob.","operationId":"quic_server_heartbeat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerHeartbeatRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerHeartbeatResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/quic_server/identity":{"post":{"summary":"QUIC infra agent reports the ed25519 public key of its locally-generated engine identity. The private key never transits the API; the recorded public half is what client configs pin. Same-key reports are idempotent; a changed key is an audited rotation.","operationId":"quic_server_identity","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerIdentityRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerIdentityResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/quic_server/peer-status":{"post":{"summary":"Per-peer health beat from a QUIC infra agent (handshake time, byte counters, current endpoint, PQ negotiation flag). Matches reports to quic_tunnels rows by ed25519 pubkey prefix scoped to the caller's server; ambiguous-prefix reports reject per-peer so the agent re-sends with a longer prefix.","operationId":"quic_server_peer_status","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerPeerStatusRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerPeerStatusResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/quic_server/peers":{"get":{"summary":"Per-server QUIC peer roster (tunnel_id + ed25519 pubkey + allowed_ips + keepalive + pq_mode). Caller's agt_ bearer resolves to a servers row with protocol='quic'; cross-server / wrong-protocol isolation is structural. Order is stable so a no-op re-fetch is a byte-identical PeerStore::replace() input.","operationId":"quic_server_peers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerPeersResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/quic_server/traffic":{"post":{"summary":"Bulk ingest QUIC tunnel_traffic_samples from a QUIC infra agent. Caller's agt_ bearer resolves to a servers row with protocol='quic'; samples are auto-tagged protocol='quic' so WG and QUIC samples for the same window stay in separate UNIQUE buckets. Idempotent: absolute-counter retries produce zero delta against bandwidth_quotas.","operationId":"quic_server_traffic","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerTrafficRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuicServerTrafficResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/router/bindings/active":{"get":{"summary":"Routing agent reads the currently-applied binding set for drift detection against its local nft table.","operationId":"active_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveBindingsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/router/bindings/pending":{"get":{"summary":"Routing agent reads the queue of pending bindings it must apply to its local nft table.","operationId":"pending_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingBindingsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/router/bindings/removed":{"get":{"summary":"Routing agent reads the queue of bindings it must remove from its local nft table.","operationId":"removed_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemovedBindingsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/router/bindings/status":{"patch":{"summary":"Routing agent reports a batch of per-binding apply/remove outcomes; per-entry tuple-validated. One bad entry does not abort the batch.","operationId":"bulk_status_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkStatusPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkStatusPatchResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/router/bindings/{id}/status":{"patch":{"summary":"Routing agent reports the outcome of a per-binding apply/remove; tuple-validated against the row's current (public_ip, destination_ip).","operationId":"status_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusPatchResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/router/net-policy/plans":{"get":{"summary":"Routing agent reads the compiled network-policy plan for each active binding it owns, to render the in-path firewall.","operationId":"net_policy_plans_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetPolicyPlansResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/server/heartbeat":{"post":{"summary":"WG-infra server liveness + rolling telemetry beat. Caller's agt_ bearer resolves to the hosting server; admits joined and paused agents (paused is observed-not-acted). Updates last_seen_at + reported_version + appends one telemetry sample.","operationId":"server_heartbeat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerHeartbeatRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerHeartbeatResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/server/peer-status":{"post":{"summary":"Per-peer observation beat from a WG infra agent (latest handshake + absolute kernel byte counters). Matches reports to wireguard_tunnels rows by exact public key scoped to the caller's server; byte counters are converted server-side into tunnel_traffic_samples + bandwidth_quotas deltas with counter-epoch reset handling, so agents stay stateless.","operationId":"server_peer_status","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerPeerStatusRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerPeerStatusResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/server/subscribers":{"get":{"summary":"Per-server WG subscriber list (public_key + allowed_ips). Caller's agt_ bearer resolves to the hosting server; cross-server isolation is structural. Order is stable so a no-op re-fetch produces a byte-identical wg syncconf payload.","operationId":"server_subscribers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerSubscribersResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_read","nist_controls":["AC-3","AU-2","IA-9"],"owasp":["A01:2021"]}}},"/server/traffic":{"post":{"summary":"Bulk ingest tunnel_traffic_samples from a WG infra agent. Caller's agt_ bearer resolves to the hosting server; samples for tunnels not hosted on that server are rejected per-sample with a stable code. Idempotent: absolute-counter retries produce a zero delta against bandwidth_quotas.","operationId":"server_traffic","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerTrafficRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerTrafficResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/server/usage":{"post":{"summary":"Usage report from a WG infra server. Re-syncs servers.current_users from the server's live tunnels (the reported figure is not stored). Identity is the agt_ bearer; structurally self-scoped to the caller's server.","operationId":"server_usage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerUsageRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerUsageResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"agent_write","nist_controls":["AC-3","AU-2","AU-3","IA-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/settings/billing":{"get":{"summary":"Read the platform's billing-policy settings row.","operationId":"billing_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the platform's billing-policy settings row.","operationId":"billing_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/settings/crypto":{"get":{"summary":"Read the platform's crypto-payments settings row.","operationId":"crypto_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the platform's crypto-payments settings row.","operationId":"crypto_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoSettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/settings/email":{"get":{"summary":"Read the platform's email-policy settings row.","operationId":"email_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the platform's email-policy settings row.","operationId":"email_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/settings/email/test":{"post":{"summary":"Send a diagnostic SMTP test message using the platform's email-settings row.","operationId":"email_test","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTestSendRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTestSendResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/settings/security":{"get":{"summary":"Read the platform's security-policy settings row.","operationId":"security_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecuritySettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the platform's security-policy settings row.","operationId":"security_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecuritySettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecuritySettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/settings/stripe":{"get":{"summary":"Read the platform's Stripe-credentials settings row.","operationId":"stripe_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the platform's Stripe-credentials settings row.","operationId":"stripe_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeSettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/settings/system":{"get":{"summary":"Read the platform's system-wide settings row.","operationId":"system_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_read","nist_controls":["AC-3","AC-6","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Rewrite the platform's system-wide settings row.","operationId":"system_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettingsRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"admin_write","nist_controls":["AC-3","AC-6","AU-2","AU-3","AU-9","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/static-ips":{"get":{"summary":"List public IPs claimed by the caller's org.","operationId":"static_ips_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from a previous page's `next_cursor`.\nAbsent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"subscription_id","in":"query","description":"Narrow results to a specific subscription. Absent ⇒ all subscriptions.","required":false,"schema":{"type":"string"}},{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/static-ips/available":{"get":{"summary":"List public IPs available for claiming.","operationId":"static_ips_available_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from a previous page's\n`next_cursor`. Absent ⇒ start at the first row (lowest address).","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"pool_id","in":"query","description":"Narrow results to a specific IP pool. Absent ⇒ all pools.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableIpListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/static-ips/claim-any":{"post":{"summary":"Atomically claim the lowest-numbered available IP in a pool.","operationId":"static_ips_claim_any","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpClaimAnyRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/static-ips/quota":{"get":{"summary":"The caller's static-IP allowance and usage for one subscription.","operationId":"static_ips_quota","parameters":[{"name":"subscription_id","in":"query","description":"Subscription to report the static-IP quota for. Must be owned by\nthe caller's org.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaticIpQuotaRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/static-ips/{id}":{"get":{"summary":"Get a single public IP by id.","operationId":"static_ips_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Retarget an in-use public IP's live binding to a different network path tier.","operationId":"static_ips_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpPatchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/static-ips/{id}/bind":{"post":{"summary":"Bind a reserved public IP to a tunnel.","operationId":"static_ips_bind","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpBindRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/static-ips/{id}/claim":{"post":{"summary":"Claim a specific available public IP.","operationId":"static_ips_claim","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpClaimRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/static-ips/{id}/history":{"get":{"summary":"Cursor-paginated binding-state history for a public IP.","operationId":"static_ips_history","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpHistoryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/static-ips/{id}/release":{"post":{"summary":"Release a reserved public IP back to the available pool.","operationId":"static_ips_release","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpReleaseResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/static-ips/{id}/unbind":{"post":{"summary":"Unbind an in-use public IP from its tunnel.","operationId":"static_ips_unbind","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIpUnbindResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/status/summary":{"get":{"summary":"Current platform status and 90-day uptime, re-served from status.appsynergy.io.","operationId":"status_summary","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusSummaryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/vpn/servers":{"get":{"summary":"List selectable public WireGuard servers (location/region/status).","operationId":"vpn_servers_catalog","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VpnServerListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"public","nist_controls":[],"owasp":[]}}},"/vpn/tunnels":{"get":{"summary":"List WireGuard tunnels for the caller's orgs.","operationId":"tunnels_list","parameters":[{"name":"cursor","in":"query","description":"Opaque base64url-no-pad cursor from a previous page's\n`next_cursor`. Absent ⇒ start at the newest row.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size. Bounded `1 ≤ limit ≤ 200`; default 50.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Only this org's rows (the console's selected workspace). Omit\nfor every org where the caller holds the read action; an org the\ncaller cannot read yields an empty page.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Create a new WireGuard tunnel.","operationId":"tunnels_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/vpn/tunnels/{id}":{"get":{"summary":"Get a single WireGuard tunnel.","operationId":"tunnels_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete a WireGuard tunnel.","operationId":"tunnels_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/vpn/tunnels/{id}/config":{"get":{"summary":"Download the WireGuard INI config for a tunnel.","operationId":"tunnels_config","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WireguardConfigRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/vpn/tunnels/{id}/qr":{"get":{"summary":"Get a PNG QR code of the WireGuard config for a tunnel.","operationId":"tunnels_qr","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelQrRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/vpn/tunnels/{id}/regenerate":{"post":{"summary":"Rotate the WireGuard key pair for a tunnel.","operationId":"tunnels_regenerate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelRegenerateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/vpn/tunnels/{id}/split-tunnel":{"get":{"summary":"Read a WireGuard tunnel's split-tunnel + killswitch configuration.","operationId":"split_tunnel_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitTunnelRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"patch":{"summary":"Update a WireGuard tunnel's split-tunnel + killswitch configuration.","operationId":"split_tunnel_set","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitTunnelUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitTunnelRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/vpn/tunnels/{id}/usage":{"get":{"summary":"Current-period bandwidth usage for a tunnel.","operationId":"tunnels_usage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelUsageRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/vpn/tunnels/{id}/usage/history":{"get":{"summary":"Paginated traffic-sample history for a tunnel (90-day window).","operationId":"tunnels_usage_history","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelUsageHistoryResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}}},"/vpn/tunnels/{tunnel_id}/bandwidth-override":{"get":{"summary":"Read the per-tunnel bandwidth override row for a tunnel.","operationId":"bandwidth_override_get","parameters":[{"name":"tunnel_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelBandwidthOverride"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Remove the per-tunnel bandwidth override row for a tunnel.","operationId":"bandwidth_override_delete","parameters":[{"name":"tunnel_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelBandwidthOverrideDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Upsert the per-tunnel bandwidth override row for a tunnel.","operationId":"bandwidth_override_set","parameters":[{"name":"tunnel_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelBandwidthOverrideUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TunnelBandwidthOverride"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/webhooks":{"get":{"summary":"List outbound webhook endpoints in the caller's orgs, or in the org named by ?org_id= (no secret).","operationId":"webhooks_list","parameters":[{"name":"org_id","in":"query","description":"Only this org's endpoints. Omit for every org where the caller\nmay read webhooks.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"post":{"summary":"Register an outbound webhook endpoint for the caller's org. Returns the HMAC signing secret exactly once.","operationId":"webhooks_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}},"/webhooks/crypto":{"post":{"summary":"Receive and process a crypto payment webhook event.","operationId":"crypto_webhook","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAck"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"webhook","nist_controls":["AU-2","SC-8","SI-10"],"owasp":["A08:2021"]}}},"/webhooks/stripe":{"post":{"summary":"Receive and process a Stripe webhook event.","operationId":"stripe_webhook","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAck"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"webhook","nist_controls":["AU-2","SC-8","SI-10"],"owasp":["A08:2021"]}}},"/webhooks/{id}":{"get":{"summary":"Read one of the caller org's webhook endpoints (no secret). Cross-org / unknown id is 404.","operationId":"webhooks_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_read","nist_controls":["AC-3","AU-2"],"owasp":["A01:2021"]}},"delete":{"summary":"Delete one of the caller org's webhook endpoints. Cross-org / unknown id is 404.","operationId":"webhooks_delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}},"patch":{"summary":"Update one webhook endpoint (url / kinds / status). Cross-org / unknown id is 404.","operationId":"webhooks_update","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRead"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"500":{"description":"Internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"x-security-profile":{"name":"user_write","nist_controls":["AC-3","AU-2","AU-3","SI-10"],"owasp":["A01:2021","A03:2021"]}}}},"components":{"schemas":{"AccountCard":{"type":"object","description":"The card one of an account's organizations has on file, and its\nexception.","required":["org_id","org_name","status","coverable"],"properties":{"brand":{"type":["string","null"],"description":"Card brand, e.g. `visa`."},"coverable":{"type":"boolean","description":"Whether an exception can be granted for this card as it stands: it\nis passing, or refused only for a failed CVC or postal-code check."},"exception":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CardExceptionRead","description":"The live exception for this card, if any."}]},"exp_month":{"type":["integer","null"],"format":"int64","description":"Expiry month, 1 to 12."},"exp_year":{"type":["integer","null"],"format":"int64","description":"Expiry year."},"last4":{"type":["string","null"],"description":"Last four digits."},"org_id":{"type":"string","description":"The organization."},"org_name":{"type":"string","description":"Its name."},"reason":{"type":["string","null"],"description":"Why the card is refused, e.g. `postal_failed`, `prepaid`."},"status":{"type":"string","description":"`valid`, `required` or `disputed`."}}},"AccountCardsResponse":{"type":"object","description":"`GET /platform/card-exceptions/cards` response.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AccountCard"},"description":"One per organization of the account that has a card on record."}}},"AccountDeletionListResponse":{"type":"object","description":"`GET /platform/account-deletions` response.","required":["deletions"],"properties":{"deletions":{"type":"array","items":{"$ref":"#/components/schemas/AccountDeletionRead"},"description":"Newest first, at most 200."}}},"AccountDeletionRead":{"type":"object","description":"One deletion, for staff.","required":["id","user_id","email","status","mode","reason","requested_at","purge_after","attempts"],"properties":{"attempts":{"type":"integer","format":"int64","description":"Failed runs in a row."},"billing_done_at":{"type":["string","null"],"description":"Billing stopped."},"completed_at":{"type":["string","null"],"description":"Finished."},"email":{"type":"string","description":"Its address (the erased placeholder once erased)."},"erased_at":{"type":["string","null"],"description":"Personal data erased."},"failed_at":{"type":["string","null"],"description":"When it was handed to staff."},"id":{"type":"string","description":"Its id."},"last_error":{"type":["string","null"],"description":"The last failure."},"mode":{"type":"string","description":"`standard` or `immediate`."},"note":{"type":["string","null"],"description":"Staff's note."},"purge_after":{"type":"string","description":"When the purge may start."},"reason":{"type":"string","description":"Why."},"requested_at":{"type":"string","description":"When it was asked for."},"status":{"type":"string","description":"`scheduled`, `purging`, `completed`, `failed`, `cancelled`."},"user_id":{"type":"string","description":"The account."}}},"AccountDeletionRetryResponse":{"type":"object","description":"`POST /platform/account-deletions/{id}/retry` response.","required":["status"],"properties":{"status":{"type":"string","description":"Its status after the run."}}},"AccountRestoreRequest":{"type":"object","description":"`POST /auth/account/restore` body.","required":["token"],"properties":{"token":{"type":"string","description":"The token from the emailed link."}}},"AccountRestoreResponse":{"type":"object","description":"`POST /auth/account/restore` response.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on success."}}},"AccountUnlockResponse":{"type":"object","description":"`POST /platform/users/{id}/unlock` response.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"ActivationDismissResponse":{"type":"object","description":"Response body for `POST /iam/orgs/{org_id}/activation-status/dismiss`.\n\nEchoes the persisted `dismissed_at` stamp so the caller can reconcile\noptimistic UI state with the server's truth. The write is idempotent:\na repeat dismiss returns the original stamp rather than overwriting it.","required":["dismissed_at"],"properties":{"dismissed_at":{"type":"string","description":"The RFC3339 moment the checklist was dismissed — the pre-existing\nstamp on a repeat call, or the freshly written one on the first."}}},"ActivationStatus":{"type":"object","description":"Response body for `GET /iam/orgs/{org_id}/activation-status`.\n\n`steps` is the ordered four-step checklist. `dismissed_at` carries the\nRFC3339 moment the calling user dismissed the finished checklist\n(`users.activation_completed_at`), or `None` when they have not — the\ndashboard hides the card once this is set so a completed checklist does\nnot nag on every load. `dismissed_at` is `None` for any non-user\nprincipal (an API token has no personal onboarding state).","required":["steps"],"properties":{"dismissed_at":{"type":["string","null"],"description":"When the calling user dismissed the finished checklist, RFC3339;\n`None` if not yet dismissed or the principal is not a user."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/ActivationStep"},"description":"The ordered activation steps with their live completion state."}}},"ActivationStep":{"type":"object","description":"One row of the activation checklist. `id` is the stable machine slug\n(`connect_device`, `invite_teammate`, …) the frontend keys off;\n`label` is the human-facing text; `completed` is computed live from\nthe org's rows; `primary_cta_url` is the app-relative route the\nstep's call-to-action links to.","required":["id","label","completed","primary_cta_url"],"properties":{"completed":{"type":"boolean","description":"Whether the org has satisfied this step, computed at read time\nfrom the relevant table count (`true` once the count clears the\nstep's threshold). The sign-up step is always `true` — reaching\nthis endpoint proves an account exists."},"id":{"type":"string","description":"Stable machine slug for the step (e.g. `connect_device`). The\nfrontend keys rendering and CTA wiring off this, never off the\nhuman label, so re-wording `label` never breaks the UI."},"label":{"type":"string","description":"Human-readable step label shown in the checklist card."},"primary_cta_url":{"type":"string","description":"App-relative route the step's primary call-to-action links to\n(e.g. `/onboarding/connect-device`). Always a first-party path;\nnever an external or user-supplied URL."}}},"ActiveBindingRead":{"type":"object","description":"One active binding row the agent has applied to its local nft\n`appsynergy` table. The handler joins `bindings`–`public_ips`\nso the agent receives the resolved `public_ip` address rather\nthan the foreign-key id (the agent has no way to dereference\n`public_ips.id` on its own).\n\nField set mirrors [`super::pending_types::PendingBindingRead`]\nwith one substitution: `applied_at` replaces `created_at` because\nan active row's interesting timestamp is the agent's reported\napply moment, not the row's birth. The agent's drift counters\nuse this value to compute apply-to-drift latency.","required":["id","public_ip","destination_ip","rule_type","priority","routing_server_id","applied_at"],"properties":{"applied_at":{"type":"string","format":"date-time","description":"Timestamp the binding entered the `active` state — i.e. the\nagent's prior PATCH back through reported a successful\napply at this moment. RFC3339 wire form. Always present for\nrows in `status = 'active'`; the SELECT predicate's status\nfilter is the source-of-truth that guarantees this."},"dest_ports":{"type":["string","null"],"description":"Optional port-forward subset for the binding. `None` means\nfull-IP routing (the legacy default); `Some` carries a\ncomma-separated proto/port list like\n`\"tcp/443,udp/53,tcp/8080-8090\"` exactly as stored on\n`bindings.dest_ports`. Surfaced on the wire because the\nrouter fingerprint hashes over this column — without\nit, two bindings to the same `(public_ip, destination_ip,\nrule_type)` triple but with different port subsets would\nhash identically and a silent drift could land. The agent's\napply path also consumes this value to construct the correct\nnft expression."},"destination_ip":{"type":"string","description":"Internal target the binding forwards to. Stored directly on\n`bindings.destination_ip`. The tuple validator\n(`(public_ip, destination_ip)` must match the DB row) reads\nthis same column on the PATCH-back path."},"id":{"type":"string","description":"Binding row id. The agent feeds this back through the\n`PATCH /router/bindings/{id}/status` when reporting a\nstate transition (apply success, apply failure, removal)."},"priority":{"type":"integer","format":"int64","description":"nft rule priority for tie-breaking when multiple bindings\nmatch the same flow. Stored on `bindings.priority`."},"public_ip":{"type":"string","description":"Public-facing IP the binding routes. Resolved from the\n`public_ips.ip_address` column via JOIN; the agent never\nhas to dereference `public_ip_id` on its own."},"routing_server_id":{"type":"string","description":"The `routing_servers.id` row this binding is scoped to. The\nAPI already filters by this column against the auth'd\nagent's ownership; surfacing the value lets the agent's\ndrift-check path sanity-check its own identity without a\nsecond round-trip to `/router/config`."},"rule_type":{"$ref":"#/components/schemas/RouterRuleType","description":"Rule kind. Mirrors the `bindings.rule_type` CHECK\nconstraint via the shared [`RouterRuleType`] enum."},"tunnel_server_endpoint":{"type":["string","null"],"description":"Host part of the tunnel's WG server `servers.endpoint`\n(e.g. `64.112.14.13`), when this row is a tunnel binding.\n`None` for `host_routes` rows (no tunnel). The router agent\nmaps the last octet onto the host↔WG veth nexthop\n(`ops/compose/wg-veth.sh`: `.11`/`.12`/`.13`) so it can\ninstall a per-peer overlay `/32`."}}},"ActiveBindingsResponse":{"type":"object","description":"Response shape for `GET /router/bindings/active`. The `bindings`\narray is `[]` when the auth'd agent has no active bindings.\n\n`server_time` is a server-derived \"now\" so the agent's drift\nmetrics can use a clock that is consistent with the API's view\nof time (mirrors the heartbeat and pending contracts\nwhere the handler's `now` is the canonical sample timestamp).","required":["bindings","server_time"],"properties":{"bindings":{"type":"array","items":{"$ref":"#/components/schemas/ActiveBindingRead"},"description":"Zero or more active binding rows scoped to the auth'd\nagent's `routing_servers` ownership. Order is stable —\n`(id ASC)` — so the SHA-256 ETag computed on the handler\nside is byte-deterministic for a given active set."},"removed_ids":{"type":"array","items":{"type":"string"},"description":"Ids of this agent's routes that are deliberately not in `bindings`:\nno longer active, deleted, or moved to another routing server. A\nroute the agent has applied that is in neither list went missing\nwithout the control plane meaning it to."},"server_time":{"type":"string","format":"date-time","description":"Server-derived \"now\" for the agent's drift / latency\nmetrics. RFC3339 wire form."}}},"AddonCreateRequest":{"type":"object","description":"Request body for `POST /billing/subscriptions/{id}/addons`.\n`type` is renamed via `#[serde(rename = \"type\")]` so the wire\nsurface matches the schema column name; `tunnel_type` is required\nfor `type=\"tunnel\"` and forbidden for `type=\"static_ip\"` (the\nschema CHECK constraint backs both at the SQL layer).","required":["type","quantity"],"properties":{"quantity":{"type":"integer","format":"int64","description":"Slot count the addon grants. Must be `>= 1`."},"tunnel_type":{"type":["string","null"],"description":"Tunnel kind for `type=\"tunnel\"` addons. One of `nat` /\n`static`. Absent / surfaces 422 `tunnel_type_invalid` when\nmissing for `type=\"tunnel\"` or present for `type=\"static_ip\"`."},"type":{"type":"string","description":"One of `tunnel` / `static_ip`. Surfaces 422\n`addon_type_invalid` for any other value."}}},"AddonListResponse":{"type":"object","description":"Wire response for `GET /billing/subscriptions/{id}/addons`. One-\narray envelope plus an opaque `next_cursor` token. Mirrors the\n`SubscriptionListResponse` precedent in the sibling `types.rs`\nand the `audit::types::AuditEventListResponse` precedent it\nitself mirrored.\n\n`next_cursor` is `None` on the last page (the page returned\nfewer than `limit` rows); a non-null cursor MUST be passed back\nverbatim on the follow-up call. The cursor codec ships with the\nmatching list handler (the sub-goal); at this layer only\nthe wire shape is fixed so frontends consuming the response\nalready see the field.","required":["addons"],"properties":{"addons":{"type":"array","items":{"$ref":"#/components/schemas/AddonRead"},"description":"Addons for the resolved subscription, in the server-\ndetermined order. The handler PR pins the ordering\n(`(created_at DESC, id DESC)` per the /\n`audit_events_list` precedent); the type carries no\nordering guarantee on its own — frontends MUST render in\nvector order."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-encoded cursor for the next page; `null`\nwhen the current page is the last."}}},"AddonPreviewRead":{"type":"object","description":"What buying an add-on will charge now.","required":["amount_due_now","currency","unit_price","billing_cycle","paid"],"properties":{"amount_due_now":{"type":"integer","format":"int64","description":"Charged now for the rest of the period, minor units."},"billing_cycle":{"type":"string","description":"The subscription's cycle the add-on renews on."},"currency":{"type":"string","description":"ISO currency."},"paid":{"type":"boolean","description":"`false` when the add-on is free (nothing is charged)."},"unit_price":{"type":"number","format":"double","description":"The add-on's list price per unit per cycle, major units."}}},"AddonRead":{"type":"object","description":"One row of `GET /billing/subscriptions/{subscription_id}/addons`.\nMirrors every customer-relevant\ncolumn of the `subscription_addons` table (migration 0003\n`0003_billing_init.sql`) projected to the wire.\n\n`tunnel_type` is `Option<String>` because the schema column is\nnullable: the CHECK constraint admits `NULL` when\n`type='static_ip'` and `'nat' | 'static'` when `type='tunnel'`.\nThe wire keeps the same nullability so a frontend rendering an\naddon list does not have to special-case the absent-key form.\n\n`stripe_product_id` and `stripe_price_id` are surfaced for the\nsame reason `SubscriptionRead.stripe_subscription_id` /\n`stripe_customer_id` are: they are public-by-design correlation\nhandles the customer already sees in their Stripe portal, not\nsecrets. Binds only on column names matching\n`*_password|*_secret|*_token|api_key|...`; these are exempt.","required":["id","subscription_id","org_id","type","quantity","price_per_unit","total_price","billing_cycle","status","created_at"],"properties":{"billing_cycle":{"type":"string","description":"One of `monthly` / `biweekly` / `annual`\n(`subscription_addons.billing_cycle`). The schema CHECK\nconstraint guarantees the value is one of those three."},"cancelled_at":{"type":["string","null"],"description":"RFC3339 UTC timestamp the customer issued the cancel-at-\nperiod-end action (`subscription_addons.cancelled_at`). NULL\nfor addons that have never been cancelled."},"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp\n(`subscription_addons.created_at`)."},"expires_at":{"type":["string","null"],"description":"RFC3339 UTC end of the addon's active window\n(`subscription_addons.expires_at`). NULL for an evergreen\naddon (auto-renews with the subscription); a non-null value\nis the boundary the lifecycle worker hard-deletes the row\npast."},"id":{"type":"string","description":"UUIDv7 primary key (`subscription_addons.id`). RFC4122 string\nform on the wire — matches the rest of the customer-facing\nread shapes."},"org_id":{"type":"string","description":"Owning org (`subscription_addons.org_id`). The caller's\nprincipal must hold `billing:addon:read` against this org for\nthe row to surface."},"price_per_unit":{"type":"number","format":"double","description":"Per-slot price at the time the addon was created\n(`subscription_addons.price_per_unit`). Pinned at create\ntime — plan price changes do not retroactively re-price an\nactive addon."},"quantity":{"type":"integer","format":"int64","description":"Number of slots the addon grants\n(`subscription_addons.quantity`). The schema CHECK\nconstraint guarantees `quantity > 0`; the wire mirrors as\n`i64` (matching every other count surfaced by the billing\narea)."},"status":{"type":"string","description":"One of `active` / `cancelled`\n(`subscription_addons.status`). Customer-driven cancel sets\n`cancelled` (with `cancelled_at=now()`); the lifecycle\nworker hard-deletes the row after `expires_at` passes."},"stripe_price_id":{"type":["string","null"],"description":"Stripe price identifier when the addon is Stripe-managed\n(`subscription_addons.stripe_price_id`). NULL for an addon\ncreated outside the Stripe coupling path."},"stripe_product_id":{"type":["string","null"],"description":"Stripe product identifier when the addon is Stripe-managed\n(`subscription_addons.stripe_product_id`). NULL for an addon\ncreated outside the Stripe coupling path."},"subscription_id":{"type":"string","description":"Subscription the addon belongs to\n(`subscription_addons.subscription_id`). Joins to\n`subscriptions.id`; the resolver scopes the read to the\ncaller-resolvable subscription (the same path-parameter that\nframes the URL)."},"total_price":{"type":"number","format":"double","description":"`quantity * price_per_unit` at create time\n(`subscription_addons.total_price`). Materialised on the row\nrather than recomputed so a future plan-price-change does\nnot silently rewrite the customer's invoice line."},"tunnel_type":{"type":["string","null"],"description":"Tunnel kind for `type='tunnel'` addons\n(`subscription_addons.tunnel_type`). One of `nat` / `static`,\nor `null` for `type='static_ip'` addons. The schema CHECK\nconstraint enforces the per-type nullability."},"type":{"type":"string","description":"Addon kind (`subscription_addons.type`). One of `tunnel` /\n`static_ip`; the schema CHECK constraint guarantees the\nvalue. Renamed from the Rust keyword `type` via\n`#[serde(rename = \"type\")]` so the wire mirrors the schema\ncolumn name."}}},"AddonStripePrices":{"type":"object","description":"Stripe price ids for a plan's add-ons. A Stripe subscription's items\nall renew on one interval, so each cycle needs its own price.","properties":{"ip_annual":{"type":["string","null"],"description":"Extra dedicated IP, annual."},"ip_biweekly":{"type":["string","null"],"description":"Extra dedicated IP, biweekly."},"ip_monthly":{"type":["string","null"],"description":"Extra dedicated IP, monthly."},"tunnel_annual":{"type":["string","null"],"description":"Extra tunnel, annual."},"tunnel_biweekly":{"type":["string","null"],"description":"Extra tunnel, biweekly."},"tunnel_monthly":{"type":["string","null"],"description":"Extra tunnel, monthly."}}},"AgentBinaryArch":{"type":"string","description":"Closed per-arch enum: the rust target triples the release\npipeline (`ops/release.sh`) builds and cosign-signs. Each\nvariant serialises to / deserialises from its triple string, so\nan `arch` query value outside this set is a serde reject (`400`)\nat the extractor — the agent must name a supported target or be\nrefused at the boundary (the `RouterRuleType` closed-enum\nprecedent). Agents run on platform containers / hosts (Linux) today;\nthe darwin / windows triples are the userspace-client targets\n`quictun-core` already supports, listed so the one download\nsurface serves every agent build without a schema change when a\nnon-Linux node joins.","enum":["x86_64-unknown-linux-gnu","aarch64-unknown-linux-gnu","x86_64-unknown-linux-musl","aarch64-unknown-linux-musl","x86_64-apple-darwin","aarch64-apple-darwin","x86_64-pc-windows-msvc"]},"AgentBinaryResponse":{"type":"object","description":"Response body for `GET /agents/me/binary`. Points the\nagent at the version-and-arch-pinned artifact plus its cosign\nsignature. Self-scoped — the handler resolves the agent strictly\nfrom the `agt_` bearer hash, so this body only ever describes the\ncaller's operator-pinned target (the cross-agent guarantee is\nstructural, no id in the path).","required":["version","arch","download_url","signature_url"],"properties":{"arch":{"type":"string","description":"The resolved target triple (echo of the validated `arch`\nquery)."},"download_url":{"type":"string","description":"Immutable, version-and-arch-pinned artifact URL\n(`<channel>/<version>/appsynergy-agent-<triple>`). The bytes\nbehind it cannot change without failing the cosign\nverification, so the path itself is the integrity pin."},"signature_url":{"type":"string","description":"Companion cosign signature URL (`<download_url>.sig`). The\nagent verifies the downloaded artifact against the\nrepo-checked-in public key before swapping the\nbinary; a verification failure aborts the self-update."},"version":{"type":"string","description":"The served version — always equal to the agent's\noperator-pinned `expected_version` (echoed so the agent can\nassert it pulled the intended build)."}}},"AgentCapabilityReport":{"type":"object","description":"One capability's slice of a heartbeat\n(`{ name, protocol_version, fingerprint_sha256, telemetry }`).\n\n`name` is a capability slug (the `serde(rename_all = \"snake_case\")`\nform of [`super::super::iam::principal::AgentCapability`], e.g.\n`router`, `dns`, `wg_server`). `protocol_version` is the wire\nprotocol the agent's capability module speaks; the server\ncompares it to its own supported version (a skew is recorded in\ntelemetry, never auto-mutates the operator-pinned\n`expected_version`). `fingerprint_sha256` is the\nSHA-256 the agent computed over its local state; the\nhandler recomputes the canonical server-side fingerprint of the\ncorresponding DB rows and flags drift on mismatch.","required":["name","protocol_version","fingerprint_sha256","telemetry"],"properties":{"fingerprint_sha256":{"type":"string","description":"The agent-computed SHA-256 (lowercase hex) over its\nlocal capability state. Non-empty, length-bounded (a\ncanonical hex SHA-256 is 64 chars)."},"name":{"type":"string","description":"Capability slug (e.g. `router`, `dns`, `wg_server`).\nNon-empty, length-bounded."},"protocol_version":{"type":"integer","format":"int64","description":"The wire protocol version the agent's capability module\nspeaks. `min = 1` — protocol versions start at 1."},"telemetry":{"$ref":"#/components/schemas/AgentCapabilityTelemetry","description":"This capability's telemetry counters (typed optional\nsuperset). Validated nested."}}},"AgentCapabilityTelemetry":{"type":"object","description":"Typed optional superset of every per-capability telemetry field\nthe unified agent reports (example bodies). Each\nfield is `Option<…>`: an agent fills only the fields its\ncapability emits (`router` the nft counters, `dns` the resolver\ncounters, `wg_server` the peer counts) and omits the rest. The\ntyped shape keeps the wire free of ad-hoc untyped JSON;\nthe counters carry `range(min = 0)` (a negative\ncount is a malformed agent) and `cache_hit_rate` is a ratio\nbounded `[0.0, 1.0]`.","properties":{"apply_failures_total":{"type":["integer","null"],"format":"int64","description":"`router`: cumulative count of failed rule-apply attempts."},"bgp_peers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/BgpPeerSessionTelemetry"},"description":"`bgp_speaker`: per-neighbour session states.\nAbsent for non-speaker capabilities; an enabled speaker with\nzero configured peers reports an empty array."},"blocks_5min":{"type":["integer","null"],"format":"int64","description":"`dns`: queries blocked by a filter list in the last 5 minutes."},"cache_hit_rate":{"type":["number","null"],"format":"double","description":"`dns`: resolver cache hit ratio, bounded `[0.0, 1.0]`."},"dnat_count":{"type":["integer","null"],"format":"int64","description":"`router`: count of installed DNAT rules."},"drift_count":{"type":["integer","null"],"format":"int64","description":"`router`: count of bindings whose local nft state disagrees\nwith the agent's expected set (the agent's own local drift\ntally, distinct from the server-side fingerprint drift the\nhandler computes)."},"fwd_count":{"type":["integer","null"],"format":"int64","description":"`router`: count of installed forward rules."},"handshakes_5min":{"type":["integer","null"],"format":"int64","description":"`wg_server`: completed handshakes in the last 5 minutes."},"mem_bytes":{"type":["integer","null"],"format":"int64","description":"`dns`: resolver resident memory in bytes."},"peer_count":{"type":["integer","null"],"format":"int64","description":"`wg_server`: count of configured WireGuard peers."},"queries_5min":{"type":["integer","null"],"format":"int64","description":"`dns`: queries served in the last 5 minutes."},"roster_refused":{"type":["boolean","null"],"description":"`router` / `wg_server`: the agent's roster guard is refusing the\ncontrol plane's current answer and keeping what it has applied."},"snat_count":{"type":["integer","null"],"format":"int64","description":"`router`: count of installed SNAT rules."}}},"AgentConfigResponse":{"type":"object","description":"Response body for `GET /agents/me/config`. The\nauthenticated fleet agent's operating config: the opaque\n`version` tag (also the `ETag` header), the operator-set\n`expected_version` the agent self-updates toward, and the\nper-capability config block. Self-scoped — the handler resolves\nthe row strictly from the `agt_` bearer hash\n(`WHERE agent_key_hash = ?`), so this body can only ever\ndescribe the caller (the cross-agent guarantee is structural, no\nid in the path).","required":["version","config"],"properties":{"config":{"$ref":"#/components/schemas/AgentJoinConfig","description":"The per-capability config block (see [`AgentJoinConfig`]):\nthe `routing_servers` / `dns_servers` / `servers` ids whose\n`agent_id` FK points back at this agent, plus\n`heartbeat_interval_seconds`. Each `*_server_id` is `None`\nwhen the agent owns no row in that table (it does not carry\nthat capability, or the operator has not linked the\nresource) — the FK is the source of truth, the same outcome\nas the capability-gated build and the `/agents/me`\nread."},"expected_image_version":{"type":["string","null"],"description":"The operator-pinned OS-image target\n(`agents.expected_image_version`, 0223, pinned via the same\nPATCH). `null` when unpinned or the agent has no image\nmanagement. The agent fleet-rolls (via `GET /agents/me/image`\nthen the `POST /agents/me/image` report) whenever its running\nimage version differs from this target."},"expected_version":{"type":["string","null"],"description":"The operator-set target version (`agents.expected_version`,\npinned via the `PATCH /platform/agents/{id}`). `null`\nwhen the operator has not pinned a target. The agent\nself-updates (via the `GET /agents/me/binary` then the\n`POST /agents/me/version` report) whenever its\n`reported_version != expected_version`."},"version":{"type":"string","description":"Opaque, content-derived version tag — a SHA-256 over the\noperator-mutable fields (`expected_version`, `status`,\n`updated_at`, and the per-cap owned ids). Identical to the\n`ETag` response header value. The agent treats it as opaque\nand feeds it back verbatim through `If-None-Match` on the\nnext poll; a mismatch (operator PATCH, or a per-cap\nresource link) surfaces the new body once and cuts a pending\n`?wait` long-poll short."}}},"AgentCpuJiffies":{"type":"object","description":"Cumulative CPU time in jiffies (mirror of the agent's `CpuJiffies`).\n`idle` is idle + iowait; utilisation over an interval is\n`1 - Δidle/Δtotal`.","required":["total","idle"],"properties":{"idle":{"type":"integer","format":"int64","description":"Idle + iowait jiffies since boot.","minimum":0},"total":{"type":"integer","format":"int64","description":"Sum of all CPU-time columns since boot.","minimum":0}}},"AgentDetailResponse":{"type":"object","description":"Response envelope for `GET /platform/agents/{id}`. The full\n[`AgentRead`] record for one agent plus the per-capability\nresource rows linked to it by `agent_id`, grouped by FK owner.\nEach list is `[]` when the agent carries no row of that kind.","required":["agent","routing_servers","dns_servers","wg_servers","health"],"properties":{"agent":{"$ref":"#/components/schemas/AgentRead","description":"The agent's own record — identical projection to the\nlist row (`agent_key_hash` never on the wire)."},"dns_servers":{"type":"array","items":{"$ref":"#/components/schemas/AgentLinkedResource"},"description":"`dns_servers` rows whose `agent_id` is this agent (the\n`dns` capability). `[]` if none."},"health":{"$ref":"#/components/schemas/NodeHealth","description":"Health verdict rolled up from the latest host sample + liveness\n(heartbeat staleness, disk/memory/load thresholds). `Ok` with no\nsignals when the node has reported nothing yet — absence of data\nis unknown, not unhealthy."},"host_metrics":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AgentHostMetrics","description":"The node's most recent host resource sample (CPU/load, memory,\ndisk, network) from the rolling heartbeat telemetry blob.\n`None` when the agent has never reported one (never heartbeated,\na pre-host-metrics agent, or a node whose `/proc` read missed).\nThe dashboard derives rates (CPU %, network throughput) by\ndiffing two polled samples of this cumulative-counter shape."}]},"routing_servers":{"type":"array","items":{"$ref":"#/components/schemas/AgentLinkedResource"},"description":"`routing_servers` rows whose `agent_id` is this agent (the\n`router` capability). `[]` if none."},"wg_servers":{"type":"array","items":{"$ref":"#/components/schemas/AgentLinkedResource"},"description":"`servers` (WG infra) rows whose `agent_id` is this agent\n(the `wg_server` capability). `[]` if none."}}},"AgentFilesystemMetrics":{"type":"object","description":"Capacity + inode usage for one filesystem (mirror of the agent's\n`FilesystemMetrics`).","required":["mount_point","fstype","total_bytes","available_bytes","used_bytes","inodes_total","inodes_free"],"properties":{"available_bytes":{"type":"integer","format":"int64","description":"Unprivileged-available bytes.","minimum":0},"fstype":{"type":"string","description":"Filesystem type (e.g. `ext4`, `overlay`)."},"inodes_free":{"type":"integer","format":"int64","description":"Free inodes.","minimum":0},"inodes_total":{"type":"integer","format":"int64","description":"Total inodes.","minimum":0},"mount_point":{"type":"string","description":"Mount point (e.g. `/`, `/var/lib/appsynergy`)."},"total_bytes":{"type":"integer","format":"int64","description":"Total capacity in bytes.","minimum":0},"used_bytes":{"type":"integer","format":"int64","description":"`total - available` — bytes in use.","minimum":0}}},"AgentHeartbeatRequest":{"type":"object","description":"Request body for `POST /agents/heartbeat`. Every scalar is\nrequired and length-bounded; `capabilities` is validated nested\n(each report's sub-fields are checked in the same\n`req.validate()?` pass) so a malformed body never reaches the\n`agents` upsert.","required":["reported_version","build_commit","hostname","started_at","self_status","capabilities"],"properties":{"build_commit":{"type":"string","description":"The agent binary's build commit. Not an `agents` column —\nrolled into the telemetry sample for build traceability.\nNon-empty, length-bounded."},"capabilities":{"type":"array","items":{"$ref":"#/components/schemas/AgentCapabilityReport"},"description":"One report per capability the agent carries. Validated\nnested; bounded to [`AGENT_HB_CAPABILITIES_MAX`]."},"host":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AgentHostMetrics","description":"Point-in-time host resource sample (CPU/load, memory, disk,\nnetwork). `None` when the node's sampler could not read `/proc`\n— the heartbeat still succeeds; host telemetry is best-effort\nand unvalidated (observational, not a request gate)."}]},"hostname":{"type":"string","description":"The node's hostname (as the agent currently sees it).\nRecorded in the telemetry sample; the authoritative\n`agents.hostname` is set at join. Non-empty,\nlength-bounded."},"reported_version":{"type":"string","description":"The agent binary's current version. Upserted to\n`agents.reported_version`. Non-empty, length-bounded."},"self_status":{"$ref":"#/components/schemas/AgentSelfStatus","description":"The agent's self-reported lifecycle view (informational; see\n[`AgentSelfStatus`])."},"started_at":{"type":"string","format":"date-time","description":"When the agent process started (RFC3339). Recorded in the\ntelemetry sample so the dashboard derives uptime server-side\nwithout a clock-skew-prone `uptime_seconds` field."}}},"AgentHeartbeatResponse":{"type":"object","description":"Response body for `POST /agents/heartbeat`.\n\n`expected_version` is the operator-pinned target verbatim from\n`agents.expected_version` (`None` when unpinned). The heartbeat\nnever mutates that column — there is never a heartbeat-driven\ndrift-mutator and keeps the target operator-owned;\nsurfacing it here is the carrier by which the agent self-updates\ntoward the operator's target. `drift_detected` lists the\ncapability slugs whose agent-reported fingerprint disagreed with\nthe server-computed canonical fingerprint (empty on the clean\npath); the same set is the metadata of the one\n`platform:fleet:drift_detected` audit row emitted when it is\nnon-empty.\n\nResponse-only — no `Validate` (the wire never carries a\nclient-supplied heartbeat *response*). Derives\n`ToSchema`, registered in `spec.rs`.","required":["ok","drift_detected"],"properties":{"drift_detected":{"type":"array","items":{"type":"string"},"description":"Capability slugs whose reported fingerprint disagreed with\nthe server-computed canonical fingerprint. `[]` on the clean\npath."},"expected_version":{"type":["string","null"],"description":"`agents.expected_version` verbatim — the operator-pinned\nself-update target, or `None` if unpinned. Never mutated by\nthe heartbeat."},"ok":{"type":"boolean","description":"Always `true` on the 200 path (liveness recorded). Present\nfor forward-compatible envelope shape."}}},"AgentHostMetrics":{"type":"object","description":"Point-in-time host resource sample carried on the heartbeat — the CP\nmirror of the agent's `host_metrics::HostMetrics`. The CP never shares\nthe agent crate's types (the deliberate heartbeat DTO-duplication), so\nthis is the wire contract the CP deserializes, stores in the rolling\ntelemetry blob, and re-serves on the fleet detail read. Every field is\noptional / defaulted so a partial sample (an older agent, or a node\nwhose `/proc` read missed) still round-trips. Not validated — host\ntelemetry is observational, never a request gate (applies to the\noperator-controlled scalars, not this best-effort blob).","properties":{"cpu":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AgentCpuJiffies","description":"Cumulative CPU jiffies; two samples give a utilisation %."}]},"cpu_cores":{"type":["integer","null"],"format":"int32","description":"Online CPU count (the divisor for interpreting load average).","minimum":0},"filesystems":{"type":"array","items":{"$ref":"#/components/schemas/AgentFilesystemMetrics"},"description":"One entry per real mounted filesystem."},"interfaces":{"type":"array","items":{"$ref":"#/components/schemas/AgentInterfaceMetrics"},"description":"One entry per network interface (loopback excluded); byte/packet\ncounters are cumulative, so two samples give throughput."},"load_avg":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AgentLoadAvg","description":"1/5/15-minute load averages."}]},"md_arrays":{"type":"array","items":{"$ref":"#/components/schemas/AgentMdArrayMetrics"},"description":"One entry per software-RAID array; empty on hosts without md\n(and from agents predating the field)."},"memory":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AgentMemoryMetrics","description":"Memory + swap totals in bytes."}]},"uptime_secs":{"type":["integer","null"],"format":"int64","description":"Seconds since boot; `None` if the node could not read it.","minimum":0}}},"AgentImageReportRequest":{"type":"object","description":"`POST /agents/me/image` request body. The agent reports the\nimage version it is currently running plus its boot-slot state.\nPosted at daemon startup (closing the loop after the reboot into\na new slot) and immediately after a `rauc install` succeeds\n(refreshing `slot_json` while the running version is still the\nold slot's). Self-scoped at the handler: identity is the `agt_`\nbearer hash alone, so agent A can never report for agent B.","required":["image_version"],"properties":{"image_version":{"type":"string","description":"The image version the agent is running right now — written\nverbatim to `agents.reported_image_version`. When it reaches\nthe operator-pinned `expected_image_version` the derived\npending predicate clears."},"slot_json":{"type":["string","null"],"description":"Opaque boot-slot state blob (`rauc status\n--output-format=json` verbatim), stored on\n`agents.image_slot_json` for operator observability. `None`\n⇒ leave the stored blob unchanged (an agent without `rauc`\non PATH can still report its version)."}}},"AgentImageReportResponse":{"type":"object","description":"`POST /agents/me/image` response. Acknowledges the recorded\nrunning image version and tells the agent whether its fleet-roll\nconverged. Response-only — no `Validate`.","required":["ok","reported_image_version","image_update_pending"],"properties":{"expected_image_version":{"type":["string","null"],"description":"The operator-pinned `agents.expected_image_version` verbatim\n(`None` if unpinned). Never mutated by this handler."},"image_update_pending":{"type":"boolean","description":"The derived pending state *after* the write:\n`expected_image_version.is_some() && expected_image_version\n!= reported_image_version`. `false` once the running image\nreached the operator-pinned target."},"ok":{"type":"boolean","description":"Always `true` on the success path (the write committed) —\nthe constant-shaped ack the responses share."},"reported_image_version":{"type":"string","description":"Echo of the just-recorded `agents.reported_image_version`."}}},"AgentImageResponse":{"type":"object","description":"Response body for `GET /agents/me/image`. The catalog metadata\nthe agent needs to fetch, integrity-verify, and `rauc install`\nits operator-pinned image. Self-scoped — the handler resolves\nthe agent strictly from the `agt_` bearer hash, so this body\nonly ever describes the caller's pinned target.","required":["version","arch","channel","sha256","size_bytes","download_url","signature_url"],"properties":{"arch":{"type":"string","description":"The resolved target triple (echo of the validated `arch`\nquery)."},"channel":{"type":"string","description":"The release ring the row was resolved from — the agent's\noperator-set `agents.image_channel`, echoed for\nobservability."},"download_url":{"type":"string","description":"Absolute artifact URL (`release_images.url`) — release host\n/ CDN location of the `.raucb` bundle. Immutable per\n`(channel, version, arch)` registration."},"sha256":{"type":"string","description":"Lowercase 64-hex SHA-256 of the bundle bytes\n(`release_images.sha256`). The agent streams the download\nagainst this digest and refuses on mismatch (fail-closed)."},"signature_url":{"type":"string","description":"Companion cosign signature URL (`<download_url>.sig` by the\nrelease-pipeline convention). The agent verifies the bundle\nagainst the build-embedded public key before\n`rauc install`; a verification failure aborts the roll."},"size_bytes":{"type":"integer","format":"int64","description":"Exact byte size of the bundle\n(`release_images.size_bytes`). The agent enforces this as\nits download cap — a response that exceeds it aborts the\nfetch before disk fills."},"version":{"type":"string","description":"The served image version — always equal to the agent's\noperator-pinned `expected_image_version` (echoed so the\nagent can assert it pulled the intended image)."}}},"AgentInterfaceMetrics":{"type":"object","description":"Cumulative-since-boot per-interface counters (mirror of the agent's\n`InterfaceMetrics`).","required":["name","rx_bytes","tx_bytes","rx_packets","tx_packets","rx_errors","tx_errors","rx_dropped","tx_dropped"],"properties":{"name":{"type":"string","description":"Interface name (e.g. `eth0`, `wg0`)."},"rx_bytes":{"type":"integer","format":"int64","description":"Received bytes.","minimum":0},"rx_dropped":{"type":"integer","format":"int64","description":"Dropped received packets.","minimum":0},"rx_errors":{"type":"integer","format":"int64","description":"Receive errors.","minimum":0},"rx_packets":{"type":"integer","format":"int64","description":"Received packets.","minimum":0},"tx_bytes":{"type":"integer","format":"int64","description":"Transmitted bytes.","minimum":0},"tx_dropped":{"type":"integer","format":"int64","description":"Dropped transmitted packets.","minimum":0},"tx_errors":{"type":"integer","format":"int64","description":"Transmit errors.","minimum":0},"tx_packets":{"type":"integer","format":"int64","description":"Transmitted packets.","minimum":0}}},"AgentJoinConfig":{"type":"object","description":"The bootstrap config block returned to the agent at join\n(`AgentJoinResponse::config`). The minimal subset\nthe agent needs to start operating: the per-capability resource\nids it now owns (so it can scope its `/router/*` / `/dns_agent/*`\n/ `/server/*` calls) plus the heartbeat cadence. The full\nversioned, ETag-cacheable, long-pollable config is the\n`GET /agents/me/config`; this is the just-enough handoff so the\nagent can run before its first config fetch.\n\nEach `*_server_id` is `Some` iff the matching capability is in\nthe token's set AND a per-cap row was created or back-filled\n(`dns_server_id` / `wg_server_id` are `None` when the operator\nhas not yet prepared that resource — those tables carry required\nexternal state and cannot be fabricated at join).","required":["heartbeat_interval_seconds"],"properties":{"dns_server_id":{"type":["string","null"],"description":"The `dns_servers.id` this agent owns (the `dns` capability),\nor `None`. `None` even for a `dns` agent when no\noperator-prepared `dns_servers` row (which requires a\n`public_ip_id`) matched by hostname — the operator links it\nvia the admin surface later."},"heartbeat_interval_seconds":{"type":"integer","format":"int32","description":"Seconds between `POST /agents/heartbeat` posts —\n[`AGENT_JOIN_HEARTBEAT_INTERVAL_SECONDS`]. The bootstrap\ncadence until the agent fetches the versioned config.","minimum":0},"routing_server_id":{"type":["string","null"],"description":"The `routing_servers.id` this agent owns (the `router`\ncapability), or `None` if the agent did not carry `router`.\nAlways `Some` for a `router` agent — a fresh row is created\nwhen no operator-prepared one matched by hostname."},"wg_server_id":{"type":["string","null"],"description":"The `servers.id` (WG infra) this agent owns (the `wg_server`\ncapability), or `None`. `None` even for a `wg_server` agent\nwhen no operator-prepared `servers` row matched by hostname."}}},"AgentJoinOsInfo":{"type":"object","description":"The node's reported OS triple, a sub-object of\n[`AgentJoinRequest`] (`os_info: { kernel, distro,\narch }`). Recorded in the join audit row for fleet\nobservability; not persisted as `agents` columns (the schema\ncarries identity/status, not host facts — host telemetry lands in\n`telemetry_json` via the heartbeat).\n\nEach field is required and length-bounded\n([`AGENT_JOIN_FIELD_MAX_LEN`]); `#[garde(dive)]` on the\nparent runs these rules so a blank or oversized OS string is a\n422 before any DB touch.","required":["kernel","distro","arch"],"properties":{"arch":{"type":"string","description":"CPU architecture (e.g. `x86_64`, `aarch64`). Non-empty,\nlength-bounded."},"distro":{"type":"string","description":"Distribution / OS name (e.g. `debian-12`). Non-empty,\nlength-bounded."},"kernel":{"type":"string","description":"Kernel identifier (e.g. `Linux 6.6.0`). Non-empty,\nlength-bounded."}}},"AgentJoinRequest":{"type":"object","description":"Request body for `POST /agents/join` (anonymous). The\n`token` is the one-time `JT_` plaintext the operator pasted on\nthe node via the install one-liner; the server hashes it and\nmatches `agent_join_tokens.token_hash` — the plaintext is never\nstored. The remaining fields are the node's self-reported\nidentity, recorded in the join audit row.\n\nEvery field is required and length-bounded; `os_info` is\nvalidated via `#[garde(dive)]` so its three sub-fields are\nchecked in the same `req.validate()?` pass. A boundary failure ⇒\n422 `validation_failed` before the token is hashed or the DB is\ntouched.","required":["token","hostname","os_info","agent_version","build_commit"],"properties":{"agent_version":{"type":"string","description":"The agent binary's own version (e.g. `0.4.0`). Stored on\n`agents.reported_version` at join (the agent re-reports it on\nevery heartbeat). Non-empty, length-bounded."},"build_commit":{"type":"string","description":"The agent binary's build commit. Not an `agents` column —\nrecorded in the join audit row so the bootstrap build is\ntraceable; the live value lands in `telemetry_json` via the\nheartbeat. Non-empty, length-bounded."},"hostname":{"type":"string","description":"The node's hostname. Stored on `agents.hostname` and used as\nthe default `agents.name` (operator renames PATCH).\nAlso the cutover match key for back-filling an\noperator-prepared per-capability row whose `name` equals this\nhostname. Non-empty, length-bounded."},"location":{"type":["string","null"],"description":"Best-effort node location string. The agent attempts\n`https://ipinfo.io/json` at join time and forwards the\nresulting `\"city, region, country\"` triple; a failure or\ntimeout leaves this `None`. The operator can override via\nthe PATCH at any time. When `Some`, must be 1..=256\nchars; an empty string deserialises as `None` so a future\nagent that elects not to bother does not have to invent a\nplaceholder."},"os_info":{"$ref":"#/components/schemas/AgentJoinOsInfo","description":"The node's OS triple (see [`AgentJoinOsInfo`]). Validated\nnested."},"token":{"type":"string","description":"The one-time `JT_<base64url>` join-token plaintext. Hashed\n(`hash_opaque_token`) and matched against\n`agent_join_tokens.token_hash`; never stored. Non-empty,\nlength-bounded ([`AGENT_JOIN_TOKEN_MAX_LEN`])."}}},"AgentJoinResponse":{"type":"object","description":"Response body for `POST /agents/join`.:\n[`agent_key`](Self::agent_key) is the freshly minted plaintext\nfleet-agent bearer, surfaced on this response **exactly once** —\nonly its `hash_opaque_token` digest is persisted in\n`agents.agent_key_hash` (column ends `_hash`); no list / read\nendpoint ever re-exposes it and the audit row never carries it,\nso this wire body is the one-and-only carrier (the same contract\nas `AgentRotateKeyResponse`).\n\nResponse-only — no `Validate` (the wire never carries a\nclient-supplied join *response*). Derives\n`ToSchema`, registered in `spec.rs`.","required":["agent_id","agent_key","capabilities","config","cert_pin_sha256"],"properties":{"agent_id":{"type":"string","description":"The newly created `agents.id` (UUIDv7). The stable\nhandle for every later self-service (`/agents/me*`) and admin\n(`/platform/agents/{id}`) call."},"agent_key":{"type":"string","description":"The freshly minted opaque fleet-agent bearer plaintext,\nprefixed with `agt_` (the `TOKEN_PREFIX_AGENT` the principal\nresolver classifies on). Shown to the joining node exactly\nonce; no read endpoint ever exposes it again."},"capabilities":{"type":"array","items":{"type":"string"},"description":"The capability slugs granted by the consumed join token,\nverbatim — the same set written to `agents.capabilities`."},"cert_pin_sha256":{"type":"string","description":"SHA-256 of the control-plane TLS leaf's `SubjectPublicKeyInfo`\nas 64-char lowercase hex — the SPKI pin the agent\nwrites verbatim into `agent.toml`'s `cert_pin_sha256` field\nand enforces on every subsequent control-plane handshake.\n\nRequired at every join; the handler refuses to mint a bearer\nagainst an unseeded `acme_state` (no ACME cert ever issued)\nrather than ship an unpinned config. Key rotation is handled\nout-of-band via the next `/agents/me/config` push (24h\n`cert_store::active_pins` overlap so a mid-rotation agent\nretains a valid pin until it next polls)."},"config":{"$ref":"#/components/schemas/AgentJoinConfig","description":"The bootstrap config block (see [`AgentJoinConfig`])."},"expected_version":{"type":["string","null"],"description":"`agents.expected_version` — the operator-pinned target the\nagent should self-update toward. `None` at join (unpinned;\nthe operator sets it later PATCH). Present in the\nshape so the agent reads one consistent config contract from\njoin onward."}}},"AgentJoinTokenListResponse":{"type":"object","description":"Response envelope for `GET /platform/agent-join-tokens`.\nA page of [`AgentJoinTokenRead`] rows ordered newest-first plus\nthe opaque `next_cursor` (`null` on the last page). Mirrors the\n`DnsAgentFilterListEntriesResponse` / `AuditEventListResponse`\npage-envelope shape so every cursor-paginated list on the wire\nhas the same `{ items, next_cursor }` contract.","required":["join_tokens"],"properties":{"join_tokens":{"type":"array","items":{"$ref":"#/components/schemas/AgentJoinTokenRead"},"description":"One page of join-token rows, ordered\n`created_at DESC, id DESC` (newest mint first). `[]` when no\nrows exist at or after the cursor."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or `null` on the last page."}}},"AgentJoinTokenMintRequest":{"type":"object","description":"Request body for `POST /platform/agent-join-tokens`. The\nonly client-supplied shape in this module, so it (and only it)\nderives `Validate`. The per-entry `capabilities` allowlist check\nis the handler's — it needs the `iam_types` capability table,\nwhich is not available to a derive — and surfaces 422\n`unknown_capability` for any slug not in\n`agent_capability_grants`.","required":["capabilities"],"properties":{"capabilities":{"type":"array","items":{"type":"string"},"description":"Capability slugs the minted agent will carry (e.g.\n`[\"router\", \"dns\"]`). Non-empty; every entry must be a known\nfleet-agent capability (the handler checks each against\n`iam_types::agent_capability_grants`). Capped at 16 entries\n— the fleet capability catalog is far smaller, so the cap\nrejects only pathological inputs."},"name":{"type":["string","null"],"description":"Optional operator label stored on `agent_join_tokens.name`.\nLength-bounded `1..=`[`JOIN_TOKEN_NAME_MAX_LEN`] when\npresent; absent ⇒ the column stays NULL."},"ttl_seconds":{"type":["integer","null"],"format":"int32","description":"Token lifetime in seconds. Range-bounded\n`1..=`[`MAX_JOIN_TOKEN_TTL_SECONDS`]; absent ⇒\n[`DEFAULT_JOIN_TOKEN_TTL_SECONDS`]. `expires_at` is\n`time::now() + ttl_seconds`.","minimum":0}}},"AgentJoinTokenMintResponse":{"type":"object","description":"Response for `POST /platform/agent-join-tokens`. The\nplaintext `token` is surfaced **exactly once** here and never\nagain — only its SHA-256+pepper hash is persisted. The\nlist view and every later read carry identity-and-status\nmetadata only.","required":["id","token","expires_at","install_command"],"properties":{"expires_at":{"type":"string","format":"date-time","description":"When the token expires (RFC3339). `time::now() +\nttl_seconds`; after this instant an unused token is\n`expired` in the list."},"id":{"type":"string","description":"`agent_join_tokens.id` (UUIDv7). Stable handle for the\n`DELETE /platform/agent-join-tokens/{id}` revoke and the\nlist row."},"install_command":{"type":"string","description":"The rendered install one-liner pinned to the deployment\norigin: `curl -fsSL <origin>/install.sh | sudo sh -s --\njoin JT_<...>`. The operator pastes this on the new node."},"token":{"type":"string","description":"The one-time plaintext bootstrap token,\n`JT_<base64url-no-pad>` ([`JOIN_TOKEN_PREFIX`] + 32 bytes of\nOS entropy). Sent once over TLS; never stored or\nre-displayed."}}},"AgentJoinTokenRead":{"type":"object","description":"One row of `GET /platform/agent-join-tokens` — the admin view\nof a bootstrap token. Identity-and-status metadata only; the\nsecret (`agent_join_tokens.token_hash`, and the plaintext\n`JT_<base64>` it hashes) is never on this shape.\n\nFields map off `agent_join_tokens` (`0014_agents_init.sql`)\nexcept [`status`](Self::status), which the handler derives\n(see [`AgentJoinTokenStatus`]). `capabilities` is stored as a\nJSON array in the column and rendered as a `Vec<String>`; the\nadmin treats it as a set (the per-capability allowlist is\nvalidated at mint time, not here).","required":["id","capabilities","status","expires_at","created_at"],"properties":{"capabilities":{"type":"array","items":{"type":"string"},"description":"Capability slugs this token will grant the agent it mints\n(`agent_join_tokens.capabilities`, a JSON array in the\ncolumn). E.g. `[\"router\", \"dns\"]`. The agent's per-cap\nrows (one `routing_servers` if `router`, one `dns_servers`\nif `dns`, …) are created from this set at join."},"created_at":{"type":"string","format":"date-time","description":"`agent_join_tokens.created_at` (RFC3339) — when the token\nwas minted. The cursor-ordering key for the\ncursor-paginated list."},"created_by_user_id":{"type":["string","null"],"description":"`agent_join_tokens.created_by_user_id` — the admin\n`users.id` that minted the token, or `None` if that user\nwas since deleted (`ON DELETE SET NULL` in `0014`)."},"expires_at":{"type":"string","format":"date-time","description":"`agent_join_tokens.expires_at` (RFC3339). The TTL horizon;\nafter this instant an unused token is\n[`Expired`](AgentJoinTokenStatus::Expired). An admin revoke\nsets this to `now()`."},"id":{"type":"string","description":"`agent_join_tokens.id` (UUIDv7). Stable handle for\nthe `DELETE /platform/agent-join-tokens/{id}` revoke."},"name":{"type":["string","null"],"description":"Operator-supplied label (`agent_join_tokens.name`), or\n`None` when the token was minted without one. Free-form;\nfor dashboard display only."},"status":{"$ref":"#/components/schemas/AgentJoinTokenStatus","description":"Derived lifecycle state (see [`AgentJoinTokenStatus`]). The\nhandler computes this from `used_at` / `expires_at` vs\n`state.clock.now()` so the dashboard does not re-derive it."},"used_at":{"type":["string","null"],"format":"date-time","description":"`agent_join_tokens.used_at` (RFC3339) — when the token was\nconsumed by `POST /agents/join`, or `None` if never\nused. Presence forces\n[`Used`](AgentJoinTokenStatus::Used)."},"used_by_agent_id":{"type":["string","null"],"description":"`agent_join_tokens.used_by_agent_id` — the `agents.id` the\ntoken minted, or `None` if unused. A loose pointer (the FK\nis `ON DELETE SET NULL` in `0014` so the audit trail of\n\"this token was used\" survives agent retirement)."}}},"AgentJoinTokenRevokeResponse":{"type":"object","description":"Response for `DELETE /platform/agent-join-tokens/{id}`.\nOne-field envelope `{ ok: true }` on every 200 path —\nstate-change revoke and idempotent re-call alike — mirroring\n`iam::types::TokenRevokeResponse`. The audit row is the\ncanonical record of the revoke; the response carries no\ntoken state because the revoked token's only observable change\n(`status → expired` in the list) is read there.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path (state-change and\nidempotent re-call alike). Present for forward-compatible\nenvelope shape rather than as a status flag."}}},"AgentJoinTokenStatus":{"type":"string","description":"Lifecycle state of an `agent_join_tokens` row, derived by the\nhandler so the dashboard switches on a closed set rather\nthan re-deriving from three raw nullable timestamps.\n\nDerivation (owned by the handler; this only pins the wire\nshape):\n\n* [`Pending`](Self::Pending) — `used_at IS NULL` and\n  `expires_at > clock.now()`. The token can still mint an\n  agent.\n* [`Used`](Self::Used) — `used_at IS NOT NULL`. Single-use is\n  enforced at `POST /agents/join`; once consumed the\n  token is spent regardless of `expires_at`.\n* [`Expired`](Self::Expired) — `used_at IS NULL` and\n  `expires_at <= clock.now()`. Never consumed, no longer\n  valid; also the post-state of an admin revoke (sets\n  `expires_at = now()`).\n\n`used` takes precedence over `expired`: a token that was\nconsumed before its TTL elapsed reads `used`, not `expired` —\nthe operator cares that it minted an agent, not that its\n(now irrelevant) TTL later lapsed.","enum":["pending","used","expired"]},"AgentLinkedResource":{"type":"object","description":"One product/server resource linked to an agent by its `agent_id`\nFK. Identity-and-status metadata only — the secret-bearing\ncolumns on `servers` (`private_key`, `ed25519_private_key_ct`)\nare never selected and never on this shape.\n\n`status` is the linked resource's own verbatim status string, not\nan [`AgentStatus`]: the three FK-owning tables carry *different*\n`CHECK` sets — `routing_servers` / `dns_servers` are\n`active`/`inactive`/`draining`, `servers` is\n`online`/`offline`/`error`/`maintenance` — so collapsing them\ninto one typed enum would misrepresent the value. The field is\nthe resource's own status, surfaced as-is for the operator\ndashboard; [`kind`](Self::kind) disambiguates which CHECK set\napplies.","required":["kind","id","name","status"],"properties":{"id":{"type":"string","description":"The linked row's `id` (UUIDv7)."},"kind":{"$ref":"#/components/schemas/AgentLinkedResourceKind","description":"Which FK owner this row came from (see\n[`AgentLinkedResourceKind`])."},"last_seen_at":{"type":["string","null"],"format":"date-time","description":"The linked row's `last_seen_at` (RFC3339), or `None`.\n`servers` has no such column, so `wg_server` rows are\nalways `None`."},"location":{"type":["string","null"],"description":"The linked row's `location`. `None` when the column is NULL\n(`routing_servers` / `dns_servers` allow NULL; `servers`\nis `NOT NULL` so it is always `Some` for `wg_server`)."},"name":{"type":"string","description":"The linked row's `name` (`NOT NULL` in all three tables)."},"status":{"type":"string","description":"The linked row's own `status` column, verbatim — see the\ntype-level note on why this is a string, not an enum."}}},"AgentLinkedResourceKind":{"type":"string","description":"Which FK owner a linked row came from — the on-the-wire tag for\nan [`AgentLinkedResource`]. One variant per agent capability that\nowns a server resource (`0014_agents_init.sql` FKs):\n\n* [`RoutingServer`](Self::RoutingServer) — a `routing_servers`\n  row (the `router` capability; `agent_id` ON DELETE RESTRICT).\n* [`DnsServer`](Self::DnsServer) — a `dns_servers` row (the\n  `dns` capability; `agent_id` ON DELETE RESTRICT).\n* [`WgServer`](Self::WgServer) — a `servers` row (the\n  `wg_server` capability; `agent_id` ON DELETE SET NULL).","enum":["routing_server","dns_server","wg_server"]},"AgentListResponse":{"type":"object","description":"Response envelope for `GET /platform/agents`. A page of\n[`AgentRead`] rows ordered newest-joined-first plus the opaque\n`next_cursor` (`null` on the last page). Mirrors the\n`AgentJoinTokenListResponse` page-envelope shape so every\ncursor-paginated list on the wire has the same\n`{ items, next_cursor }` contract.","required":["agents"],"properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentRead"},"description":"One page of agent rows, ordered `created_at DESC, id DESC`\n(newest row first). `[]` when no rows exist at or after the\ncursor."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or `null` on the last page."}}},"AgentLoadAvg":{"type":"object","description":"1/5/15-minute load averages (mirror of the agent's `LoadAvg`).","required":["one","five","fifteen"],"properties":{"fifteen":{"type":"number","format":"double","description":"15-minute load average."},"five":{"type":"number","format":"double","description":"5-minute load average."},"one":{"type":"number","format":"double","description":"1-minute load average."}}},"AgentMdArrayMetrics":{"type":"object","description":"One software-RAID array's health (mirror of the agent's\n`MdArrayMetrics`). The load-bearing bit is `degraded`: a two-disk\nmirror with a dead member keeps serving with zero capacity signal —\nthis is the only place the fleet surface can see it.","required":["name","level","disks_total","disks_active","degraded"],"properties":{"degraded":{"type":"boolean","description":"Running without full redundancy."},"disks_active":{"type":"integer","format":"int32","description":"Members currently active.","minimum":0},"disks_total":{"type":"integer","format":"int32","description":"Member slots the array was built with.","minimum":0},"level":{"type":"string","description":"RAID level as reported (e.g. `raid1`); empty if unparsed."},"name":{"type":"string","description":"Array device name (e.g. `md0`)."},"sync_percent":{"type":["number","null"],"format":"double","description":"In-progress resync/recovery percentage, `None` when idle."}}},"AgentMeResponse":{"type":"object","description":"Response body for `GET /agents/me`. The authenticated\nfleet agent's own `agents` record plus the per-capability\nbootstrap config it needs to operate. Self-scoped: the handler\nresolves the row strictly from the `agt_` bearer hash\n(`WHERE agent_key_hash = ?`), so this body can only ever describe\nthe caller — agent A's bearer can never surface agent B's record\n(the cross-agent guarantee is structural, no id in the path).","required":["agent","config"],"properties":{"agent":{"$ref":"#/components/schemas/AgentRead","description":"The caller's own `agents` row (see [`AgentRead`]) —\nidentity-and-status metadata only; the secret\n(`agents.agent_key_hash` and the plaintext bearer it hashes)\nis never on this shape."},"config":{"$ref":"#/components/schemas/AgentJoinConfig","description":"The per-capability bootstrap config (see [`AgentJoinConfig`]):\nthe `routing_servers` / `dns_servers` / `servers` ids whose\n`agent_id` FK points back at this agent, plus\n`heartbeat_interval_seconds`. Each `*_server_id` is `None`\nwhen the agent owns no row in that table (it does not carry\nthat capability, or the operator has not linked the\nresource) — the FK is the source of truth, the same outcome\nas the capability-gated build."}}},"AgentMemoryMetrics":{"type":"object","description":"Memory + swap totals in bytes (mirror of the agent's `MemoryMetrics`).","required":["total_bytes","available_bytes","used_bytes","swap_total_bytes","swap_free_bytes"],"properties":{"available_bytes":{"type":"integer","format":"int64","description":"Kernel-estimated allocatable memory.","minimum":0},"swap_free_bytes":{"type":"integer","format":"int64","description":"Free swap.","minimum":0},"swap_total_bytes":{"type":"integer","format":"int64","description":"Total swap.","minimum":0},"total_bytes":{"type":"integer","format":"int64","description":"Total physical memory.","minimum":0},"used_bytes":{"type":"integer","format":"int64","description":"`total - available` — memory in active use.","minimum":0}}},"AgentPetCreateRequest":{"type":"object","description":"`POST /platform/agents/{id}/pets` request body.","required":["name","image","desired_state"],"properties":{"desired_state":{"$ref":"#/components/schemas/AgentPetWriteState","description":"Initial desired state."},"image":{"type":"string","description":"Seed image name the host resolves to\n`<data>/seeds/<image>.tar` — one segment, no separators."},"name":{"type":"string","description":"Pet name (≤12 chars: the host derives the veth as\n`ve-<name>`, which must fit IFNAMSIZ)."}}},"AgentPetDeleteResponse":{"type":"object","description":"`DELETE /platform/agents/{id}/pets/{pet_id}` response.","required":["ok","mode"],"properties":{"mode":{"type":"string","description":"`deleted` — the row was hard-deleted immediately (the agent\nnever reported provisioning it, so there is nothing on the\ndevice to remove); `pending_removal` — the row became an\n`absent` tombstone the agent must tuple-confirm."},"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"AgentPetDesired":{"type":"object","description":"One desired-set entry as served to the agent\n(`GET /agents/me/pets`) — the operator-owned columns only.","required":["id","name","image","desired_state"],"properties":{"desired_state":{"type":"string","description":"`running` | `stopped` | `absent` (removal tombstone: destroy\nonly on a full `(name, image)` ledger match)."},"id":{"type":"string","description":"Pet id (UUIDv7) — echoed in nothing today, carried so the\nagent's ledger can hold a stable identity per declaration."},"image":{"type":"string","description":"Seed image name (host-resolved to `<data>/seeds/<image>.tar`)."},"name":{"type":"string","description":"Pet name."}}},"AgentPetObservation":{"type":"object","description":"One observed declared pet in the agent's report.","required":["name","state"],"properties":{"name":{"type":"string","description":"Declared container name the observation is for."},"state":{"type":"string","description":"Observed state from the pet runtime (e.g. `RUNNING`,\n`STOPPED`). Free text, bounded — observability only."}}},"AgentPetRead":{"type":"object","description":"One `agent_pets` row as the staff surface reads it.","required":["id","agent_id","name","image","desired_state","created_at","updated_at"],"properties":{"agent_id":{"type":"string","description":"Owning `agents.id`."},"created_at":{"type":"string","description":"RFC3339 creation timestamp."},"desired_state":{"type":"string","description":"Operator-declared target: `running` | `stopped` | `absent`\n(`absent` = removal tombstone awaiting agent\nconfirmation)."},"id":{"type":"string","description":"Pet id (UUIDv7)."},"image":{"type":"string","description":"Operator-declared image reference: a seed name the host\nresolves to `<data>/seeds/<image>.tar`."},"name":{"type":"string","description":"Pet name — unique per agent."},"reported_at":{"type":["string","null"],"description":"RFC3339 timestamp of the last agent report touching this row."},"reported_state":{"type":["string","null"],"description":"Agent-reported observed state (from the pet runtime, e.g.\n`RUNNING`). `None` until first report."},"updated_at":{"type":"string","description":"RFC3339 last-modification timestamp."}}},"AgentPetRemoval":{"type":"object","description":"One removal confirmation: the agent destroyed this\ncontainer after a full `(name, image)` ledger match against the\nserved `absent` tombstone. The report handler hard-deletes the\ntombstone row only when both fields match it.","required":["name","image"],"properties":{"image":{"type":"string","description":"The seed image the destroyed pet was created from — must\nequal the tombstone's `image` for the delete to land."},"name":{"type":"string","description":"Removed container name."}}},"AgentPetUpdateRequest":{"type":"object","description":"`PATCH /platform/agents/{id}/pets/{pet_id}` request body. Omitted\nfields are unchanged. An image change is a *replacement*\ndeclaration: the agent destroys its ledger-matched container and\nre-creates it from the new image (immutable-infrastructure\nsemantics — documented on the reconciler).","properties":{"desired_state":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AgentPetWriteState","description":"New desired state (`None` = unchanged). Removal is not a\nPATCH — use the DELETE verb."}]},"image":{"type":["string","null"],"description":"New seed image name (`None` = unchanged)."}}},"AgentPetWriteState":{"type":"string","description":"Operator-writable desired state. `absent` is deliberately not\nhere — removal goes through the DELETE verb so destroying a\nworkload is always an explicit, separately-audited act.","enum":["running","stopped"]},"AgentPetsListResponse":{"type":"object","description":"Response body for the staff `GET /platform/agents/{id}/pets`.\nUnpaginated by design: the set is hard-capped at\n[`AGENT_PETS_MAX_PER_AGENT`] rows (no cursor needed, no OFFSET —\npagination is for unbounded collections).","required":["pets"],"properties":{"pets":{"type":"array","items":{"$ref":"#/components/schemas/AgentPetRead"},"description":"Every declared pet for the agent, `absent` tombstones\nincluded, ordered by name."}}},"AgentPetsPollResponse":{"type":"object","description":"`GET /agents/me/pets` response — the full desired set for the\nauthenticated agent, tombstones included. Bounded by\n[`AGENT_PETS_MAX_PER_AGENT`]; no pagination or ETag (the body is\ntiny and the agent's reconcile is idempotent).","required":["pets"],"properties":{"pets":{"type":"array","items":{"$ref":"#/components/schemas/AgentPetDesired"},"description":"Desired pets, ordered by name."}}},"AgentPetsReportRequest":{"type":"object","description":"`POST /agents/me/pets` request body — one reconcile tick's\noutcome: observed states for declared pets, tuple-confirmed\nremovals, and the names of undeclared containers found on the\ndevice (drift; the agent never touches them).","required":["pets","removed","undeclared"],"properties":{"pets":{"type":"array","items":{"$ref":"#/components/schemas/AgentPetObservation"},"description":"Observed states for declared pets."},"removed":{"type":"array","items":{"$ref":"#/components/schemas/AgentPetRemoval"},"description":"Tuple-confirmed removals."},"undeclared":{"type":"array","items":{"type":"string"},"description":"Container names present on the device but not declared —\nstored verbatim on `agents.pets_drift_json` for the operator."}}},"AgentPetsReportResponse":{"type":"object","description":"`POST /agents/me/pets` response.","required":["ok","recorded","removed_confirmed"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path."},"recorded":{"type":"integer","format":"int64","description":"Observations that matched a declared pet row and were\nrecorded."},"removed_confirmed":{"type":"integer","format":"int64","description":"Tombstone rows hard-deleted by tuple-matched confirmation."}}},"AgentRead":{"type":"object","description":"One row of `GET /platform/agents` — the admin view of a running\nfleet node. Identity-and-status metadata only; the secret\n(`agents.agent_key_hash`, and the plaintext bearer it hashes) is\nnever on this shape.\n\nFields map off `agents` (`0014_agents_init.sql`) except\n[`version_skew`](Self::version_skew), which the handler\nderives. `capabilities` is stored as a JSON array in the column\nand rendered as a `Vec<String>`.","required":["id","name","capabilities","status","version_skew","image_version_skew","joined_at","created_at","updated_at"],"properties":{"capabilities":{"type":"array","items":{"type":"string"},"description":"Capability slugs this agent carries\n(`agents.capabilities`, a JSON array in the column). E.g.\n`[\"router\", \"dns\"]`. Set from the join token at\n`POST /agents/join`."},"created_at":{"type":"string","format":"date-time","description":"`agents.created_at` (RFC3339) — row-creation instant; the\ncursor-ordering key for the list."},"expected_image_version":{"type":["string","null"],"description":"`agents.expected_image_version` (0223) — the operator-pinned\nOS-image target the agent fleet-rolls toward (the image\nanalog of [`expected_version`](Self::expected_version)), or\n`None` if unpinned."},"expected_version":{"type":["string","null"],"description":"`agents.expected_version` — the operator-set target\nversion the agent should self-update to, or `None` if\nunpinned."},"hostname":{"type":["string","null"],"description":"`agents.hostname` — the node's reported hostname, or `None`\nif it has not joined / reported one yet."},"id":{"type":"string","description":"`agents.id` (UUIDv7). Stable handle for the\nper-agent routes (`/platform/agents/{id}`)."},"image_channel":{"type":["string","null"],"description":"`agents.image_channel` (0223) — the operator-set OS-image\nrelease ring (`stable`, `beta`, …) this agent pulls image\nupdates from, or `None` for agents without image management\n(agents on shared legacy hosts)."},"image_version_skew":{"type":"boolean","description":"Derived: `true` iff\n[`expected_image_version`](Self::expected_image_version) and\n[`reported_image_version`](Self::reported_image_version) are\nboth present and unequal — the node is booted into an image\nother than the operator-pinned target. Same derivation rule\nas [`version_skew`](Self::version_skew)."},"joined_at":{"type":"string","format":"date-time","description":"`agents.joined_at` (RFC3339) — when the agent completed\n`POST /agents/join`."},"last_seen_at":{"type":["string","null"],"format":"date-time","description":"`agents.last_seen_at` (RFC3339) — the last heartbeat\ntimestamp, or `None` if the agent has never checked in."},"location":{"type":["string","null"],"description":"`agents.location` — operator-set placement label (e.g.\n`pop-east-1`), or `None`."},"name":{"type":"string","description":"`agents.name` — operator-supplied or join-time label;\n`NOT NULL` in the column."},"reported_image_version":{"type":["string","null"],"description":"`agents.reported_image_version` (0223) — the OS-image version\nthe agent last reported running (the image analog of\n[`reported_version`](Self::reported_version)), or `None`\nbefore its first image report."},"reported_version":{"type":["string","null"],"description":"`agents.reported_version` — the version the agent last\nreported via heartbeat, or `None` before its first\nheartbeat."},"status":{"$ref":"#/components/schemas/AgentStatus","description":"`agents.status` lifecycle state (see [`AgentStatus`])."},"updated_at":{"type":"string","format":"date-time","description":"`agents.updated_at` (RFC3339) — last mutation of the row\n(status / version / heartbeat upsert)."},"version_skew":{"type":"boolean","description":"Derived: `true` iff [`expected_version`](Self::expected_version)\nand [`reported_version`](Self::reported_version) are both\npresent and unequal — the agent is running a version other\nthan the one the operator pinned (the \"version skew\"\nnames). `false` when either side is absent (no\nskew can be asserted without both)."}}},"AgentRetireResponse":{"type":"object","description":"Response body for `DELETE /platform/agents/{id}`. One-field\nenvelope `{ ok: true }` on every 200 path — the state-change\nretire and the idempotent re-call against an already-`retired`\nagent alike — mirroring [`super::join_token_types::AgentJoinTokenRevokeResponse`]\nand `iam::types::TokenRevokeResponse`. The audit row is the\ncanonical record of the retirement; the response carries no agent\nstate because the only observable change (`status → retired`,\nversion skew cleared) is read on the list / detail. No\ncredential is ever returned — retiring *invalidates* the bearer,\nthe inverse of the one-time plaintext.\n\nResponse-only — no `Validate` (the wire never carries a\nclient-supplied retire shape; retirement is a parameter-free\nstate transition). Derives `ToSchema`,\nregistered in `spec.rs`.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path (state-change retire and\nidempotent re-call alike). Present for forward-compatible\nenvelope shape rather than as a status flag."}}},"AgentRotateKeyResponse":{"type":"object","description":"Response body for `POST /platform/agents/{id}/rotate-key`.\n\n[`agent_key`](Self::agent_key) is the freshly minted\nplaintext fleet-agent bearer, surfaced on this response **exactly\nonce**. Only its `hash_opaque_token` digest is persisted in\n`agents.agent_key_hash` (column ends in `_hash`); no list / read\nendpoint ever re-exposes the secret, and the audit row never\ncarries it — this wire body is the one-and-only carrier. The\nprevious bearer is invalidated atomically on commit (the unique\nindex on `agent_key_hash` then matches only the new digest, so the\nprincipal resolver's index probe 401s the stale key).\n\nResponse-only — no `Validate` (the wire never carries a\nclient-supplied rotate shape; rotation is a parameter-free state\ntransition). Derives `ToSchema`, registered in\n`spec.rs`.","required":["id","agent_key"],"properties":{"agent_key":{"type":"string","description":"The freshly minted opaque fleet-agent bearer plaintext,\nprefixed with `agt_` (the `TOKEN_PREFIX_AGENT` the principal\nresolver classifies on). Shown to the operator exactly once;\nno read endpoint ever exposes it again."},"id":{"type":"string","description":"`agents.id` (UUIDv7). Unchanged from the request\npath — rotation is an in-place secret swap on the existing\nrow, so every downstream reference stays valid."}}},"AgentSelfStatus":{"type":"string","description":"The agent's self-reported lifecycle view. **Informational\ntelemetry only** — the authoritative status is the\n`agents.status` column the operator controls; the\nhandler resolves identity + admit/deny from the DB row, never from\nthis field. Recorded in the telemetry sample so the operator\ndashboard can see when an agent has self-quiesced after repeated\nauth failures or sent its final heartbeat during graceful\nshutdown.","enum":["joined","paused-auth-failure","shutdown"]},"AgentStatus":{"type":"string","description":"Lifecycle state of an `agents` row. The on-the-wire mirror of\nthe `agents.status` column's `CHECK (status IN\n('joined','paused','retired'))` constraint\n(`0014_agents_init.sql`) — a real stored column, not a derived\nvalue (contrast `AgentJoinTokenStatus`, which the handler\ncomputes from timestamps).\n\n* [`Joined`](Self::Joined) — the agent completed\n  `POST /agents/join` and is the normal operating state.\n* [`Paused`](Self::Paused) — operator-paused. A paused\n  agent's heartbeat still updates `last_seen_at` but its\n  capability surfaces (e.g. `/router/bindings/pending`) return\n  empty: observed-not-acted.\n* [`Retired`](Self::Retired) — decommissioned\n  (`DELETE /platform/agents/{id}`); the bearer is invalidated and\n  the row is kept only as an audit anchor.","enum":["joined","paused","retired"]},"AgentUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/agents/{id}`\n(\"change `name`, `location`, `expected_version`, `status` ∈\n{`joined`,`paused`,`retired`}\").\n\nEvery field is `Option<T>` so a JSON object that omits a key\nleaves the column unchanged — the partial-update convention\n`SystemSettingsUpdate` / `OrgUpdateRequest` already establish. An\nempty-object PATCH (`{}`) is a column-level no-op (the handler\ndoes not bump `updated_at` on the no-op path, so a touch-only\nrequest stays idempotent).\n\nThe two nullable text columns (`location`, `expected_version`)\nuse the empty-string-clears convention: an explicit `\"\"` clears\nthe column to NULL, a non-empty value sets it. Their `validate`\nrules carry only a `max` length (no `min`) so an empty string\nreaches the handler's clear path rather than being rejected by\nthe validator (the same ordering `SystemSettingsUpdate` documents\nfor its nullable text columns).\n\n`name` maps to a `NOT NULL` column, so its rule is\n`length(min = 1, max = 200)` — an empty string is a validator\nreject (422), never a clear (mirrors `OrgUpdateRequest::name`).\n`status` is `Option<AgentStatus>`, the on-the-wire mirror of the\n`agents.status` `CHECK` set; an out-of-set string is a serde\ndecode reject before the handler runs.\n\n`garde` skips `None` fields automatically, so a PATCH that\nomits a field never has to satisfy that field's constraint.\nDerives `ToSchema`, registered in `spec.rs`.","properties":{"expected_image_version":{"type":["string","null"],"description":"New `agents.expected_image_version` (0223) — the\noperator-pinned OS-image target the agent fleet-rolls toward.\nOmit ⇒ unchanged; explicit `\"\"` ⇒ unpin (clear to NULL);\nnon-empty ⇒ pin."},"expected_version":{"type":["string","null"],"description":"New `agents.expected_version` — the operator-pinned target\nthe agent self-updates toward. Omit ⇒ unchanged; explicit\n`\"\"` ⇒ unpin (clear to NULL); non-empty ⇒ pin."},"image_channel":{"type":["string","null"],"description":"New `agents.image_channel` (0223) — the OS-image release ring\nthis agent pulls from. Omit ⇒ unchanged; explicit `\"\"` ⇒\nclear to NULL (no image management); non-empty ⇒ set."},"location":{"type":["string","null"],"description":"New `agents.location`. Omit ⇒ unchanged; explicit `\"\"` ⇒\nclear to NULL; non-empty ⇒ set. `max`-only rule so the\nempty-string clear reaches the handler."},"name":{"type":["string","null"],"description":"New `agents.name`. Omit ⇒ unchanged. `NOT NULL` column:\n`length(min = 1, max = 200)` — empty string is a 422 reject,\nnot a clear."},"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AgentStatus","description":"New `agents.status` lifecycle state. Omit ⇒ unchanged. An\nout-of-set value is rejected at serde-decode time (the enum\nonly decodes `joined` / `paused` / `retired`)."}]}}},"AgentVersionRequest":{"type":"object","description":"`POST /agents/me/version` request body. The agent posts this once\nafter it has fetched + cosign-verified the operator-pinned build\nand restarted on it. Self-scoped at the handler: identity\nis the `agt_` bearer hash alone (no agent id in the body or\npath), so agent A can never report a version for agent B.","required":["reported_version","build_commit"],"properties":{"build_commit":{"type":"string","description":"The post-update build commit, recorded in the audit row so\nthe operator can correlate the exact artifact the agent now\nruns (it is not an `agents` column — the heartbeat\nprecedent: commit identity lives in the audit/telemetry\ntrail, not the roster row)."},"reported_version":{"type":"string","description":"The agent's post-update semantic version (e.g. `\"0.4.1\"`) —\nwritten verbatim to `agents.reported_version`. When it\nreaches the operator-pinned `agents.expected_version` the\nderived update-pending predicate clears."}}},"AgentVersionResponse":{"type":"object","description":"`POST /agents/me/version` response. Acknowledges the recorded\nversion and tells the agent whether its self-update converged.\nResponse-only — the only client input is the bearer + the typed\nbody — so this shape has no `Validate`.","required":["ok","reported_version","update_pending"],"properties":{"expected_version":{"type":["string","null"],"description":"The operator-pinned `agents.expected_version` verbatim\n(`None` if the operator has pinned no target). The handler\nnever mutates this — it is echoed so the\nagent sees the authoritative target."},"ok":{"type":"boolean","description":"Always `true` on the success path (the write committed). A\nconstant-shaped ack mirroring the heartbeat response so\nthe agent parses one envelope across the self-service\nsurface."},"reported_version":{"type":"string","description":"Echo of the just-recorded `agents.reported_version` so the\nagent can assert the control plane stored what it sent."},"update_pending":{"type":"boolean","description":"The derived update-pending state *after* the write:\n`expected_version.is_some() && expected_version !=\nreported_version`. `false` once the agent's reported version\nhas reached the operator-pinned target — this is the\n\"update-pending flag cleared\" names, expressed\nas the derived predicate rather than a stored column."}}},"AgentWsClientAck":{"type":"object","description":"The agent's acknowledgement of one pushed [`AgentWsServerFrame`].\n\"Agent acks each event.\" The only client-supplied\nshape on the socket, so it (and only it) derives [`Validate`]:\n`event_id` is non-empty and length-bounded — a\nmisbehaving agent cannot stream an unbounded blob through the ack\npath.","required":["event_id"],"properties":{"event_id":{"type":"string","description":"Echo of the [`AgentWsServerFrame::event_id`] the agent is\nacknowledging. Bounded to [`AGENT_WS_EVENT_ID_MAX_LEN`]; an\nempty or over-long value is rejected before the server records\nthe ack."}}},"AgentWsServerEvent":{"oneOf":[{"type":"object","description":"A `bindings` row entered `pending` for a `routing_servers`\nrow this agent owns.: cuts apply\nlatency from \"next poll\" to instant — the agent re-pulls\n`/router/bindings/pending` on receipt; the long-poll there\nstays the authoritative fallback.","required":["binding_id","event"],"properties":{"binding_id":{"type":"string","description":"The `bindings.id` that just went `pending`."},"event":{"type":"string","enum":["pending_added"]}}},{"type":"object","description":"The agent's versioned config (the `/agents/me/config`\npoll target) changed. The agent re-fetches\n`/agents/me/config`; `version` lets it skip the fetch when it\nalready holds that version.","required":["version","event"],"properties":{"event":{"type":"string","enum":["config_changed"]},"version":{"type":"integer","format":"int64","description":"The new monotonically-increasing config version."}}},{"type":"object","description":"Operator command: quiesce. The agent\nstops acting on new work but keeps the socket up so `Unpause`\ncan reach it. Mirrors the operator-side `PATCH\n/platform/agents/{id}` `status = paused` transition.","required":["event"],"properties":{"event":{"type":"string","enum":["pause"]}}},{"type":"object","description":"Operator command: resume after a `Pause`.","required":["event"],"properties":{"event":{"type":"string","enum":["unpause"]}}},{"type":"object","description":"Operator command: drain — finish in-flight\nwork, accept no new work, prepare for a clean stop.","required":["event"],"properties":{"event":{"type":"string","enum":["drain"]}}},{"type":"object","description":"Operator command: drop any cached state and\nre-pull every self-service surface from scratch.","required":["event"],"properties":{"event":{"type":"string","enum":["force_resync"]}}},{"type":"object","description":"Pre-stage for an atomic bearer rotation: the\noperator minted the agent a new key (rotate-key); the\nagent stages `new_key_hash` and cuts over on its next\nauthenticated call so there is no unauthenticated window.","required":["new_key_hash","event"],"properties":{"event":{"type":"string","enum":["rotate_key"]},"new_key_hash":{"type":"string","description":"The hash of the freshly-minted bearer the agent must\ncut over to. This is the `*_hash`, never the plaintext\n— the plaintext travelled once over the\nrotate-key response and is stored nowhere."}}},{"type":"object","description":"An admin path-tier / QoS-rule mutation\nchanged the traffic-engineering policy a routing\nagent enforces. The agent hot-reloads its policy table from\nits self-service surface — no restart, no peer disconnect.\n`org_id` present ⇒ only that org's policy slice changed (an\norg-scoped `qos_rules` row); absent ⇒ a platform-wide rule or\na path-tier / plan-grant change every routing agent must\nre-read. Opportunistic like every sibling event: if the\nsocket was down the agent re-converges on its next poll\n— this never carries authoritative state.","required":["event"],"properties":{"event":{"type":"string","enum":["qos_changed"]},"org_id":{"type":["string","null"],"description":"The org whose policy slice changed, or omitted for a\nplatform-wide change. The string is the `orgs.id` UUIDv7;\n`skip_serializing_if`/`default` keep the platform-wide\nwire form a bare `{ \"event\": \"qos_changed\" }`."}}},{"type":"object","description":"A roster-affecting mutation changed the peer set one of this\nagent's servers must accept (`peers_changed`): a\nQUIC tunnel was created / deleted / key-regenerated. The\nagent re-pulls its per-protocol roster surface\n(`/quic_server/peers` / `/server/subscribers`) and hot-swaps\nthe engine peer store — no restart, no peer disconnect.\nOpportunistic like every sibling event: a disconnected agent\nre-converges on its next roster poll.","required":["protocol","event"],"properties":{"event":{"type":"string","enum":["peers_changed"]},"protocol":{"type":"string","description":"Which protocol's roster changed — the `servers.protocol`\ndomain (`wireguard` or `quic`) — so a dual-protocol agent\nkicks only the affected roster poll."}}},{"type":"object","description":"Operator maintenance command: withdraw every\nannouncement on one BGP neighbour without touching the row's\n`status` toggle. The agent's speaker sends BGP withdraws for\nthe peer's announced set; re-announcement happens when the\noperator re-enables or the speaker reconverges on its next\nconfig poll. Opportunistic like every sibling event.","required":["peer_id","peer_address","event"],"properties":{"event":{"type":"string","enum":["bgp_withdraw"]},"peer_address":{"type":"string","description":"The neighbour address, echoed so the agent need not\nre-resolve the id before acting."},"peer_id":{"type":"string","description":"The `bgp_peers.id` being withdrawn."}}},{"type":"object","description":"Operator diagnostic: probe one external exit this agent\nowns and report the result back over the socket. Unlike every\nsibling event this one is request/response — the `request_id`\ncorrelates the agent's [`AgentWsClientProbeResult`] reply to the\nawaiting operator HTTP call, independent of the frame's ack\n`event_id` (which is regenerated per socket write, so it cannot\ncarry request correlation). The probe NEVER carries an\noperator-supplied destination: the agent derives the target from\nthe exit's own sealed driver config, so the diagnostic cannot be\nturned into an SSRF primitive.","required":["request_id","exit_id","mode","event"],"properties":{"event":{"type":"string","enum":["probe_exit"]},"exit_id":{"type":"string","description":"The `external_exits.id` to probe."},"mode":{"$ref":"#/components/schemas/ProbeMode","description":"Which probe to run."},"request_id":{"type":"string","description":"Operator-call correlation id (a UUIDv7 string) the agent\nechoes verbatim in its [`AgentWsClientProbeResult`]."}}}],"description":"An operator-dashboard event the control plane pushes down the\nagent's WebSocket. The discriminant rides the `event` JSON key\n(`#[serde(tag = \"event\")]`); the variants below, `qos_changed`\nincluded, are the complete set. The enum is closed — a discriminant the server\nnever emits cannot be constructed, and a malformed inbound\ndiscriminant fails deserialization (the agent only ever\n*receives* these, but the round-trip is pinned so the contract\ncannot drift)."},"AgentWsServerFrame":{"allOf":[{"$ref":"#/components/schemas/AgentWsServerEvent","description":"The operator-dashboard event. Flattened so the discriminant\n(`event`) and the variant payload sit at the envelope's top\nlevel, matching verbatim."},{"type":"object","required":["event_id"],"properties":{"event_id":{"type":"string","description":"Server-assigned per-event correlation id (a UUIDv7 string).\nThe agent returns it verbatim in [`AgentWsClientAck::event_id`]\nso the server can match the ack to the pushed event."}}}],"description":"The envelope actually written to the socket: an\n[`AgentWsServerEvent`] plus the server-assigned `event_id` the\nagent echoes back in its [`AgentWsClientAck`]. The event fields\nare flattened so the wire JSON is exactly line 1028-1036's\nshape with one added `event_id` key (e.g.\n`{ \"event_id\": \"01J…\", \"event\": \"pending_added\",\n\"binding_id\": \"…\" }`). Response-only — the agent never sends\nthis — so no `Validate`."},"AnalyticsBeatRequest":{"type":"object","description":"`POST /analytics/beat` request body. Idempotent UPSERT — the\nfirst call mints the `analytics_sessions` row, every subsequent\ncall refreshes `last_seen_at`.","required":["session_id"],"properties":{"session_id":{"type":"string","description":"Client-issued session id. Stable across the visit; the\nserver upserts the row keyed on this id."},"started_at":{"type":["string","null"],"description":"Caller-provided RFC3339 timestamp the client considers the\nsession-start. Only used when the upsert mints a fresh row;\nsubsequent beats ignore this field (`last_seen_at` is the\nauthoritative refresh signal). `None` ⇒ `state.clock.now()`."},"user_agent":{"type":["string","null"],"description":"Optional user-agent string captured at session-start. Only\npersisted on the row the upsert mints; subsequent beats do\nnot overwrite a previously stored UA."}},"additionalProperties":false},"AnalyticsBeatResponse":{"type":"object","description":"`POST /analytics/beat` response. `created` distinguishes a fresh\nsession-row mint (`true`) from a subsequent beat that refreshed\n`last_seen_at` (`false`) — lets the client log \"session started\"\nexactly once without an extra round-trip.","required":["session_id","created"],"properties":{"created":{"type":"boolean","description":"`true` on the upsert that minted the row, `false` on every\nsubsequent beat for the same `session_id`."},"session_id":{"type":"string","description":"Echoes the request's `session_id` for client correlation."}}},"AnalyticsEventListResponse":{"type":"object","description":"Wire response for `GET /platform/analytics/list`. One-array\nenvelope plus an opaque `next_cursor` token. `next_cursor` is\n`None` when the page contained fewer than `limit` rows.","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsEventRead"},"description":"Analytics rows ordered `(created_at DESC, id DESC)`."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page; `null`\nwhen the current page is the last."}}},"AnalyticsEventRead":{"type":"object","description":"One row of `GET /platform/analytics/list`. Mirrors\n`analytics_events` columns; `ip_anonymised` is included so staff\ncan correlate to the same row's session-IP without an extra\nSELECT (the anonymisation already stripped the last octet on\ninsert — there is no plaintext IP to leak).","required":["id","event_name","occurred_at","created_at"],"properties":{"created_at":{"type":"string","description":"Server-side RFC3339 timestamp of the insert."},"event_name":{"type":"string","description":"Event-name slug."},"id":{"type":"string","description":"UUIDv7 id of the analytics_events row."},"ip_anonymised":{"type":["string","null"],"description":"IP-anonymised network prefix (IPv4 /24, IPv6 /48) — the\nschema column. May be NULL when no header was supplied or\nthe value was unparseable."},"occurred_at":{"type":"string","description":"Caller-provided RFC3339 timestamp of the event."},"org_id":{"type":["string","null"],"description":"Org id at insert time (NULL for anonymous events)."},"session_id":{"type":["string","null"],"description":"Session id this event was tagged with at insert time. NULL\nfor one-off pings or anonymous record calls with no session."},"user_id":{"type":["string","null"],"description":"User id at insert time (NULL for anonymous events)."}}},"AnalyticsLiveResponse":{"type":"object","description":"`GET /platform/analytics/live` response. `live_window_seconds`\nechoes the resolved window so the client knows which threshold\nthe count was taken against.","required":["live_sessions","live_window_seconds"],"properties":{"live_sessions":{"type":"integer","format":"int64","description":"Count of `analytics_sessions` rows whose `last_seen_at` is\nwithin the resolved live window AND whose `ended_at IS NULL`."},"live_window_seconds":{"type":"integer","format":"int32","description":"Window (in seconds) the live count was computed against.\nDefault 300 (5 minutes); configurable via\n`?window_seconds=`.","minimum":0}}},"AnalyticsPurgeResponse":{"type":"object","description":"`DELETE /platform/analytics/purge` response. Echoes the row\ncounts that were deleted so staff can confirm the operation hit\nthe expected slice of data.","required":["events_deleted","sessions_deleted"],"properties":{"events_deleted":{"type":"integer","format":"int64","description":"Number of `analytics_events` rows deleted by this call.","minimum":0},"older_than_days":{"type":["integer","null"],"format":"int32","description":"The resolved `older_than_days` threshold; `None` when the\ncaller did not supply one (purge-everything mode).","minimum":0},"sessions_deleted":{"type":"integer","format":"int64","description":"Number of `analytics_sessions` rows deleted by this call.","minimum":0}}},"AnalyticsRecordRequest":{"type":"object","description":"`POST /analytics/record` request body. The endpoint is OptionalJWT\n— the caller may be a logged-in user, an authenticated\nAPI token, or an anonymous web visitor; the handler reads the\nprincipal-if-any from request extensions and stamps `user_id` /\n`org_id` accordingly.","required":["event_name"],"properties":{"event_name":{"type":"string","description":"Event slug — `1 ≤ len ≤ ANALYTICS_EVENT_NAME_MAX`. The wire\nsurface uses dot-separated lower-snake_case by convention\n(`signup.completed`, `dashboard.path_tier.viewed`) but the\nschema imposes no inner structure."},"occurred_at":{"type":["string","null"],"description":"Caller-provided RFC3339 timestamp of the event. The handler\npre-validates parse-ability; `None` ⇒ `state.clock.now()`."},"properties":{"description":"Optional free-form properties map. Stored verbatim as the\nJSON `properties` column. Total serialised size capped by\n[`ANALYTICS_PROPERTIES_MAX_BYTES`] (enforced in the handler,\nnot by `garde` — `Value` length is not introspectable\nat derive time)."},"session_id":{"type":["string","null"],"description":"Optional session id; binds this event to an\n`analytics_sessions` row when the caller is tracking a\nmulti-event visit. Absent for fire-and-forget pings."}},"additionalProperties":false},"AnalyticsRecordResponse":{"type":"object","description":"`POST /analytics/record` response. Carries only the freshly\nminted row id so the caller can correlate a follow-up event to\nthe same row (e.g. for client-side dedup).","required":["id"],"properties":{"id":{"type":"string","description":"UUIDv7 id of the newly inserted `analytics_events` row."}}},"AnalyticsSessionCloseRequest":{"type":"object","description":"`POST /analytics/session/close` request body. Closes an\nexisting `analytics_sessions` row by setting `ended_at = now`.\nClosing an already-closed row is a no-op (idempotent).","required":["session_id"],"properties":{"ended_at":{"type":["string","null"],"description":"Optional caller-provided RFC3339 timestamp the client wants\nstamped as `ended_at`. The handler validates parse-ability;\n`None` ⇒ `state.clock.now()`."},"session_id":{"type":"string","description":"Session id minted (or refreshed) by `/analytics/beat`."}},"additionalProperties":false},"AnalyticsSessionCloseResponse":{"type":"object","description":"`POST /analytics/session/close` response. `closed = false` when\nthe session id had no row OR was already closed — the latter is\nindistinguishable from a missing id by design (no existence\nprobe, spirit). The endpoint returns 200 either way.","required":["session_id","closed"],"properties":{"closed":{"type":"boolean","description":"`true` when the handler closed an open row, `false` when\neither the row didn't exist or `ended_at` was already\npopulated."},"session_id":{"type":"string","description":"Echoes the request's `session_id` for client correlation."}}},"AnalyticsSummaryDay":{"type":"object","description":"One bucket of [`AnalyticsSummaryResponse::by_day`].","required":["day","events","sessions"],"properties":{"day":{"type":"string","description":"Day of the bucket (`YYYY-MM-DD`)."},"events":{"type":"integer","format":"int64","description":"Events with `created_at` in this day."},"sessions":{"type":"integer","format":"int64","description":"Sessions with `created_at` in this day."}}},"AnalyticsSummaryResponse":{"type":"object","description":"`GET /platform/analytics/summary` response. Three rolling\naggregates: total events across all time, total sessions across\nall time, and per-day buckets for the most recent\n`window_days` (default 30, configurable via `?window_days=`).","required":["total_events","total_sessions","by_day"],"properties":{"by_day":{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsSummaryDay"},"description":"Per-day event counts ordered newest first. Each bucket is\nkeyed on the row's `created_at` truncated to `YYYY-MM-DD`."},"total_events":{"type":"integer","format":"int64","description":"Total `analytics_events` rows."},"total_sessions":{"type":"integer","format":"int64","description":"Total `analytics_sessions` rows."}}},"AnnouncedPrefix":{"type":"object","description":"One BGP-announced prefix with its attached communities. Stored\nJSON-encoded in `bgp_peers.announced_prefixes_json`; the agent maps\n`prefix_id` to the concrete `network_prefixes` row at config-push.","required":["prefix_id"],"properties":{"communities":{"type":"array","items":{"type":"string"},"description":"BGP community strings attached to the announcement (e.g.\n`\"65000:100\"`). Empty ⇒ no communities."},"prefix_id":{"type":"string","description":"`network_prefixes.id` of an `homing='anycast'` prefix to announce."}}},"AnycastAdvertisedTo":{"type":"object","description":"One neighbour a prefix is advertised to, inside the anycast\ndiagnostic.","required":["peer_id","peer_address","peer_asn","state"],"properties":{"peer_address":{"type":"string","description":"Neighbour address."},"peer_asn":{"type":"integer","format":"int64","description":"Remote ASN."},"peer_id":{"type":"string","description":"`bgp_peers.id`."},"state":{"type":"string","description":"Live FSM state (`unknown` when unreported)."},"uptime_s":{"type":["integer","null"],"format":"int64","description":"Seconds in the current state, when reported."}}},"AnycastPrefixStatus":{"type":"object","description":"One advertised prefix's status inside the anycast diagnostic.","required":["prefix_id","prefix","homing","advertised_to"],"properties":{"advertised_to":{"type":"array","items":{"$ref":"#/components/schemas/AnycastAdvertisedTo"},"description":"Neighbours whose `announced_prefixes` config includes this\nprefix, joined with live session state."},"homing":{"type":"string","description":"`single_homed_static` / `anycast`."},"prefix":{"type":"string","description":"The prefix in CIDR notation."},"prefix_id":{"type":"string","description":"`network_prefixes.id`."}}},"ApiErrorBody":{"type":"object","description":"Shape of every non-success response body.","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable machine-readable error label (`\"not_found\"`, `\"validation_failed\"`, …)."},"fields":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FieldError"},"description":"Per-field details for validation failures. `None` for other variants."},"message":{"type":"string","description":"Human-readable summary safe to surface to API clients."}}},"ApiTokenCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/tokens`. Three\nfields: `name` (the human label), `granted_actions` (the action\npatterns the new token may exercise — a strict subset of the\ncaller's effective grants in the resolved org), and the optional\n`expires_at` (RFC3339, future-only). The owning org is bound from\nthe URL path's `{org_id}` capture, never from the body —\npreventing a malicious payload from steering the row into a\ndifferent org than the path's `Enforce` gate authorized.\n\n`name` is bounded `1 ≤ len ≤ 200`; the lower bound refuses an\nempty-string insert because `api_tokens.name` is `NOT NULL`, and\nthe upper bound matches `ServiceAccountCreateRequest::name` /\n`OrgUpdateRequest::name` for symmetry across the IAM area.\n\n`granted_actions` is bounded `1 ≤ len ≤ 32` at the wire layer —\nthe lower bound refuses an empty-set token (a token that grants\nnothing has no purpose; prefers a wire-rejection over\nsilently inserting a useless row), and the upper bound caps the\nJSON-encoded payload at a few KiB so a malicious client cannot\ninflate the row's `granted_actions` column. The per-entry\ncatalog-membership + caller-subset checks run in the handler so\nvalidator's `code` stays decoupled from the action catalog.\n\n`expires_at` is bounded `len ≤ 64` at the wire layer (every\nwell-formed RFC3339 timestamp fits comfortably inside that\nenvelope). The strict `> now()` future-only check and the\nparse-failure rejection both run in the handler.","required":["name","granted_actions"],"properties":{"expires_at":{"type":["string","null"],"description":"Optional RFC3339 expiry timestamp. When present, the handler\nrequires it to be parseable and strictly in the future\nrelative to `state.clock.now()` — an in-past timestamp would\nproduce a dead-on-arrival token because the auth path filters\non `expires_at`. Absent ⇒ no scheduled expiry."},"granted_actions":{"type":"array","items":{"type":"string"},"description":"Action patterns the new token may exercise. Each entry is\neither an exact slug from the catalog or a `<prefix>:*`\nwildcard whose prefix names a known action segment. Bounded\n`1 ≤ len ≤ 32` at the wire layer; the per-entry length and\ncatalog / subset checks run in the handler."},"name":{"type":"string","description":"Human display label for the new token. Bounded\n`1 ≤ len ≤ 200`; the lower bound refuses empty-string inserts\nbecause `api_tokens.name` is `NOT NULL`."}}},"ApiTokenCreateResponse":{"type":"object","description":"Wire response for `POST /iam/orgs/{org_id}/tokens`.\nTwo-field envelope: the freshly minted UUIDv7 `id` and the opaque\n`plaintext` (prefixed with the canonical `apk_` from\n`credential::TOKEN_PREFIX_API`). The plaintext is surfaced\nexactly once on this response and never re-exposed on any list /\nread endpoint — `token_list`, `tokens_self_list`,\nand `token_rotate` deliberately omit the `token_hash`\ncolumn from their projections. The audit row never carries the\nplaintext either; this envelope is the one-and-only carrier from\nthe server.\n\nMirrors [`TokenRotateResponse`] — both endpoints surface a\nfresh secret exactly once. The frontend's create-token modal\nstores the pair `{id, plaintext}` in a one-time-reveal modal; the\nlist endpoint supplies subsequent metadata reads.","required":["id","plaintext"],"properties":{"id":{"type":"string","description":"UUIDv7 identifier of the freshly minted token row (matches\n`api_tokens.id`). Stable across the row's lifetime; the\ncaller stores this id alongside the plaintext to address the\nrow in subsequent rotate / revoke calls."},"plaintext":{"type":"string","description":"The freshly minted opaque API-token plaintext, prefixed\nwith `apk_`. Shown to the caller exactly once; no list /\nread endpoint ever exposes the secret material again."}}},"ApiTokenListItem":{"type":"object","description":"One row of `GET /iam/orgs/{org_id}/tokens`. Read-projection\nof an `api_tokens` row. The `token_hash` column is intentionally\nabsent from the wire — the secret material stays at rest\nonly; once minted, the plaintext is shown to the caller exactly\nonce (at create / rotate time) and never re-surfaces in any list\nresponse.\n\n`owner_kind` is a discriminant string mirroring the audit-row\nshape established by `token_revoke`: `\"user\"` when\n`api_tokens.owner_user_id` is set, `\"service_account\"` when\n`api_tokens.owner_service_account_id` is set. The schema's CHECK\nconstraint guarantees exactly one is non-NULL; `owner_id` carries\nthat single non-NULL value, collapsing the XOR pair into a stable\nwire shape clients can render without inspecting both columns.","required":["id","name","owner_kind","owner_id","granted_actions","created_at","revoked"],"properties":{"created_at":{"type":"string","description":"RFC3339 timestamp the row was created (matches\n`api_tokens.created_at`)."},"expires_at":{"type":["string","null"],"description":"RFC3339 timestamp at which the token expires; `null` for\ntokens with no scheduled expiry."},"granted_actions":{"type":"array","items":{"type":"string"},"description":"Action patterns this token may exercise — a parsed JSON array\nprojected from `api_tokens.granted_actions` (the column stores\nthe JSON-encoded array; the wire shape decodes it to a\n`Vec<String>` so clients consume the array directly rather\nthan re-parsing a stringified payload)."},"id":{"type":"string","description":"UUIDv7 identifier of the token row (matches `api_tokens.id`)."},"last_used_at":{"type":["string","null"],"description":"RFC3339 timestamp the token most recently authenticated a\nrequest (matches `api_tokens.last_used_at`); `null` until the\ntoken is first exercised."},"name":{"type":"string","description":"Human display name (matches `api_tokens.name`). Set at create\ntime; never derived from the secret material."},"owner_id":{"type":"string","description":"UUIDv7 of the owning principal — `users.id` when `owner_kind\n= \"user\"`, `service_accounts.id` when `owner_kind =\n\"service_account\"`. Carries the single non-NULL of the\nXOR-constrained owner columns."},"owner_kind":{"type":"string","description":"Owner discriminant — one of `\"user\"`, `\"service_account\"`.\nResolved from which of `api_tokens.owner_user_id` /\n`api_tokens.owner_service_account_id` is non-NULL (the schema\nCHECK guarantees exactly one is set)."},"revoked":{"type":"boolean","description":"`true` iff the token has been soft-revoked (i.e.\n`api_tokens.revoked = 1`). Both active and revoked rows are\nlisted; clients filter on this field."}}},"ApiTokenListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/tokens`. A bare\nobject with a single `tokens` array — keeps the door open to add\nenvelope-level fields (`total`, `has_more`, future cursor) without\nbreaking clients that already parse the array shape, mirroring\n`OrgMemberListResponse`.","required":["tokens"],"properties":{"tokens":{"type":"array","items":{"$ref":"#/components/schemas/ApiTokenListItem"},"description":"API tokens owned by the resolved org, ordered by\n`(created_at DESC, id DESC)` — newest first, with the\n`id DESC` tie-breaker keeping rows ordered when two seeds\nland in the same RFC3339 second."}}},"AuditEventListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/audit-events`. One-array\nenvelope plus an opaque `next_cursor` token. The cursor is `None`\nwhen the page contained fewer than `limit` rows (i.e. there is no\nfurther page); a non-null cursor MUST be passed back verbatim on\nthe follow-up call.","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/AuditEventRead"},"description":"Audit rows for the resolved org, ordered `(ts DESC, id DESC)`."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-encoded cursor for the next page; `null` when\nthe current page is the last."}}},"AuditEventRead":{"type":"object","description":"One row of `GET /iam/orgs/{org_id}/audit-events`. Mirrors the columns\nof `audit_events` (migration `0007_audit_init.sql`) projected to the\nwire — `prev_hmac` / `hmac` are intentionally omitted (the chain-link\nsecret-keyed HMAC is operator-only data; the chain verifier reads it\ndirectly off the table).","required":["id","ts","action","target_ids","metadata"],"properties":{"action":{"type":"string","description":"Audit-row action label. Free-form on the audit row\ncarve-out — emitter strings such as `iam:org:deleted` are valid\neven though the catalog slug they document is `iam:org:delete`."},"id":{"type":"integer","format":"int64","description":"Monotonic AUTOINCREMENT id from `audit_events.id`. Used together\nwith `ts` as the cursor tie-breaker so two emits in the same\nRFC3339 second still round-trip in stable order."},"metadata":{"description":"Free-form audit metadata column, returned verbatim.\nCarve-out: audit metadata is the one wire surface where a\nfree-form JSON object is permitted (the alternative is a\nstringly-typed shape that strips the structure callers need\nto render the row)."},"org_id":{"type":["string","null"],"description":"Origin org id for the event. NULL for platform-level rows\n(cross-org or org-less actions). The org-scoped read endpoint\nalways populates this with the path-resolved org; the\ncross-org read endpoint surfaces whatever the row stores so\nstaff can route each event back to its origin without a\nfollow-up SELECT."},"target_ids":{"type":"array","items":{"type":"string"},"description":"Target-id list. Decoded from the JSON-array `target_ids`\ncolumn; an empty array round-trips as `[]`."},"target_kind":{"type":["string","null"],"description":"Target-kind tag extracted from `metadata.target_kind` when\npresent. Most rows emitted by handlers populate this; rows\nwhere the emitter omitted it surface as JSON `null`."},"ts":{"type":"string","description":"RFC3339 UTC timestamp the row was emitted at."},"user_id":{"type":["string","null"],"description":"Principal id that triggered the event. NULL for platform-level\nrows (worker-N housekeeping, anonymous deny rows)."}}},"AuditFirstAnchorResponse":{"type":"object","description":"`POST /platform/audit/first-anchor` response body.","required":["first_id","anchored_id","anchored_hmac","verified_count"],"properties":{"anchored_hmac":{"type":"string","description":"The oldest row's `prev_hmac`, now trusted, as lowercase hex."},"anchored_id":{"type":"integer","format":"int64","description":"The anchored id (`first_id - 1`)."},"first_id":{"type":"integer","format":"int64","description":"Oldest surviving row; the chain is verified from here on."},"verified_count":{"type":"integer","format":"int64","description":"Rows verified from the new anchor before it was committed."}}},"AuditVerifyIntegrityResponse":{"type":"object","description":"`POST /platform/audit/verify-integrity` response body.","required":["verified_count","last_id"],"properties":{"failed_at_id":{"type":["integer","null"],"format":"int64","description":"`id` of the first row that failed verification, or `None`\nwhen the entire chain reproduces cleanly. A tampered HMAC\nsurfaces as the row whose own HMAC no longer matches; a\nchain break (e.g. row deletion mid-stream) surfaces as the\nfirst row whose `prev_hmac` no longer matches the prior\nrow's `hmac`."},"last_id":{"type":"integer","format":"int64","description":"`id` of the highest-numbered row in `audit_events` at the\ntime of verification. Lets callers correlate the verified\ncount to chain length. `0` on an empty table."},"verified_count":{"type":"integer","format":"int64","description":"Number of rows whose `hmac` reproduces from\n`(secret, prev_hmac || canonical_row_bytes)`. When the chain\nis intact end-to-end this equals `last_id`. When the chain\ndiverges at some row, `verified_count` is the count of rows\npreceding that divergence (rows past the break are not\nfurther inspected — they cannot be trusted to chain\ncorrectly even if individually well-formed)."}}},"AvailableIpListResponse":{"type":"object","description":"Response body for `GET /static-ips/available`.","required":["static_ips"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."},"static_ips":{"type":"array","items":{"$ref":"#/components/schemas/AvailableIpRead"},"description":"Page of available IPs ordered by `ip_address ASC, id ASC`."}}},"AvailableIpRead":{"type":"object","description":"One row in the anonymous / pre-claim view of an available IP.\nDoes not include org/subscription fields (they are always null for\n`status = 'available'` rows).","required":["id","ip_address","pool_id","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation timestamp."},"id":{"type":"string","description":"UUIDv7 primary key (`public_ips.id`)."},"ip_address":{"type":"string","description":"The public IPv4 address string."},"pool_id":{"type":"string","description":"UUIDv7 of the IP pool this address belongs to."}}},"BandwidthHistoryItem":{"type":"object","description":"One per-day bucket of\n`GET /billing/subscriptions/{subscription_id}/bandwidth/history`.\nThe handler rolls up\n`tunnel_traffic_samples` to subscription level via JOIN on\n`tunnels.subscription_id`, summed per day. Each bucket's\n`period_start` is the UTC day boundary the rollup keys on; the\nmatching `period_end` is `period_start + 1 day` exclusive.\n\n`bytes_in` / `bytes_out` are signed `i64` to match every other\ncounter the billing area surfaces; the schema CHECK\n(`bytes_in >= 0`, `bytes_out >= 0`) on `tunnel_traffic_samples`\nguarantees the sum stays non-negative.","required":["period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Sum of `tunnel_traffic_samples.bytes_in` across every tunnel\nof the resolved subscription, restricted to samples whose\n`period_start` falls in `[bucket.period_start,\nbucket.period_end)`."},"bytes_out":{"type":"integer","format":"int64","description":"Sum of `tunnel_traffic_samples.bytes_out` across every\ntunnel of the resolved subscription, restricted to samples\nwhose `period_start` falls in `[bucket.period_start,\nbucket.period_end)`."},"period_end":{"type":"string","description":"RFC3339 UTC timestamp one day after `period_start`\n(exclusive upper bound of the bucket)."},"period_start":{"type":"string","description":"RFC3339 UTC timestamp at the start of the day-bucket. The\nrollup keys on UTC midnight; the `period_end` of the bucket\nis `period_start + 1 day` exclusive."}}},"BandwidthHistoryListResponse":{"type":"object","description":"Wire response for\n`GET /billing/subscriptions/{id}/bandwidth/history`. One-array\nenvelope plus an opaque `next_cursor` token. Mirrors the\n`AddonListResponse` precedent in the sibling `addon_types.rs`.\n\n`next_cursor` is `None` on the last page (the page returned\nfewer than `limit` rows); a non-null cursor MUST be passed back\nverbatim on the follow-up call. The cursor codec ships with\nthis type (below); the matching handler consumes it.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BandwidthHistoryItem"},"description":"Per-day buckets for the resolved subscription, ordered\n`period_start DESC` (newest first). The handler PR pins\nthe ordering; the type carries no ordering guarantee on\nits own — frontends MUST render in vector order."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad-encoded cursor for the next page;\n`null` when the current page is the last."}}},"BandwidthUsage":{"type":"object","description":"Bandwidth slice of [`SubscriptionUsageRead`] — one row of\n`bandwidth_quotas` projected to the wire.\nNULL at the parent level when the subscription has no\n`bandwidth_quotas` row yet (the rollover worker creates the row\nlazily on the first sample).\n\n`monthly_limit_bytes` is `Option<i64>` because the schema column\nis nullable (NULL = unlimited). `percent_used` is `Option<i64>`:\nNULL when the limit is NULL (unlimited) or `0` (the wire avoids a\ndivide-by-zero). Otherwise `((bytes_in + bytes_out) * 100) /\nmonthly_limit_bytes` rounded down — uncapped, so an over-cap\nsubscription surfaces > 100 rather than being clamped.","required":["period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Inbound bytes seen in the active period\n(`bandwidth_quotas.bytes_in`)."},"bytes_out":{"type":"integer","format":"int64","description":"Outbound bytes seen in the active period\n(`bandwidth_quotas.bytes_out`)."},"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"Cap on `bytes_in + bytes_out` for the period\n(`bandwidth_quotas.monthly_limit_bytes`). NULL = unlimited."},"percent_used":{"type":["integer","null"],"format":"int64","description":"`((bytes_in + bytes_out) * 100) / monthly_limit_bytes`,\nrounded down. NULL when `monthly_limit_bytes` is NULL or 0."},"period_end":{"type":"string","description":"RFC3339 UTC end of the active period\n(`bandwidth_quotas.period_end`)."},"period_start":{"type":"string","description":"RFC3339 UTC start of the active period\n(`bandwidth_quotas.period_start`)."}}},"BgpPeerCreateRequest":{"type":"object","description":"Request body for `POST /platform/bgp/peers`. The agent must exist and\ncarry the `bgp_speaker` capability (handler-checked). `(agent_id,\npeer_address)` is UNIQUE → 422 `peer_taken`.","required":["agent_id","peer_address","peer_asn"],"properties":{"agent_id":{"type":"string","description":"Owning agent id. Handler-validated to exist + carry `bgp_speaker`."},"announced_prefixes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AnnouncedPrefix"},"description":"Prefixes to announce. Absent ⇒ `[]`."},"capabilities":{"type":["array","null"],"items":{"type":"string"},"description":"Address-family capabilities. Absent ⇒ `[\"ipv4-unicast\"]`.\nHandler-validated against the allowed set."},"hold_time":{"type":["integer","null"],"format":"int64","description":"BGP hold timer in seconds. Absent ⇒ `90`. `3..=65535`."},"password":{"type":["string","null"],"description":"Optional TCP-MD5 / peer password. AEAD-sealed into `password_ct`;\nnever stored or projected in clear. `None` ⇒ no\npassword."},"peer_address":{"type":"string","description":"BGP neighbour address. Non-empty; handler-checked as a parseable\nIP literal."},"peer_asn":{"type":"integer","format":"int64","description":"Remote AS number. `>= 0`; the agent enforces the 32-bit ASN\nceiling at config-push (the column is `i64`)."},"status":{"type":["string","null"],"description":"Initial status — `enabled` / `disabled`. Absent ⇒ `disabled`\n(a new peer stays parked until the operator enables it)."}}},"BgpPeerDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/bgp/peers/{id}` — a bare success ack.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on a 200 — the peer row was hard-deleted."}}},"BgpPeerListResponse":{"type":"object","description":"Response envelope for `GET /platform/bgp/peers`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BgpPeerRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null` when\nno more rows remain."}}},"BgpPeerRead":{"type":"object","description":"Staff-tier BGP-peer row. `password_ct` is intentionally absent\n— the wire never carries the sealed credential.","required":["id","agent_id","peer_address","peer_asn","hold_time","capabilities","announced_prefixes","status","created_at","updated_at"],"properties":{"agent_id":{"type":"string","description":"Owning agent (`agents.id`) — the BgpSpeaker-capable fleet member."},"announced_prefixes":{"type":"array","items":{"$ref":"#/components/schemas/AnnouncedPrefix"},"description":"Prefixes this peer is configured to announce."},"capabilities":{"type":"array","items":{"type":"string"},"description":"Address-family capabilities negotiated with the peer\n(`ipv4-unicast` / `ipv6-unicast`)."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"hold_time":{"type":"integer","format":"int64","description":"BGP hold timer in seconds."},"id":{"type":"string","description":"`bgp_peers.id` (UUIDv7)."},"last_state_change_at":{"type":["string","null"],"description":"RFC3339 of the last `status` change, or `null` if never toggled."},"peer_address":{"type":"string","description":"BGP neighbour address (IPv4 / IPv6 literal)."},"peer_asn":{"type":"integer","format":"int64","description":"Remote autonomous-system number."},"status":{"type":"string","description":"`enabled` / `disabled` — the admin on/off toggle. Ships\n`disabled`; a peer never announces until toggled on."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"BgpPeerSessionTelemetry":{"type":"object","description":"One BGP neighbour's session slice inside a `bgp_speaker`\ncapability report (`{ peer_address, state,\nuptime_s, prefixes_advertised }`). `state` carries the RFC 4271\nFSM name as the agent observes it (`idle` / `connect` / `active` /\n`opensent` / `openconfirm` / `established`) — stored verbatim, not\nre-validated as an enum, because a future speaker revision must be\nable to report a new state without a control-plane lockstep.","required":["peer_address","state"],"properties":{"peer_address":{"type":"string","description":"The neighbour address this slice describes — joins against\n`bgp_peers.peer_address`."},"prefixes_advertised":{"type":["integer","null"],"format":"int64","description":"Prefixes currently advertised to this neighbour."},"state":{"type":"string","description":"RFC 4271 FSM state name, lowercase."},"uptime_s":{"type":["integer","null"],"format":"int64","description":"Seconds the session has been in its current state."}}},"BgpPeerUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/bgp/peers/{id}`. Partial update:\nomit ⇒ column unchanged. `password` is a double-option: JSON `null`\nclears `password_ct`, a string re-seals it, omitted leaves it.","properties":{"announced_prefixes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AnnouncedPrefix"},"description":"New announced-prefix set. Omit ⇒ unchanged."},"capabilities":{"type":["array","null"],"items":{"type":"string"},"description":"New capability set. Omit ⇒ unchanged. Handler-validated against\nthe allowed set."},"hold_time":{"type":["integer","null"],"format":"int64","description":"New hold timer (seconds). Omit ⇒ unchanged. `3..=65535`."},"password":{"type":["string","null"],"description":"New password. Omit ⇒ unchanged; JSON `null` ⇒ clears `password_ct`;\na string ⇒ re-AEAD-seals it. The `double_option` adapter\ndistinguishes absent (outer `None`) from explicit null\n(`Some(None)`)."},"peer_asn":{"type":["integer","null"],"format":"int64","description":"New remote AS number. Omit ⇒ unchanged. `>= 0`."},"status":{"type":["string","null"],"description":"New status — `enabled` / `disabled`. Omit ⇒ unchanged. A change\nstamps `last_state_change_at`. This is the on/off toggle."}}},"BgpSessionListResponse":{"type":"object","description":"Response envelope for `GET /platform/bgp/sessions`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BgpSessionRead"},"description":"Page contents — newest-configured first, capped at the\nrequest's `limit` (default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`."}}},"BgpSessionRead":{"type":"object","description":"One configured neighbour joined with its live session state.","required":["peer_id","agent_id","agent_name","peer_address","peer_asn","status","state"],"properties":{"agent_id":{"type":"string","description":"Owning agent (`agents.id`)."},"agent_name":{"type":"string","description":"Owning agent's display name."},"last_state_change_at":{"type":["string","null"],"description":"RFC3339 of the last admin `status` toggle, or `null`."},"peer_address":{"type":"string","description":"BGP neighbour address."},"peer_asn":{"type":"integer","format":"int64","description":"Remote autonomous-system number."},"peer_id":{"type":"string","description":"`bgp_peers.id` (UUIDv7)."},"prefixes_advertised":{"type":["integer","null"],"format":"int64","description":"Prefixes currently advertised to this neighbour, when reported."},"state":{"type":"string","description":"RFC 4271 FSM state from the agent's latest heartbeat\n(`idle` / `connect` / `active` / `opensent` / `openconfirm` /\n`established`), or `unknown` when the agent has reported no\ntelemetry for this neighbour."},"status":{"type":"string","description":"The row's admin toggle — `enabled` / `disabled`."},"uptime_s":{"type":["integer","null"],"format":"int64","description":"Seconds in the current state, when reported."}}},"BgpWithdrawResponse":{"type":"object","description":"Response for `POST /platform/bgp/peers/{id}/withdraw`.","required":["peer_id","delivered"],"properties":{"delivered":{"type":"boolean","description":"`true` when at least one live agent WS socket received the\ncommand; `false` means the agent is offline and the withdraw\nwill not happen until it reconnects (the command is NOT\nqueued — re-issue after the agent is back)."},"peer_id":{"type":"string","description":"The `bgp_peers.id` the command targeted, echoed back."}}},"BillingEmailConfirm":{"type":"object","description":"The token from the link.","required":["token"],"properties":{"token":{"type":"string"}}},"BillingEmailConfirmed":{"type":"object","description":"The confirmed address.","required":["billing_email"],"properties":{"billing_email":{"type":"string"},"org_name":{"type":["string","null"]}}},"BillingPortalRead":{"type":"object","description":"Response body — the hosted billing-portal URL the frontend\nredirects to.","required":["portal_url"],"properties":{"portal_url":{"type":"string","description":"The hosted billing-portal URL Stripe expects the customer to be\nredirected to."}}},"BillingPortalRequest":{"type":"object","description":"Request body for `POST /billing/portal`.","required":["return_url"],"properties":{"org_id":{"type":["string","null"],"format":"uuid","description":"The org whose billing to manage (the console's workspace). Defaults\nto the caller's personal org."},"return_url":{"type":"string","description":"URL Stripe returns the browser to when the customer leaves the\nportal (the deployment's billing page)."}}},"BillingSettingsRead":{"type":"object","description":"Read shape for `GET /settings/billing` and the\n`PATCH /settings/billing` 200 response. One field per\n`billing_settings` column with the wire naming preserved 1:1.\n\nLazy-row contract (same as `SystemSettingsRead` /\n`StripeSettingsRead`): the row at `id = 1` is created lazily by\nthe first writer (comment in 0008). A GET against an empty\n`billing_settings` table surfaces the column DEFAULTs\n(`trial_days = 0`, `grace_period_days = 3`,\n`invoice_prefix = None`, `updated_at = \"1970-01-01T00:00:00Z\"`)\nso the wire shape stays uniform regardless of whether a write\nhas happened yet. The matching handler is responsible for\nthe lazy-default projection.\n\n`invoice_prefix` is `Option<String>` because the schema column\nis nullable TEXT; every other column is `NOT NULL` and surfaces\nas a non-optional field.\n\n`updated_at` is RFC3339 UTC. It is server-stamped on every PATCH\n(via `state.clock.now()`) and read-only — absent from the\nmatching [`BillingSettingsUpdate`] type.","required":["trial_days","grace_period_days","updated_at","free_tier_enabled"],"properties":{"free_tier_enabled":{"type":"boolean","description":"Platform-admin toggle: whether new free-tier\n(price `$0`) subscriptions may be created at all via\n`POST /billing/subscriptions`. Backed by\n`billing_settings.free_tier_enabled`, schema DEFAULT `1`.\nExisting free-tier subscriptions are unaffected when this\nflips to `false` — it gates creation only. See\n`crate::platform::billing::free_tier_policy`."},"free_tier_max_active_orgs":{"type":["integer","null"],"format":"int64","description":"Platform-wide cap on the number of orgs simultaneously\nholding an `active`/`grace` free-tier subscription. `null`\n(the schema DEFAULT) is uncapped. Backed by\n`billing_settings.free_tier_max_active_orgs`."},"grace_period_days":{"type":"integer","format":"int64","description":"Grace-period length in days after a failed renewal before the\nsubscription transitions out of `grace`. Schema CHECK is\n`grace_period_days >= 0`; the [`BillingSettingsUpdate`]\nvalidator additionally caps at 365 (1 year)."},"invoice_prefix":{"type":["string","null"],"description":"Customer-facing prefix used when minting invoice numbers.\nNullable TEXT in the schema — `None` is wire-equivalent to\n\"operator has not set one yet\"; the billing code paths fall\nback to a hard-coded default in that case."},"trial_days":{"type":"integer","format":"int64","description":"Trial-subscription length in days. Schema CHECK is\n`trial_days >= 0`; the [`BillingSettingsUpdate`] validator\nadditionally caps at 1095 (~3 years) so a typo can never\nsilently land a multi-decade trial."},"updated_at":{"type":"string","description":"RFC3339 UTC timestamp of the last write. Server-stamped on\nevery PATCH; on a fresh deployment with no write yet, the\nhandler surfaces `\"1970-01-01T00:00:00Z\"` so the wire\nshape stays non-optional."}}},"BillingSettingsUpdate":{"type":"object","description":"Request body for `PATCH /settings/billing`. Every field is\n`Option<T>` so a JSON object that omits a key leaves the column\nunchanged. An empty-object PATCH (`{}`) is a no-op at the\ncolumn level — only `updated_at` advances (the handler\nmirrors the no-op semantics).\n\nThe nullable text column (`invoice_prefix`) uses `Option<String>`.\nThe matching handler treats an explicit empty string as\n\"clear to NULL\" (i.e. `{\"invoice_prefix\": \"\"}` clears the column);\na non-empty string sets the column. Distinguishing \"omit\" from\n\"explicit null\" without that convention requires an\n`Option<Option<T>>` double-option pattern; the\nempty-string-clears convention is strictly simpler and matches\nhow the dashboard's text inputs already round-trip.\n\n`garde` constraints fire only when the field is `Some(_)` —\n`None` is skipped automatically by the `garde` crate's\n`Option` semantics.\n\n`updated_at` is server-stamped on every PATCH and is\nintentionally absent from this type — the wire cannot override\nthe timestamp.","properties":{"free_tier_enabled":{"type":["boolean","null"],"description":"New `free_tier_enabled` toggle. `None` leaves the column\nunchanged (platform-admin-editable at runtime, no\ncode deploy required to flip it)."},"free_tier_max_active_orgs":{"type":["integer","null"],"format":"int64","description":"New `free_tier_max_active_orgs` cap. Absent key ⇒ unchanged;\nexplicit JSON `null` ⇒ clears the cap (uncapped); a\nnon-negative integer ⇒ sets the cap. Uses the same\n`Option<Option<T>>` \"present vs absent\" convention as\n`platform_dns_filter_lists_write_types::PlatformDnsFilterListPatchRequest`\nso a numeric nullable column can distinguish \"leave the cap\nalone\" from \"remove the cap\" — the `invoice_prefix`\nempty-string-clears convention above does not apply to a\nnumeric column. Negative values are rejected by the\nhandler (garde cannot range-validate through the nested\n`Option`)."},"grace_period_days":{"type":["integer","null"],"format":"int64","description":"New `grace_period_days`. Schema CHECK pins `>= 0`; the\nvalidator additionally caps at 365 (1 year)."},"invoice_prefix":{"type":["string","null"],"description":"New `invoice_prefix`. Capped at 16 chars (matches the\nshape of typical invoice-number prefixes — e.g. `\"INV-\"`,\n`\"AS-2026-\"`). Empty string clears the column to NULL\n(handler convention)."},"trial_days":{"type":["integer","null"],"format":"int64","description":"New `trial_days`. Schema CHECK pins `>= 0`; the validator\nadditionally caps at 1095 (~3 years) so a typo can never\nsilently land a multi-decade trial."}}},"BindingExitServerRequest":{"type":"object","description":"Request body for `PATCH /platform/bindings/{id}/exit-server`.\nThe single `exit_server_id` field is **required**: this\nendpoint exists only to set or clear the relay, so an absent key\nis a 422 (handled by the `double_option` `None` arm), not a\nno-op. `#[serde(deny_unknown_fields)]` rejects a stray key at the\n`Json` extractor (the create posture).\n`#[derive(Validate)]` carries no field rules — the only field is\na `Uuid` whose validity the type system already enforces and\nwhose required-ness is the handler's double-option `None` check\n(requires every request DTO derive `garde::Validate`; the\nhandler still calls `.validate()` for the uniform boundary).","properties":{"exit_server_id":{"type":["string","null"],"description":"The inter-hub egress server (`servers.id`). A uuid ⇒ set the\nrelay (validated handler-side: the server exists, its agent\nis `joined`, the binding has an ingress hub, no conflicting\n`external_exit_id`, and an internal cross-hub `pop_links`\ncarrier connects the ingress PoP to the target PoP — or the\ntarget shares the ingress PoP). Explicit JSON `null` ⇒ clear\nit (egress reverts to the ingress PoP). Omitted ⇒ 422\n`field_required`. `#[schema(value_type = Option<String>)]`\nkeeps the OpenAPI shape a clean nullable string (the\nnested option is a serde-only detail)."}},"additionalProperties":false},"BindingExitServerResponse":{"type":"object","description":"Response body for `PATCH /platform/bindings/{id}/exit-server`\n— the binding id and its resolved `exit_server_id`\n(`null` after a clear) so the caller reads-after-write in one\nround trip. Response-only, no `Validate`;\n`ToSchema`.","required":["binding_id"],"properties":{"binding_id":{"type":"string","description":"`bindings.id` — the binding whose relay was set/cleared."},"exit_server_id":{"type":["string","null"],"description":"`bindings.exit_server_id` after the write — `null` when the\nrelay was cleared (egress at the ingress PoP), the target\n`servers.id` when set."}}},"BindingPatchStatus":{"type":"string","description":"The three terminal statuses the routing agent reports through\n`PATCH /router/bindings/{id}/status`. Each variant\n`serde(rename)`s to its lowercase string so the wire round-\ntrips through the `bindings.status` column's stored form\nwithout an int-cast.\n\nThe schema's full status enum admits two further values\n(`'pending'`, `'removing'`) that this enum deliberately omits —\nthose are server-side-only transitions the control plane writes\non customer claim / unbind. An agent that posted `\"pending\"`\nhere would be reverting the server's own state, which the\nprotocol does not admit.","enum":["active","failed","removed"]},"BindingsMigrateRequest":{"type":"object","description":"`POST /platform/bindings/migrate` request — batch `rule_type`\nmigration (replaces the legacy `/admin/routing-rules/migrate`).","required":["from_rule_type","to_rule_type"],"properties":{"dry_run":{"type":["boolean","null"],"description":"`true` = report the would-migrate count without mutating."},"from_rule_type":{"type":"string","description":"Source `rule_type` (`dnat` / `snat` / `both`)."},"to_rule_type":{"type":"string","description":"Target `rule_type` (`dnat` / `snat` / `both`)."}}},"BindingsMigrateResponse":{"type":"object","description":"`POST /platform/bindings/migrate` response.","required":["migrated","dry_run"],"properties":{"dry_run":{"type":"boolean","description":"Echo of the effective dry-run flag."},"migrated":{"type":"integer","format":"int64","description":"Live rows migrated (or that would be, when `dry_run`)."}}},"BindingsResetPendingBulkRequest":{"type":"object","description":"`POST /platform/bindings/reset-pending` (bulk) request.","properties":{"dry_run":{"type":["boolean","null"],"description":"`true` = report the would-reset count without mutating."},"stuck_after_minutes":{"type":["integer","null"],"format":"int64","description":"Only rows that have sat in `pending` / `failed` longer than\nthis many minutes are re-queued. Default 15."}}},"BindingsResetPendingBulkResponse":{"type":"object","description":"`POST /platform/bindings/reset-pending` (bulk) response.","required":["reset","dry_run","stuck_after_minutes"],"properties":{"dry_run":{"type":"boolean","description":"Echo of the effective dry-run flag."},"reset":{"type":"integer","format":"int64","description":"Rows re-queued (or that would be, when `dry_run`)."},"stuck_after_minutes":{"type":"integer","format":"int64","description":"Echo of the effective stuck-after window in minutes."}}},"BridgeEndpointListResponse":{"type":"object","description":"Response envelope for `GET /platform/quic-servers/{id}/bridges`.","required":["bridges"],"properties":{"bridges":{"type":"array","items":{"$ref":"#/components/schemas/BridgeEndpointRead"},"description":"Every bridge for the server, ordered by `priority` ascending\nthen `id` -- the same order the client dial loop\n(`quic_bridge_dial::ordered_endpoints` in the agent crate)\nwalks after the primary endpoint."}}},"BridgeEndpointRead":{"type":"object","description":"One bridge endpoint row on the wire.","required":["id","server_id","endpoint","priority","enabled","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 of row creation."},"enabled":{"type":"boolean","description":"Whether this bridge is currently distributed to clients.\nDisabled bridges are retained (not deleted) so an operator can\npull one out of rotation without losing its history."},"endpoint":{"type":"string","description":"The alternate `host:port`."},"id":{"type":"string","description":"`quic_server_bridge_endpoints.id` (UUIDv7)."},"label":{"type":["string","null"],"description":"Operator note, or `null` if unset."},"priority":{"type":"integer","format":"int64","description":"Dial order (ascending = tried first among bridges)."},"server_id":{"type":"string","description":"The owning `servers.id`."},"updated_at":{"type":"string","description":"RFC3339 of the last update."}}},"BulkDeleteItem":{"type":"object","description":"What happened to one account.","required":["user_id","ok"],"properties":{"error":{"type":["string","null"],"description":"Why it was refused: `not_found`, `target_is_staff`,\n`cannot_delete_own_account`, `account_already_closed`, …"},"ok":{"type":"boolean","description":"Removed (or its erasure is under way)."},"status":{"type":["string","null"],"description":"The deletion's status: `completed`, or `purging`/`failed` when the\nerasure is held or will be retried."},"user_id":{"type":"string","format":"uuid","description":"The account."}}},"BulkDeleteRequest":{"type":"object","description":"`POST /platform/users/bulk-delete` body.","required":["user_ids","note"],"properties":{"note":{"type":"string","description":"Why (3 to 500 characters), recorded on each."},"user_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The accounts to remove (1 to 100)."}}},"BulkDeleteResponse":{"type":"object","description":"`POST /platform/users/bulk-delete` response.","required":["results"],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkDeleteItem"},"description":"One per requested account, in order."}}},"BulkStatusEntry":{"type":"object","description":"One entry inside a bulk status-acknowledgement batch.\n\nMirrors the single-rule body shape so an agent batching its\nper-row reads can lift each row into a `BulkStatusEntry`\nwithout restructuring. The `id` is carried as a `String` so the\nwire-layer decoder accepts any opaque binding-id token; the\nhandler parses it as a UUID per entry and surfaces a malformed\nid as a per-row `error_code = \"validation_failed\"` rather than\nfailing the entire batch on one bad token.","required":["id","status","public_ip","destination_ip"],"properties":{"destination_ip":{"type":"string","description":"Internal target the binding forwarded to, echoed back from\nthe agent's read of the row. The other half of\nthe tuple validated against `bindings.destination_ip`."},"error_message":{"type":["string","null"],"description":"Failure reason. Populated on\n[`BindingPatchStatus::Failed`] entries; NULL on the success\ntransitions. The handler refuses\n`error_code = \"validation_failed\"` per entry when this is\n`None` on a `failed` transition. Stored verbatim on\n`bindings.last_error`."},"id":{"type":"string","description":"Target binding row id. Echoed verbatim into the matching\n[`BulkStatusPatchResult::id`] so the agent can pair entries\nto results by id (in addition to the index-position pairing\nthe response order guarantees)."},"public_ip":{"type":"string","description":"Public-facing IP the binding routed, echoed back from the\nagent's read of the row. Half of the\n`(public_ip, destination_ip)` tuple the handler\nvalidates against the binding's current DB row before\napplying the per-entry status transition. This is\nthe structural fix for the legacy value-blind-delete\ndisaster carried into the bulk surface."},"status":{"$ref":"#/components/schemas/BindingPatchStatus","description":"Terminal status the agent is reporting for this entry. One\nof `\"active\"` / `\"failed\"` / `\"removed\"` — the same agent-\nreportable subset admits. Server-side-only `'pending'`\n/ `'removing'` values are rejected at the wire-decode layer\nby [`BindingPatchStatus`]'s serde derive."}}},"BulkStatusPatchRequest":{"type":"object","description":"Request body for `PATCH /router/bindings/status`. A bulk envelope\naround per-entry status acknowledgements. Capped at 200 entries\nper call by the validator derive — an oversize batch surfaces as\n`422 validation_failed` at the wire layer before any per-entry\nprocessing.","required":["entries"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/BulkStatusEntry"},"description":"Per-entry status acknowledgements. Validator-capped at 200\nentries per call (`min = 1, max = 200`); each entry's shape\nis checked via `validate(nested)` so a malformed entry\nshort-circuits the entire request."}}},"BulkStatusPatchResponse":{"type":"object","description":"Response body for `PATCH /router/bindings/status`. Carries one\n[`BulkStatusPatchResult`] per request entry, in the same order.","required":["results"],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkStatusPatchResult"},"description":"Per-entry outcomes, ordered to match the request's\n`entries` array."}}},"BulkStatusPatchResult":{"type":"object","description":"One per-entry outcome inside the bulk response array.\n\n`ok = true` ⇒ the entry's status transition committed; the\nmatching binding row was UPDATEd and one\n`router:binding:status_patched` audit row was emitted.\n`ok = false` ⇒ the entry was refused; the row was not mutated\nand `error_code` carries a stable token explaining the refusal.\n\nCodomain of `error_code` (only populated when `ok = false`):\n\n- `\"not_found\"` — the binding id is unknown OR is owned by a\n  different agent. The wire never distinguishes the two\n  so a probing agent cannot enumerate bindings owned by other\n  agents.\n- `\"tuple_mismatch\"` — the entry's\n  `(public_ip, destination_ip)` tuple does not match the\n  binding's current DB row.\n- `\"invalid_transition\"` — the entry's `status` is not one of\n  the six admitted transitions for the row's current status\n  (`pending → active|failed`, `removing → removed|failed`,\n  `suspending → suspended|failed`).\n- `\"validation_failed\"` — entry-level shape error caught\n  between the wire-layer `validate()` pass and the per-entry tx\n  (e.g. malformed binding id token, missing `error_message` on\n  a `failed` transition).","required":["id","ok"],"properties":{"error_code":{"type":["string","null"],"description":"Stable token explaining a refusal. `None` when\n[`Self::ok`] is `true`. One of `\"not_found\"`,\n`\"tuple_mismatch\"`, `\"invalid_transition\"`,\n`\"validation_failed\"`."},"id":{"type":"string","description":"Binding row id this result applies to. Echoed from the\nmatching [`BulkStatusEntry::id`] verbatim."},"ok":{"type":"boolean","description":"`true` ⇒ the entry's transition committed; `false` ⇒ the\nentry was refused (see [`Self::error_code`])."}}},"CardExceptionCreateRequest":{"type":"object","description":"Body of `POST /platform/card-exceptions`.","required":["org_id","note"],"properties":{"note":{"type":"string","description":"Why (shown to staff only)."},"org_id":{"type":"string","format":"uuid","description":"The organization. The exception is for the card it has on file now."}}},"CardExceptionListResponse":{"type":"object","description":"`GET /platform/card-exceptions` response.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CardExceptionRead"},"description":"Exceptions, newest first."}}},"CardExceptionRead":{"type":"object","description":"One card screening exception.","required":["id","org_id","note","granted_at"],"properties":{"brand":{"type":["string","null"],"description":"Brand of the card it covers, e.g. `visa`."},"covered_reason":{"type":["string","null"],"description":"The failed check on record when it was granted: `cvc_failed` or\n`postal_failed`. Absent when the card was passing."},"granted_at":{"type":"string","description":"When it was granted."},"granted_by":{"type":["string","null"],"description":"The staff user who granted it."},"id":{"type":"string","description":"The exception."},"last4":{"type":["string","null"],"description":"Last four digits of the card it covers."},"note":{"type":"string","description":"Why staff granted it."},"org_id":{"type":"string","description":"The organization it is for."},"revoked_at":{"type":["string","null"],"description":"When it was revoked. Absent while it is live."},"revoked_by":{"type":["string","null"],"description":"The staff user who revoked it."}}},"CardStatusRead":{"type":"object","description":"The organization's card on file.","required":["org_id","status"],"properties":{"brand":{"type":["string","null"],"description":"Card brand, e.g. `visa`."},"exp_month":{"type":["integer","null"],"format":"int64","description":"Expiry month, 1 to 12."},"exp_year":{"type":["integer","null"],"format":"int64","description":"Expiry year."},"last4":{"type":["string","null"],"description":"Last four digits."},"message":{"type":["string","null"],"description":"The reason in words, for the customer."},"org_id":{"type":"string","description":"The organization."},"reason":{"type":["string","null"],"description":"Machine reason when not valid, e.g. `prepaid`, `expired`."},"required_since":{"type":["string","null"],"description":"When a card became required."},"status":{"type":"string","description":"`valid`, `required` (none, refused, declined or expired: service is\nsuspended at `suspend_at`), `disputed` (suspended until staff\nresolve a dispute), or `none` (no card recorded yet)."},"suspend_at":{"type":["string","null"],"description":"When service is (or was) suspended without a valid card."}}},"ChallengeRequest":{"type":"object","description":"Body of `POST /auth/challenge`.","required":["action"],"properties":{"action":{"type":"string","description":"`send_magic_link` or `verify_magic_link`."},"alternative":{"type":"boolean","description":"At the puzzle level: a longer background check instead of the\npicture, for anyone who cannot do the picture."},"level":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Level","description":"The least the challenge should ask for: the level a refused request\nwas told to come back with. The network's own level wins when it is\nhigher."}]},"run":{"type":"string","description":"A random id the page keeps while it is open, so its rounds of the\ncheck are its own. Optional."}}},"ChallengeResponse":{"type":"object","description":"A human-check challenge.","required":["optional","level","token","algorithm","memory_kib","iterations","salt","puzzles","work","program","width","height","piece_size","expires_at"],"properties":{"algorithm":{"type":"string","description":"Proof of work: always `argon2id`."},"expires_at":{"type":"string","format":"date-time","description":"When the challenge stops being accepted."},"height":{"type":"integer","format":"int32","description":"Picture height, pixels.","minimum":0},"image":{"type":["string","null"],"description":"At the puzzle level: the picture, PNG, base64."},"iterations":{"type":"integer","format":"int32","description":"Proof of work: Argon2id passes.","minimum":0},"level":{"type":"string","description":"`invisible` or `puzzle`."},"memory_kib":{"type":"integer","format":"int32","description":"Proof of work: Argon2id memory per try, KiB.","minimum":0},"optional":{"type":"boolean","description":"True when the operator switched the check off: there is no\nchallenge, and the protected request needs no `client_attestation`."},"piece":{"type":["string","null"],"description":"At the puzzle level: the piece, PNG with transparency, base64."},"piece_size":{"type":"integer","format":"int32","description":"Side of the piece's square bounding box, pixels.","minimum":0},"program":{"$ref":"#/components/schemas/ProgramSpec","description":"The program to run."},"puzzles":{"type":"integer","format":"int32","description":"Proof of work: number of puzzles; one nonce each.","minimum":0},"salt":{"type":"string","description":"Proof of work: Argon2id salt, hex."},"token":{"type":"string","description":"Send back in `client_attestation.token`."},"width":{"type":"integer","format":"int32","description":"Picture width, pixels.","minimum":0},"work":{"type":"integer","format":"int32","description":"Proof of work: expected tries per puzzle; a try solves it when the\nfirst four bytes of the hash, big-endian, are below `2^32 / work`.","minimum":0}}},"ClientAttestation":{"type":"object","description":"A solved challenge, carried by the protected request as\n`client_attestation` (the field Claude's own requests use).","required":["token","nonces","program"],"properties":{"confirmed":{"type":"boolean","description":"The person confirmed the puzzle dialog."},"nonces":{"type":"array","items":{"type":"integer","format":"int64","minimum":0},"description":"One proof-of-work nonce per puzzle."},"program":{"type":"integer","format":"int32","description":"What the program evaluated to.","minimum":0},"run":{"type":"string","description":"The `run` the challenge was asked for with."},"signals":{"$ref":"#/components/schemas/Signals","description":"What the page observed."},"token":{"type":"string","description":"The challenge token."},"x":{"type":["integer","null"],"format":"int32","description":"Where the piece was put: its left edge, in picture pixels."},"y":{"type":["integer","null"],"format":"int32","description":"Where the piece was put: its top edge, in picture pixels."}}},"ClientBinaryArch":{"type":"string","description":"Closed per-arch enum: the rust target triples\n`ops/release.sh` builds and cosign-signs for the client. Each\nvariant serialises to / deserialises from its triple string, so\nan `arch` query value outside this set is a serde reject (`400`)\nat the extractor — the daemon must name a supported target or be\nrefused at the boundary (the\n[`crate::platform::agents::agent_binary_types::AgentBinaryArch`]\nprecedent). Clients run on customer endpoints (laptops, phones,\nservers, headless boxes) — every triple here is a real client\ntarget.","enum":["x86_64-unknown-linux-gnu","aarch64-unknown-linux-gnu","x86_64-unknown-linux-musl","aarch64-unknown-linux-musl","x86_64-apple-darwin","aarch64-apple-darwin","x86_64-pc-windows-msvc"]},"ClientBinaryQuery":{"type":"object","description":"`?version=<v>&arch=<a>` request for `GET /client/me/binary`.\n`version` is the semantic version the daemon intends to pull —\nthe handler refuses it unless it equals the device's\noperator-pinned `expected_version` (downgrade prevention) AND is\nin the build-time allowlist. `arch` is the closed\n[`ClientBinaryArch`] enum. The `version` bound here is shape-only:\nnon-empty so the URL never has an empty segment, ≤64\nchars so a hostile value cannot bloat the response.","required":["version","arch"],"properties":{"arch":{"$ref":"#/components/schemas/ClientBinaryArch","description":"Target arch — one of the closed [`ClientBinaryArch`] triples;\nan unrecognised value is refused `400` at the extractor."},"version":{"type":"string","description":"Semantic version the daemon wants (e.g. `\"0.1.0\"`). Must\nequal the device's operator-pinned `expected_version` and be\nin the server-side allowlist or the handler refuses it."}}},"ClientBinaryResponse":{"type":"object","description":"Response body for `GET /client/me/binary`. Points the\ndaemon at the version-and-arch-pinned artifact plus its cosign\nsignature. Self-scoped — the handler resolves the device strictly\nfrom the resolved `Principal::ClientDevice` `device_id`, so this\nbody only ever describes the caller's operator-pinned target (the\ncross-device guarantee is structural, no id in the path).","required":["version","arch","download_url","signature_url"],"properties":{"arch":{"type":"string","description":"The resolved target triple (echo of the validated `arch`\nquery)."},"download_url":{"type":"string","description":"Immutable, version-and-arch-pinned artifact URL\n(`<channel>/<version>/appsynergy-<triple>`). The bytes behind\nit cannot change without failing the cosign verification, so\nthe path itself is the integrity pin."},"signature_url":{"type":"string","description":"Companion cosign signature URL (`<download_url>.sig`). The\ndaemon verifies the downloaded artifact against the\nrepo-checked-in public key before swapping the\nbinary; a verification failure aborts the self-update."},"version":{"type":"string","description":"The served version — always equal to the device's\noperator-pinned `expected_version` (echoed so the daemon can\nassert it pulled the intended build)."}}},"ClientConfigBlock":{"type":"object","description":"The per-capability bootstrap config block for a client device.\nThe daemon-facing analog of [`crate::platform::agents::agent_join_types::AgentJoinConfig`]\n(the fleet-side block). Carries everything the daemon needs to\nshape its local enforcement: the heartbeat cadence, the join-time\ncapability slugs (so it knows which capability modules to start),\nand the operator-mutable policy knobs the PATCH writes\n(`always_on`, `kill_switch`, `trusted_networks`) plus the\norg-allocated `tunnel_ip` the daemon's WG interface binds.","required":["heartbeat_interval_seconds","capabilities","always_on","kill_switch","trusted_networks","device_policy","managed_config"],"properties":{"always_on":{"type":"boolean","description":"Operator-mutable: when `true`, the daemon brings the tunnel\nup at boot and keeps it up. PATCH writes this."},"capabilities":{"type":"array","items":{"type":"string"},"description":"Capability slugs provisioned at join time (the same slugs\n`GET /client/me` surfaces). The daemon starts one capability\nloop per slug."},"client_request_timeout_seconds":{"type":["integer","null"],"format":"int64","description":"Operator-settable per-device timeout (whole seconds) the daemon\napplies to its own control-plane HTTP requests\n(`client_devices.client_request_timeout_seconds`). `None` ⇒ the\ndaemon keeps its built-in default. The first operator-settable\nmember of the F-CP1 config carrier; folded into the endpoint's\ncontent-derived ETag so a change invalidates the daemon's\nlong-poll cache."},"device_policy":{"$ref":"#/components/schemas/DevicePolicyBlock","description":"F-SEC3 org-policy enforcement surface: the device's org's\nresolved device-compliance policy (`org_device_policies`, or\nthe \"no requirements, report-only\" default when the org has\nnever set one). The daemon self-enforces/reports locally per\n`enforcement_mode`. Folded into the endpoint's content-derived\nETag so an admin PATCH to `/iam/orgs/{org_id}/device-policy`\ninvalidates the daemon's long-poll cache the same way an\noperator device edit does."},"heartbeat_interval_seconds":{"type":"integer","format":"int32","description":"Seconds between `POST /client/heartbeat` posts —\n[`super::client_heartbeat_types::CLIENT_HEARTBEAT_INTERVAL_SECONDS`].\nThe cadence the daemon's heartbeat loop uses.","minimum":0},"kill_switch":{"type":"boolean","description":"Operator-mutable: when `true`, the daemon's firewall blocks\nall non-tunnel traffic. PATCH writes this."},"managed_config":{"$ref":"#/components/schemas/ManagedConfigBlock","description":"Task #84 MDM push/enforce surface: the device's org's resolved\nmanaged device configuration (`org_managed_configs`, or the\n\"no overrides\" default when the org has never set one). The\ndaemon applies these values locally (DNS filter, kill-switch /\nauto-connect defaults, network allow/block lists, update\ntrack). Folded into the endpoint's content-derived ETag so an\nadmin PATCH to `/iam/orgs/{org_id}/managed-config` invalidates\nthe daemon's long-poll cache the same way a `device_policy`\nchange does."},"trusted_networks":{"type":"array","items":{"type":"string"},"description":"Operator-mutable: SSIDs / network identifiers the daemon\ntreats as trusted (kill switch off, tunnel optional). Stored\nas a JSON array string in `client_devices.trusted_networks`;\nsurfaced here as the parsed array."},"tunnel_ip":{"type":["string","null"],"description":"The org-allocated WG inside-tunnel address for this device\n(`client_devices.tunnel_ip`). The daemon binds the WG\ninterface to this. `None` only when the org has no CIDR\nallocated yet — the join handler populates it on every real\ndevice."}}},"ClientConfigQuery":{"type":"object","description":"`?wait=<seconds>` long-poll knob for `GET /client/me/config`.\n`0` ⇒ return immediately; absent ⇒ same as `0`. Bounded\n`[0, 30]`; a larger value is `422 validation_failed`. Mirrors\nthe `GET /agents/me/config` long-poll bound so an idle\ndaemon's poll always returns before its next heartbeat would\nsurface the same operator change anyway.","properties":{"wait":{"type":["integer","null"],"format":"int64","description":"Long-poll duration in whole seconds. `0` ⇒ return\nimmediately; absent ⇒ same as `0`. Bounded `[0, 30]`; a\nlarger value is refused `422 validation_failed`.","minimum":0}}},"ClientConfigResponse":{"type":"object","description":"Response body for `GET /client/me/config`. The\nauthenticated client device's operating config: the opaque\n`version` tag (also the `ETag` header), the operator-set\n`expected_version` the device self-updates toward, and the\nper-capability config block. Self-scoped — the handler resolves\nthe row strictly from the resolved `Principal::ClientDevice`\n`device_id`, so this body can only ever describe the caller (the\ncross-device guarantee is structural, no id in the path).","required":["version","config"],"properties":{"config":{"$ref":"#/components/schemas/ClientConfigBlock","description":"The per-capability config block (see [`ClientConfigBlock`])."},"expected_version":{"type":["string","null"],"description":"The operator-set target version\n(`client_devices.expected_version`, pinned via a future admin\nPATCH on `/devices/{id}`). `null` when the operator has not\npinned a target. The daemon self-updates whenever its\n`reported_version != expected_version` by hitting the\n`GET /client/me/binary?version=<v>` (mirrors the\nfleet self-update mechanism)."},"version":{"type":"string","description":"Opaque, content-derived version tag — a SHA-256 over the\noperator-mutable fields (`status`, `expected_version`,\n`updated_at`, `always_on`, `kill_switch`, `trusted_networks`,\n`tunnel_ip`, and join-time `capabilities`). Identical to the\n`ETag` response header value. The daemon treats it as opaque\nand feeds it back verbatim through `If-None-Match` on the\nnext poll; a mismatch (operator PATCH,\nor a pinned `expected_version`) surfaces the new body once\nand cuts a pending `?wait` long-poll short."}}},"ClientConnectionEndRequest":{"type":"object","description":"Request body for `POST /client/me/connection/{id}/end`. Every\nfield is optional — the close action is meaningful on its own\n(the stamp of `ended_at` IS the close), with the operator-\nfacing detail (reason, final bytes) layered as available\nmetadata. A daemon that crashed mid-session may not be able\nto supply any of them.","properties":{"bytes_in":{"type":["integer","null"],"format":"int64","description":"Final cumulative inbound bytes. Optional — when supplied\nthe close path overwrites the stored counter so the\noperator dashboard sees the final number. When absent the\nlast PATCH value is preserved (the daemon may have\nreported a fresh PATCH just before /end)."},"bytes_out":{"type":["integer","null"],"format":"int64","description":"Final cumulative outbound bytes. Same shape as\n[`Self::bytes_in`]."},"ended_reason":{"type":["string","null"],"description":"Short reason code for why the daemon is closing the\nsession (`user_initiated`, `kill_switch`, `error`,\n`paused`, etc.). Stored verbatim on\n`client_connections.ended_reason`. Optional; bounded to\n128 chars so a misbehaving daemon cannot store an\nunbounded blob."}},"additionalProperties":false},"ClientConnectionEndResponse":{"type":"object","description":"Response body for `POST /client/me/connection/{id}/end`.\nEchoes the server-stamped `ended_at` so the daemon knows the\ncontrol plane received the close.\n\nResponse-only — no `Validate`. Derives\n`ToSchema`, registered in `spec.rs`.","required":["ok","ended_at"],"properties":{"ended_at":{"type":"string","description":"Server-stamped RFC3339 instant the connection was closed.\nThe daemon can compare its clock against the control\nplane's."},"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"ClientConnectionOpenRequest":{"type":"object","description":"Request body for `POST /client/me/connection`. The daemon\nreports the tunnel it's bringing up, the WG server it's\nlanding on, and the public endpoint it observed itself\ndialing from.\n\nThe server stamps `started_at = time::now()`; client-supplied\ntimestamps are ignored to avoid honoring a daemon clock that\ndisagrees with the control plane (wall-clock is one\nsource of truth on the server).","required":["tunnel_id","server_id"],"properties":{"public_endpoint":{"type":["string","null"],"description":"Public endpoint the daemon observed itself dialing from\n(`<ip>:<port>`). Stored verbatim on\n`client_connections.public_endpoint`; the dashboard\nrenders it for the operator. Optional — daemons on\nconstrained NICs may not know their public-side mapping\nreliably until a handshake completes. Length-bounded to\nfit any IPv4 / IPv6 textual form plus a port."},"server_id":{"type":"string","description":"`servers.id` the daemon is landing on. Validated in the\nhandler against the tunnel's `server_id` (`SELECT 1 FROM\ntunnels WHERE id = ? AND server_id = ?`) so the daemon\ncannot record a connection landing on a server the tunnel\nis not bound to."},"tunnel_id":{"type":"string","description":"`tunnels.id` (UUIDv7) the daemon is bringing up. Validated\nin the handler against the device's org (`SELECT 1 FROM\ntunnels WHERE id = ? AND org_id = ?`) so a cross-org tunnel\nis 422 `invalid_tunnel`, not a silent open."}},"additionalProperties":false},"ClientConnectionOpenResponse":{"type":"object","description":"Response body for `POST /client/me/connection`. Carries the\nnewly minted `client_connections.id` so the daemon can post\ntelemetry updates against it (future `PATCH\n/client/me/connection/{id}`) and close it.\n\nResponse-only — no `Validate`. Derives\n`ToSchema`, registered in `spec.rs`.","required":["connection_id","started_at"],"properties":{"connection_id":{"type":"string","description":"`client_connections.id` (UUIDv7) of the newly opened row."},"started_at":{"type":"string","description":"Server-stamped RFC3339 `started_at` instant. Mirrors the\n`joined_at` echo on the join response — the daemon can\nverify its clock against the control plane's."}}},"ClientConnectionPatchRequest":{"type":"object","description":"Request body for `PATCH /client/me/connection/{id}`. The\n`bytes_in` / `bytes_out` counters are required and absolute\n(cumulative since connection start) — the daemon reports\nWireGuard's per-peer counters verbatim, the server stores\nthem verbatim. RTT, loss, and last-handshake are optional\nsamples: when supplied they overwrite the stored value; when\nabsent they leave it unchanged (COALESCE).\n\nValidator caps `bytes_in` / `bytes_out` at 2^63-1 (the\nSQLite `INTEGER` ceiling) and `packet_loss_pct` at `[0, 100]`;\na malformed daemon reporting e.g. negative bytes is a 422\nbefore the DB is touched.","required":["bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Cumulative inbound bytes since the connection opened.\nMirrors WireGuard's per-peer `rx_bytes` counter. Required."},"bytes_out":{"type":"integer","format":"int64","description":"Cumulative outbound bytes since the connection opened.\nMirrors WireGuard's per-peer `tx_bytes` counter. Required."},"datagrams_in":{"type":["integer","null"],"format":"int64","description":"Cumulative inbound QUIC datagrams since the connection\nopened (one inner packet == one QUIC datagram per RFC 9221\npacket-per-datagram framing). WireGuard connections have\nno datagram-granularity counter and always omit this.\nOptional — preserves the prior value when absent."},"datagrams_out":{"type":["integer","null"],"format":"int64","description":"Cumulative outbound QUIC datagrams. See `datagrams_in`."},"last_handshake_at":{"type":["string","null"],"description":"RFC3339 instant of the daemon's most recent successful WG\nhandshake. Optional — daemons that have not yet completed\na handshake supply `None` (the existing stored value is\npreserved via COALESCE)."},"packet_loss_pct":{"type":["number","null"],"format":"double","description":"Most recent packet-loss sample (percentage, `[0.0, 100.0]`).\nOptional — preserves the prior value when absent."},"rtt_ms":{"type":["integer","null"],"format":"int64","description":"Most recent RTT sample (milliseconds). Optional —\npreserves the prior value when absent. Bounded `[0, 60000]`\nso a malformed daemon cannot store an arbitrary value."},"streams_open":{"type":["integer","null"],"format":"int64","description":"Currently open QUIC streams on this connection. No shipped\ndaemon build populates this yet — see the server-side\n`QuicPeerStatus::streams_open` doc for why. Optional."}},"additionalProperties":false},"ClientConnectionPatchResponse":{"type":"object","description":"Response body for `PATCH /client/me/connection/{id}`. Echoes\nthe server-stamped `last_telemetry_at` so the daemon knows\nthe control plane received the update.\n\nResponse-only — no `Validate`. Derives\n`ToSchema`, registered in `spec.rs`.","required":["ok","last_telemetry_at"],"properties":{"last_telemetry_at":{"type":"string","description":"Server-stamped RFC3339 timestamp the telemetry row was\nupdated. The daemon can compare its clock against the\ncontrol plane's."},"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"ClientDeviceJoinTokenListResponse":{"type":"object","description":"`GET /devices/join-tokens` response. Single-array envelope so\nfuture fields (pagination cursor, counts) can land without\nbreaking clients that already parse the array shape.","required":["join_tokens"],"properties":{"join_tokens":{"type":"array","items":{"$ref":"#/components/schemas/ClientDeviceJoinTokenRead"},"description":"Pending join tokens owned by the calling user, ordered by\n`created_at DESC`."}}},"ClientDeviceJoinTokenMintRequest":{"type":"object","description":"`POST /devices/join-tokens` request body. Both fields are\noptional: `name` is a human label the customer can use to\nrecognise a token in the list view, `ttl_seconds` overrides\nthe default expiry.","properties":{"name":{"type":["string","null"],"description":"Optional human label. `1 ≤ len ≤ 128` when present."},"ttl_seconds":{"type":["integer","null"],"format":"int32","description":"Optional TTL in seconds. Bounded\n`1..=`[`MAX_CLIENT_DEVICE_JOIN_TOKEN_TTL_SECONDS`]; absent\n⇒ [`DEFAULT_CLIENT_DEVICE_JOIN_TOKEN_TTL_SECONDS`].","minimum":0}},"additionalProperties":false},"ClientDeviceJoinTokenMintResponse":{"type":"object","description":"`POST /devices/join-tokens` response (201). Carries the\none-time plaintext bearer; the SHA-256(+pepper) hash is what\nthe DB persists.","required":["id","token","expires_at","install_command"],"properties":{"expires_at":{"type":"string","format":"date-time","description":"RFC3339 expiry instant."},"id":{"type":"string","description":"UUIDv7 id of the newly minted row."},"install_command":{"type":"string","description":"Rendered one-liner the customer can paste on the new\ndevice to enrol it: `curl -fsSL <origin>/get |\nsudo sh -s -- join CT_<token>` (customer CLI surface; fleet\nJT_ tokens keep `/install.sh`)."},"token":{"type":"string","description":"Plaintext `CT_<base64>` join token. Shown **exactly once**."}}},"ClientDeviceJoinTokenRead":{"type":"object","description":"One row in the `GET /devices/join-tokens` listing. The\nplaintext token is intentionally absent — the mint response\nis the only carrier; the list surface only carries\nidentity-and-status metadata.","required":["id","expires_at","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 mint timestamp."},"expires_at":{"type":"string","description":"RFC3339 expiry instant."},"id":{"type":"string","description":"UUIDv7 id of the join-token row."},"name":{"type":["string","null"],"description":"Optional human label set at mint time."},"used_at":{"type":["string","null"],"description":"RFC3339 timestamp the token was used to enrol a device;\n`None` when the token is still pending."},"used_by_client_device_id":{"type":["string","null"],"description":"UUID of the device that enrolled with this token, when\n`used_at` is set. `None` when still pending."}}},"ClientDeviceJoinTokenRevokeResponse":{"type":"object","description":"`DELETE /devices/join-tokens/{id}` response — the audit row is\nthe canonical record of removal detail.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"ClientDeviceMeResponse":{"allOf":[{"$ref":"#/components/schemas/DeviceRead","description":"The calling device's own record."},{"type":"object","required":["capabilities"],"properties":{"capabilities":{"type":"array","items":{"type":"string"},"description":"Capability slugs provisioned at join time."}}}],"description":"`GET /client/me` response — the calling device's own record plus\nthe capability slugs it was provisioned with at join time\n(self-read; the `client_devices.capabilities` surfaced to\nthe device so it knows what it may run). `capabilities` is a JSON\narray of slugs (`wg_client` / `quic_client` / `mesh_bridge`),\nmirroring `AgentRead.capabilities` on the `/agents/me` precedent.\nNo secret column is ever projected here\n(`agent_key_hash` is never selected)."},"ClientFlowSample":{"type":"object","description":"One per-protocol cumulative byte-counter reading the client daemon\nreports on its heartbeat, at the heartbeat cadence\n([`CLIENT_HEARTBEAT_INTERVAL_SECONDS`]). Each sample is stored as a\nrow in `client_flow_samples` (migration 0227) stamped with the\nserver-observed sample instant; two consecutive samples for the same\n`(device, protocol_class)` differentiate into a live\n`bytes_per_sec` the flow-rate producer publishes to the dashboard\n`flows:*` topics.\n\n`bytes_in` / `bytes_out` are **cumulative** counters (monotonically\nrising while the daemon runs), NOT per-interval deltas — the\nproducer computes the delta between two samples. A daemon restart\nresets the counters; the producer floors a negative delta to 0\nrather than underflowing.\n\nTyped wire DTO: no untyped JSON blob carries these counters.\nDerives `ToSchema`, registered in `spec.rs`.","required":["protocol_class","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Cumulative inbound bytes for this protocol class since the\ndaemon started. Monotonic while the daemon runs; `min = 0`."},"bytes_out":{"type":"integer","format":"int64","description":"Cumulative outbound bytes for this protocol class since the\ndaemon started. Same shape as [`Self::bytes_in`]."},"protocol_class":{"type":"string","description":"Wire protocol class this counter belongs to (`tcp`, `udp`,\n`quic`, ...). Stored verbatim on\n`client_flow_samples.protocol_class`; not re-validated against a\nclosed enum so a daemon can report a new class without a\ncontrol-plane lockstep. Non-empty, length-bounded."}},"additionalProperties":false},"ClientHeartbeatRequest":{"type":"object","description":"Request body for `POST /client/heartbeat`. Authenticated\nby the `cdv_` bearer in the `Authorization` header; the device\nidentity is derived from the bearer hash, NOT carried in the\nbody, so device A's heartbeat can never bump device B's row\n(the cross-device guarantee is structural — same idiom\n`agents_heartbeat` uses).\n\n`telemetry_json` is a free-form JSON string the daemon supplies;\nthe server stores it verbatim in `client_devices.telemetry_json`\n(the column already exists per migration 0015). Length-bounded\nto [`CLIENT_HEARTBEAT_TELEMETRY_MAX_BYTES`] so a misbehaving\ndaemon cannot store an unbounded blob.","required":["self_status","reported_version"],"properties":{"disk_encryption_enabled":{"type":["boolean","null"],"description":"Whether the device currently attests full-disk encryption.\nStored on `client_devices.disk_encryption_enabled`. Absent ⇒\nthe stored attestation is unchanged."},"firewall_enabled":{"type":["boolean","null"],"description":"Whether the device currently attests an active firewall.\nStored on `client_devices.firewall_enabled`. Absent ⇒\nunchanged."},"flow_samples":{"type":"array","items":{"$ref":"#/components/schemas/ClientFlowSample"},"description":"Per-protocol cumulative byte-counter samples the daemon reports\nthis beat (one per active wire protocol class). Each becomes a\nrow in `client_flow_samples`; the flow-rate producer\ndifferentiates two consecutive samples into a live\n`bytes_per_sec` on the dashboard `flows:*` topics. Absent /\nempty ⇒ the beat records liveness without a flow sample. Bounded\nto [`CLIENT_HEARTBEAT_MAX_FLOW_SAMPLES`]; each element is\nvalidated nested (`dive`)."},"last_public_ip":{"type":["string","null"],"description":"Public IP the daemon last observed itself egressing from.\nStored on `client_devices.last_public_ip` so the operator\ndashboard can correlate device location with flow state.\nOptional; length-bounded to fit any IPv4 / IPv6 textual\nform. Absent ⇒ the stored value is unchanged."},"os_version":{"type":["string","null"],"description":"The device's OS version string (e.g. `14.5`), distinct from\n[`Self::reported_version`] (the daemon binary's own version).\nStored on `client_devices.os_version`. Absent ⇒ unchanged;\nnon-empty, length-bounded."},"reported_version":{"type":"string","description":"The daemon binary's own version (e.g. `0.1.0`). Stored on\n`client_devices.reported_version`. Non-empty, length-bounded."},"screen_lock_enabled":{"type":["boolean","null"],"description":"Whether the device currently attests an active screen lock.\nStored on `client_devices.screen_lock_enabled`. Absent ⇒\nunchanged."},"self_status":{"$ref":"#/components/schemas/ClientSelfStatus","description":"The daemon's self-classification (see [`ClientSelfStatus`])."},"telemetry_json":{"type":["string","null"],"description":"Free-form JSON telemetry blob the operator dashboard reads\nto render per-device detail. Length-bounded; absent ⇒ the\nstored telemetry is unchanged (the daemon can heartbeat\nliveness without re-uploading telemetry every beat)."}},"additionalProperties":false},"ClientHeartbeatResponse":{"type":"object","description":"Response body for `POST /client/heartbeat`.\n`ok = true` on the success path; `heartbeat_interval_seconds`\nis the cadence the daemon should keep until the next beat\n(matches the bootstrap interval the `appsynergy join` response\nreturns).\n\nResponse-only — no `Validate`. Derives\n`ToSchema`, registered in `spec.rs`.","required":["ok","heartbeat_interval_seconds"],"properties":{"heartbeat_interval_seconds":{"type":"integer","format":"int32","description":"Seconds between heartbeats the daemon should keep.\nMatches `AGENT_JOIN_HEARTBEAT_INTERVAL_SECONDS` (30 s\ntoday) so the customer + fleet daemons share one rhythm.","minimum":0},"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"ClientJoinRequest":{"type":"object","description":"Request body for `POST /client/join` (anonymous). The\n`token` is the one-time `CT_` plaintext the customer pasted on\nthe device via the install one-liner; the server hashes it\nand matches `client_device_join_tokens.token_hash` — the\nplaintext is never stored. The remaining fields are the device's\nself-reported identity, persisted to `client_devices` columns\nand recorded in the join audit row.\n\nEvery field is required and length-bounded; a boundary failure ⇒\n422 `validation_failed` before the token is hashed or the DB is\ntouched. `platform` / `device_type` are CHECK-bounded\nin the schema but the handler runs the allow-list check first so\nthe constraint is never reached on bad input — same idiom\n`devices_create` uses.","required":["token","device_name","platform","device_type","client_version"],"properties":{"client_version":{"type":"string","description":"The client binary's own version (e.g. `0.1.0`). Stored on\n`client_devices.reported_version` at join; the client\nre-reports it on every later heartbeat. Non-empty,\nlength-bounded."},"device_name":{"type":"string","description":"The device's name. Stored on `client_devices.device_name`;\nmust satisfy the `UNIQUE (org_id, device_name)` constraint\n(a name clash ⇒ 409). Non-empty, length-bounded."},"device_type":{"type":"string","description":"Reported device class. Must be one of `laptop` / `phone` /\n`tablet` / `server` / `iot` / `other` (the\n`client_devices.device_type` CHECK domain)."},"platform":{"type":"string","description":"Reported platform. Must be one of `linux` / `macos` /\n`windows` / `ios` / `android` / `headless` (the\n`client_devices.platform` CHECK domain). The handler\ndouble-checks against\n[`super::device_types::ALLOWED_PLATFORMS`] before INSERT."},"token":{"type":"string","description":"The one-time `CT_<base64url>` join-token plaintext. Hashed\n(`hash_opaque_token`) and matched against\n`client_device_join_tokens.token_hash`; never stored.\nNon-empty, length-bounded ([`CLIENT_JOIN_TOKEN_MAX_LEN`])."}},"additionalProperties":false},"ClientJoinResponse":{"type":"object","description":"Response body for `POST /client/join`.:\n[`agent_key`](Self::agent_key) is the freshly minted plaintext\nclient-device bearer, surfaced on this response **exactly\nonce** — only its `hash_opaque_token` digest is persisted in\n`client_devices.agent_key_hash` (column ends `_hash`); no list /\nread endpoint ever re-exposes it (the same contract\n`DeviceCreateResponse.agent_key` uses).\n\nResponse-only — no `Validate` (the wire never carries a\nclient-supplied join *response*). Derives\n`ToSchema`, registered in `spec.rs`.","required":["device_id","agent_key","tunnel_ip","cert_pin_sha256","config"],"properties":{"agent_key":{"type":"string","description":"The freshly minted opaque client-device bearer plaintext,\nprefixed with `cdv_` (the\n[`crate::platform::iam::credential::TOKEN_PREFIX_CLIENT_DEVICE`]\nthe principal resolver classifies on). Shown to the joining\ndevice exactly once; no read endpoint ever exposes it again."},"cert_pin_sha256":{"type":"string","description":"Hex SHA-256 of the control plane's current TLS SPKI.\nThe daemon writes it into `client.toml` and refuses any\ncontrol-plane TLS cert whose SPKI does not match — the same\npin-at-join contract the fleet agent uses; rotation arrives\nvia the config poll."},"config":{"$ref":"#/components/schemas/ClientConfigBlock","description":"The per-capability bootstrap config block — identical shape\nto the `config` field of `GET /client/me/config`, so the\ndaemon applies join-time and poll-time config through one\ncode path."},"device_id":{"type":"string","description":"The newly created `client_devices.id` (UUIDv7). The\nstable handle for every later self-service (`/client/me*`)\nand admin (`/devices/{id}`) call."},"expected_version":{"type":["string","null"],"description":"The operator-pinned target client version\n(`client_devices.expected_version`). Always `None` at join —\nsurfaced here so the daemon's first config application uses\nthe same shape as every later `GET /client/me/config` poll."},"org_slug":{"type":["string","null"],"description":"The owning org's slug (`orgs.slug`). The client writes this\ninto `client.toml`'s `org_slug` field; future requests use\nit for routing / display. Always a non-empty DNS label on a\nsuccessful join — the handler derives and persists one when\nthe org row still has a null/empty slug. `Option` retained\nfor wire-shape stability with older clients."},"tunnel_ip":{"type":"string","description":"The device's overlay address, allocated at join from the\norg's `orgs.device_cidr` and persisted on\n`client_devices.tunnel_ip`. The daemon binds its WG\ninterface to this; magic-DNS resolves the device name to it."}}},"ClientMeSubnetRouteCreateRequest":{"type":"object","description":"`POST /client/me/subnet-routes` request body. The device id\nis taken from the caller's `cdv_` bearer (no path parameter,\nunlike the user-side endpoint).","required":["cidr"],"properties":{"cidr":{"type":"string","description":"IPv4 or IPv6 CIDR. Length-bounded at the boundary; the\nhandler additionally parses via `std::net::IpAddr` +\nprefix and canonicalises so `192.168.1.5/24` is stored\nas `192.168.1.0/24` (matches the user-side handler's\ncanonicalisation for reliable UNIQUE de-dupe)."}}},"ClientProfileRead":{"type":"object","description":"One WireGuard profile the calling device is allowed to\nconnect to. The daemon writes the `[Peer]` section of its\n`wg-quick` config from these fields:\n\n- `server_public_key` → `PublicKey`\n- `server_endpoint` → `Endpoint`\n- `allocated_ip` → the device's tunnel-side IP (used in\n  `Interface.Address`, not `Peer`)\n\nThe shape carries the minimum the daemon needs to bring up a\ntunnel. Additional fields (`magic_dns_zone`,\n`persistent_keepalive`, ACL-derived `allowed_ips`, per-profile\nDNS server lists) extend it additively without changing the\nexisting fields.","required":["tunnel_id","server_id","name","device_public_key","server_public_key","server_endpoint","allocated_ip"],"properties":{"allocated_ip":{"type":"string","description":"`wireguard_tunnels.allocated_ip` — the device's tunnel-\nside IP (used in the `[Interface]` section's `Address =`\nline, not `Peer`). CIDR-suffixed (e.g. `10.13.0.5/24`)\nmatches the form the schema stores."},"device_public_key":{"type":"string","description":"`wireguard_tunnels.public_key` of the device-side peer —\nthe public half of the keypair stored encrypted as\n`private_key_ct` on the same row. Wire bytes are the\n32-byte base64 the WG kernel module accepts verbatim."},"dns_servers":{"type":["string","null"],"description":"Optional DNS server list the daemon writes to the\n`[Interface] DNS =` line. Comma-separated string as\nstored in `wireguard_tunnels.dns_servers`; `None` when\nthe column is NULL (the daemon then defaults to the\nsystem resolver)."},"name":{"type":"string","description":"Human-facing profile label (`wireguard_tunnels.profile_name`),\nfalling back to the tunnel's `profile_number` rendered as\n`profile-<n>` when no explicit name was set at mint time."},"pop_slug":{"type":["string","null"],"description":"The serving PoP/colo's human-readable handle\n(`points_of_presence.slug` via `servers.pop_id`).\nDisplay-only — the client prints it (`list` POP\ncolumn) but never dials or routes off it. `None` when the\nserver is not homed to a PoP; additive, so an older\ndaemon simply ignores it."},"server_endpoint":{"type":"string","description":"`servers.endpoint` (`<ip>:<port>` or `<fqdn>:<port>`) the\ndaemon puts in the `[Peer]` section's `Endpoint =` line."},"server_id":{"type":"string","description":"`tunnels.server_id` (UUIDv7) — the infra server this\ntunnel lands on. Sent alongside `tunnel_id` in\n`POST /client/me/connection`, where the open handler\nvalidates the `(tunnel_id, org_id, server_id)` triple\nbefore recording the connection. Exposed so the client can\nsatisfy that contract without a second round-trip."},"server_public_key":{"type":"string","description":"`servers.public_key` of the server-side peer the daemon\nputs in the `[Peer]` section's `PublicKey =` line."},"tunnel_id":{"type":"string","description":"`tunnels.id` (UUIDv7). The handle the daemon passes to\n`POST /client/me/connection` when it brings this profile\nup."}}},"ClientProfilesListResponse":{"type":"object","description":"`GET /client/me/profiles` response. Single-array envelope so\nfuture fields (cursor, magic-DNS zone, etc.) can land without\nbreaking clients that already parse the array shape.","required":["profiles"],"properties":{"profiles":{"type":"array","items":{"$ref":"#/components/schemas/ClientProfileRead"},"description":"Active WG profiles the calling device is allowed to\nconnect to, ordered by `tunnels.profile_number` for a\nstable display."}}},"ClientRolloutCreateRequest":{"type":"object","description":"Request body for `POST /platform/devices/rollouts`.","required":["target_version","wave_percent"],"properties":{"target_version":{"type":"string","description":"Version to roll out; must be an allowlisted\n`release_versions(component='client')` row."},"wave_percent":{"type":"integer","format":"int64","description":"Initial wave size in percent (0–100). Start small (a canary\nwave), advance via PATCH as adoption proves out."}}},"ClientRolloutDetailResponse":{"type":"object","description":"Response body for `GET /platform/devices/rollouts/{id}`.","required":["rollout","stats"],"properties":{"rollout":{"$ref":"#/components/schemas/ClientRolloutRead","description":"The rollout row."},"stats":{"$ref":"#/components/schemas/ClientRolloutStats","description":"Adoption stats computed against the live device fleet."}}},"ClientRolloutListResponse":{"type":"object","description":"Response body for `GET /platform/devices/rollouts`.","required":["rollouts"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` when exhausted."},"rollouts":{"type":"array","items":{"$ref":"#/components/schemas/ClientRolloutRead"},"description":"Page of rollouts, ordered `created_at DESC, id DESC`."}}},"ClientRolloutRead":{"type":"object","description":"One rollout row on the wire.","required":["id","target_version","status","wave_percent","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 row-create instant."},"id":{"type":"string","description":"`client_rollouts.id` (UUIDv7) — also the wave-bucket salt."},"status":{"$ref":"#/components/schemas/ClientRolloutStatus","description":"Lifecycle state."},"target_version":{"type":"string","description":"The allowlisted client version the wave drives devices toward."},"updated_at":{"type":"string","description":"RFC3339 last-transition instant."},"wave_percent":{"type":"integer","format":"int64","description":"Wave size in percent (0–100) of the un-pinned joined fleet."}}},"ClientRolloutStats":{"type":"object","description":"Live adoption stats derived at read time (never stored): the\noperator's advance-or-pause signal.","required":["cohort_total","wave_size","adopted","pinned_total"],"properties":{"adopted":{"type":"integer","format":"int64","description":"In-wave devices whose `reported_version` already equals the\ntarget — they completed the swap and re-execed."},"cohort_total":{"type":"integer","format":"int64","description":"Joined, un-pinned devices — the population waves draw from."},"pinned_total":{"type":"integer","format":"int64","description":"Joined devices excluded from the cohort by a manual\n`expected_version` pin."},"wave_size":{"type":"integer","format":"int64","description":"Cohort devices hashing under the current `wave_percent` — the\ndevices currently being told the target."}}},"ClientRolloutStatus":{"type":"string","description":"Rollout lifecycle state. `active` drives the wave; `paused` stops\noffering the target to not-yet-updated devices without touching\ndevices that already swapped (a binary rollout pauses, it never\nrolls back); `completed` / `cancelled` are terminal history rows.","enum":["active","paused","completed","cancelled"]},"ClientRolloutUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/devices/rollouts/{id}`. Omitted\nfields are unchanged; an empty-object PATCH is a no-op.","properties":{"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ClientRolloutStatus","description":"New lifecycle state. Permitted transitions: `active` ⇄ `paused`;\n`active` / `paused` → `completed` / `cancelled`. Terminal rows\nare immutable (409)."}]},"wave_percent":{"type":["integer","null"],"format":"int64","description":"New wave size. Must not decrease — a device already told its\ntarget cannot be un-told (409 on decrease)."}}},"ClientSelfStatus":{"type":"string","description":"Self-reported health classification on each heartbeat. Mirrors\n`AgentSelfStatus`: `ok` is the steady state, `degraded` means\nthe daemon is up but some sub-system reported a warning,\n`blocked` means the daemon cannot fulfil its core role\n(kill-switch tripped, no eligible exit, etc.). The operator\ndashboard renders the most recent value per device.","enum":["ok","degraded","blocked"]},"ClientTunnelProvisionRequest":{"type":"object","description":"Request body: the device's own WireGuard public key (base64 of a 32-byte\nX25519 key). The private key never leaves the device and is never sent.","required":["public_key"],"properties":{"public_key":{"type":"string","description":"Base64-encoded 32-byte X25519 public key generated on the device."}}},"ClientTunnelProvisionResponse":{"type":"object","description":"Response: everything the daemon needs to build its WireGuard config and\nconnect — its overlay address plus the server peer its tunnel lands on.\nThe daemon already holds the matching private key.","required":["tunnel_id","server_id","allocated_ip","server_public_key","server_endpoint","key_origin"],"properties":{"allocated_ip":{"type":"string","description":"Overlay `/32` allocated to this tunnel within the server's subnet —\nthe WireGuard interface `Address`."},"key_origin":{"type":"string","description":"Always `\"device\"` for this surface — the daemon holds the private\nkey."},"server_endpoint":{"type":"string","description":"`host:port` the server peer listens on (the `[Peer] Endpoint`)."},"server_id":{"type":"string","description":"UUIDv7 of the infra server this tunnel lands on\n(`tunnels.server_id`). The daemon sends it alongside\n`tunnel_id` to `POST /client/me/connection`, whose open handler\nvalidates the `(tunnel_id, org_id, server_id)` triple."},"server_public_key":{"type":"string","description":"Base64 WireGuard public key of the server peer (the `[Peer]\nPublicKey`)."},"tunnel_id":{"type":"string","description":"UUIDv7 of the provisioned (or pre-existing) tunnel."}}},"ClientWsClientAck":{"type":"object","description":"The daemon's acknowledgement of one pushed\n[`ClientWsServerFrame`]. Verbatim: \"Agent\nreceives, acts, sends back `{ \"ack\": <event_id>,\n\"result\": \"ok\"|<error> }`.\" The only client-supplied shape on\nthe socket, so it (and only it) derives [`Validate`]: both\nfields are non-empty and length-bounded — a\nmisbehaving daemon cannot stream an unbounded blob through the\nack path.","required":["ack","result"],"properties":{"ack":{"type":"string","description":"Echo of the [`ClientWsServerFrame::event_id`] the daemon is\nacknowledging. Bounded to [`CLIENT_WS_EVENT_ID_MAX_LEN`];\nan empty or over-long value is rejected before the server\nrecords the ack."},"result":{"type":"string","description":"`\"ok\"` on successful apply, or a short error token (e.g.\n`\"firewall_blocked\"`, `\"interface_busy\"`, `\"timeout\"`) the\noperator's per-device tile surfaces. Bounded so an OS-error\nstack trace cannot be smuggled through."}}},"ClientWsDisconnectReason":{"type":"string","description":"Closed enum for [`ClientWsServerEvent::DisconnectRequested::reason`].\n`user_initiated_remote` is the verbatim\nexample; the rest are the small, fixed set of cases the\noperator surface actually emits\n(`POST /devices/{id}/disconnect`). A free-string `reason` would\ndrift across product surfaces; the closed enum makes the daemon\nCLI's user-facing message table exhaustive.","enum":["user_initiated_remote","acl_changed_deny","subscription_expired","server_maintenance"]},"ClientWsServerEvent":{"oneOf":[{"type":"object","description":"A WG profile (`tunnels` + `wireguard_tunnels` row) in the\ndevice's org changed — `wireguard_tunnels.public_key`,\n`allocated_ip`, `dns_servers`, or the parent tunnel's\n`server_id` / `status`. The daemon re-fetches\n`GET /client/me/profiles` to pick up the new shape;\n`tunnel_id` lets a smart daemon skip the fetch when the\nchanged tunnel is not currently up.","required":["tunnel_id","event"],"properties":{"event":{"type":"string","enum":["profile_updated"]},"tunnel_id":{"type":"string","description":"The `tunnels.id` (UUIDv7) whose extension row changed."}}},{"type":"object","description":"The org's ACL ruleset (`org_acl_rules`) changed — a new\nrule, a priority shuffle, a deny added. The daemon\nre-fetches its computed policy; `version` lets it skip when\nit already applied a stamp at least this new.","required":["version","event"],"properties":{"event":{"type":"string","enum":["acl_changed"]},"version":{"type":"integer","format":"int64","description":"Monotonic change stamp: the mutation instant as Unix\nepoch milliseconds\n([`super::client_events::change_stamp`]). Ordering-only —\nthe re-fetch the daemon triggers carries the\nauthoritative content."}}},{"type":"object","description":"Operator command: the daemon must tear\ndown its active tunnel and stay disconnected until the\nnext `connect_requested` or until the user re-runs\n`appsynergy connect`. `reason` is a short token surfaced\nin the local CLI so the user understands why the tunnel\ndropped without leaking operator-internal context — the\nclosed enum below pins the vocabulary, no free strings.","required":["reason","event"],"properties":{"event":{"type":"string","enum":["disconnect_requested"]},"reason":{"$ref":"#/components/schemas/ClientWsDisconnectReason","description":"Why the operator disconnected the device (closed enum;\nthe verbatim example is `user_initiated_remote`)."}}},{"type":"object","description":"Operator command: the daemon should bring\nup the named tunnel. `tunnel_id` selects which of the\nallowed-tunnel set (`GET /client/me/profiles`) to use; the\ndaemon's local kill-switch + always-on policies still\napply. The matching CLI shape is `appsynergy connect\n<profile>`, just pushed.","required":["tunnel_id","event"],"properties":{"event":{"type":"string","enum":["connect_requested"]},"tunnel_id":{"type":"string","description":"The `tunnels.id` (UUIDv7) the daemon should bring up."}}},{"type":"object","description":"The device's versioned operating config (the\n`/client/me/config` poll target) changed — operator\nPATCHed `always_on` / `kill_switch` / `trusted_networks` /\n`expected_version`, or revoked / paused / reconnected the\ndevice. The daemon re-fetches `GET /client/me/config`;\n`version` lets it skip when it already applied a stamp at\nleast this new.","required":["version","event"],"properties":{"event":{"type":"string","enum":["config_changed"]},"version":{"type":"integer","format":"int64","description":"Monotonic change stamp: the mutation instant as Unix\nepoch milliseconds\n([`super::client_events::change_stamp`]). Ordering-only —\nthe config ETag from the re-fetch stays the\nauthoritative content tag."}}},{"type":"object","description":"Final event: the operator revoked the\ndevice. The daemon must tear down, self-disable, and stop\nre-trying — its bearer is now invalidated\n(ResolvePrincipal 401s revoked devices on every subsequent\nHTTP call, so a daemon that ignores this still cannot\nreach the control plane). No payload — the discriminant\nalone is the message.","required":["event"],"properties":{"event":{"type":"string","enum":["revoked"]}}},{"type":"object","description":"Out-of-band RTT probe request\n(`POST /devices/mesh/probe`): both named devices receive this\npush and measure RTT toward each other; the result lands in\n`peer_paths` via the heartbeat/telemetry path. The receiving\ndaemon identifies its role by matching its own device id\nagainst the pair.","required":["src_device_id","dst_device_id","event"],"properties":{"dst_device_id":{"type":"string","description":"Probe destination `client_devices.id` (UUIDv7)."},"event":{"type":"string","enum":["mesh_probe_requested"]},"src_device_id":{"type":"string","description":"Probe source `client_devices.id` (UUIDv7)."}}},{"type":"object","description":"The optimal path toward `peer_device_id` changed\n(): the `peer_path_optimizer` recomputed the pair's\n`peer_paths.via`. The daemon re-routes new flows toward the\npeer accordingly; in-flight traffic drains on the old path.","required":["peer_device_id","via","event"],"properties":{"event":{"type":"string","enum":["path_changed"]},"peer_device_id":{"type":"string","description":"The other endpoint of the recomputed pair."},"via":{"type":"string","description":"The new path: `direct`, `bridge:<mesh_bridges.id>`, or\n`hub:<servers.id>` (the `peer_paths.via` vocabulary)."}}},{"type":"object","description":"An org admin approved a mesh bridge\n(`POST /devices/mesh/bridges/{id}/approve`): the bridge is now\n`active` and the next optimizer pass may route pairs through\nit. Affected pairs additionally receive [`Self::PathChanged`]\nwhen their `via` actually flips.","required":["bridge_id","event"],"properties":{"bridge_id":{"type":"string","description":"The activated `mesh_bridges.id` (UUIDv7)."},"event":{"type":"string","enum":["bridge_activated"]}}},{"type":"object","description":"A mesh bridge was revoked (operator action or TTL expiry):\nthe daemon must stop offering / using the bridge; affected\npairs flip back via the next optimizer pass's\n[`Self::PathChanged`].","required":["bridge_id","event"],"properties":{"bridge_id":{"type":"string","description":"The revoked `mesh_bridges.id` (UUIDv7)."},"event":{"type":"string","enum":["bridge_revoked"]}}}],"description":"A customer-dashboard event the control plane pushes down the\ndevice's WebSocket. The discriminant rides the `event` JSON key\n(`#[serde(tag = \"event\")]`); the variant set is\nplus the AA mesh events (probe push,\n`path_changed` from lines 480/1101, bridge\nactivation/revocation from line 1097). The enum is closed — a\ndiscriminant the server never emits cannot be constructed, and a\nmalformed inbound discriminant fails deserialization (the daemon\nonly ever *receives* these, but the round-trip is pinned so the\ncontract cannot drift)."},"ClientWsServerFrame":{"allOf":[{"$ref":"#/components/schemas/ClientWsServerEvent","description":"The customer-dashboard event. Flattened so the discriminant\n(`event`) and the variant payload sit at the envelope's\ntop level, matching verbatim."},{"type":"object","required":["event_id"],"properties":{"event_id":{"type":"string","description":"Server-assigned per-event correlation id (a UUIDv7 string).\nThe daemon returns it verbatim in [`ClientWsClientAck::ack`]\nso the server can match the ack to the pushed event."}}}],"description":"The envelope actually written to the socket: a\n[`ClientWsServerEvent`] plus the server-assigned `event_id` the\ndaemon echoes back in its [`ClientWsClientAck`]. The event\nfields are flattened so the wire JSON is exactly\nline 1141-1147's shape with one added `event_id` key\n(e.g. `{ \"event_id\": \"01J…\", \"event\": \"profile_updated\",\n\"tunnel_id\": \"…\" }`). Response-only — the daemon never sends\nthis — so no `Validate`."},"CloseOutcome":{"type":"object","description":"What [`close`] did.","required":["deletion_id","status","purge_after"],"properties":{"deletion_id":{"type":"string","description":"The deletion's id."},"purge_after":{"type":"string","description":"When the account is erased (or was, for spam removal)."},"status":{"type":"string","description":"Where the workflow stands after the first run: `scheduled` (in the\ngrace period), `purging`, `completed`, `failed`."}}},"ContactLeadRequest":{"type":"object","description":"`POST /public/leads/contact` request body. A message from the\n`/contact` form. `kind` selects which inbox the lead routes to.","required":["kind","email","message"],"properties":{"email":{"type":"string","description":"Reply email. RFC-shaped; any domain accepted."},"kind":{"type":"string","description":"Contact channel — one of `support` / `sales` / `press` /\n`security`. Validated against the closed set at the handler."},"message":{"type":"string","description":"Message body. 1–5000 chars."}}},"CreateBridgeEndpointRequest":{"type":"object","description":"Body for `POST /platform/quic-servers/{id}/bridges`.","required":["endpoint"],"properties":{"endpoint":{"type":"string","description":"The alternate `host:port` this server is also reachable at.\nDialed with the same pinned `ed25519_public_key` as the primary\nendpoint -- a bridge cannot redirect a client to an impostor."},"label":{"type":["string","null"],"description":"Operator note identifying this bridge (e.g. a CDN front or an\nalternate PoP)."},"priority":{"type":["integer","null"],"format":"int64","description":"Dial order (ascending = tried first). Defaults to 100 -- after\nthe primary endpoint, which the dial loop always tries first\nregardless of any bridge's priority."}}},"CreateHostRouteRequest":{"type":"object","description":"Body for `POST /platform/host-routes`.","required":["public_ip_id","destination_ip","routing_server_id"],"properties":{"description":{"type":["string","null"],"description":"Operator note identifying which infra host this is."},"dest_ports":{"type":["string","null"],"description":"Optional port-forward subset (`tcp/443,udp/53`); NULL = full IP."},"destination_ip":{"type":"string","description":"Internal host the public IP routes to (the DNAT target)."},"priority":{"type":["integer","null"],"format":"int64","description":"Forwarding priority (higher first). Default 100."},"public_ip_id":{"type":"string","description":"The public IP to claim for infra use. Must be `available` and in\nthe `claim_scope IN ('infra','any')` section."},"routing_server_id":{"type":"string","description":"The routing server (PoP) that applies this rule."},"rule_type":{"type":["string","null"],"description":"`dnat` / `snat` / `both` (default `both`)."}}},"CrossOrgAssumeGrantListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/assume-grants`.\nA bare object with a single `grants` array — keeps\nthe door open to add envelope-level fields (`total`,\n`has_more`, future cursor) without breaking clients that\nalready parse the array shape, mirroring\n`SsoProviderListResponse` / `PolicyConditionListResponse` /\n`ResourceGrantListResponse` / `OrgCustomRoleListResponse` /\n`OrgMemberListResponse` / `ApiTokenListResponse`. Each item\nreuses [`CrossOrgAssumeGrantSummary`] so a future schema\naddition cannot drift the list shape away from the per-row\nprojection.","required":["grants"],"properties":{"grants":{"type":"array","items":{"$ref":"#/components/schemas/CrossOrgAssumeGrantSummary"},"description":"Cross-org assume grants the target org has authorised,\nordered by `(created_at DESC, id DESC)` — newest first,\nwith the `id DESC` tie-breaker keeping rows ordered when\ntwo seeds land in the same RFC3339 second."}}},"CrossOrgAssumeGrantSummary":{"type":"object","description":"Per-row summary projected by\n`GET /iam/orgs/{org_id}/assume-grants` (the read\nslice). One row per `cross_org_assume_grants`\ntable entry, scoped to the path-resolved org as the GRANT\nTARGET (`WHERE target_org_id = ?`).\n\n`source_principal_id` is polymorphic across `users.id`,\n`service_accounts.id`, and `api_tokens.id`; the\n[`CrossOrgAssumeGrantSummary::source_principal_kind`] field\nis the discriminator, mirroring the design `resource_grants`\n(0041) settled on for the same three-principal-kind problem.\n\n`expires_at` carries the optional grant-expiry timestamp;\nthe column is NULL when the grant is open-ended, surfaced as\n`None` (and `null` on the wire). The matching exchange\nendpoint treats a row whose `expires_at` is in the\npast as absent, and the housekeeping path prunes expired\nrows alongside the audit / sessions / idempotency prunes.\n\n`created_by_user_id` is the target-org admin who issued the\ngrant. The schema-level FK is `ON DELETE SET NULL` —\npreserves the grant when the issuing admin is deleted,\ndropping the audit pointer rather than cascading the grant\ninto oblivion. Surfaced as `None` on the wire when the\ncolumn is NULL.","required":["id","source_org_id","source_principal_id","source_principal_kind","target_org_id","allowed_role_name","max_session_seconds","created_at"],"properties":{"allowed_role_name":{"type":"string","description":"Role name the grantee acts as inside the target org. FK\nto `roles(name)`; matches one of the system roles\n(`org_admin`, `vpn_operator`, `viewer`, …) or any custom\nrole the target org has defined. The\nexchange endpoint loads the role's action\npattern set into the assumed-role JWT — the principal\nacts with at most that role's actions inside the target\norg."},"created_at":{"type":"string","description":"RFC3339 timestamp the row was created (matches\n`cross_org_assume_grants.created_at`)."},"created_by_user_id":{"type":["string","null"],"description":"UUIDv7 of the target-org admin who issued the grant.\n`None` (and `null` on the wire) when the issuing admin\nhas since been deleted — the schema-level FK is\n`ON DELETE SET NULL`, so the grant survives the admin's\nremoval but the audit pointer is cleared."},"expires_at":{"type":["string","null"],"description":"RFC3339 timestamp at which the grant stops being\neffective. `None` (and `null` on the wire) when the\ngrant is open-ended; the resolver treats a row whose\n`expires_at` is in the past as absent, and the TTL\nhousekeeping path prunes expired rows alongside the\naudit / sessions / idempotency prunes."},"id":{"type":"string","description":"UUIDv7 identifier of the grant row (matches\n`cross_org_assume_grants.id`). Stable across the row's\nlifetime."},"max_session_seconds":{"type":"integer","format":"int64","description":"Upper bound on the assumed JWT's lifetime in seconds.\nThe exchange endpoint applies this when minting the\n`exp` claim — the principal cannot request a session\nlonger than the grant authorised. Defaults to 3600 at\nthe schema level."},"source_org_id":{"type":"string","description":"UUIDv7 of the source org — the home org the grantee\nprincipal lives in. The exchange endpoint\nmatches this column against the base principal's\nhome-org id when minting the assumed-role JWT."},"source_principal_id":{"type":"string","description":"UUID of the principal authorised to assume into the\ntarget org. Polymorphic by design — matches `users.id`\nOR `service_accounts.id` OR `api_tokens.id`; the\n[`CrossOrgAssumeGrantSummary::source_principal_kind`]\nfield is the discriminator."},"source_principal_kind":{"type":"string","description":"Discriminator for\n[`CrossOrgAssumeGrantSummary::source_principal_id`]. One\nof `user`, `service_account`, `api_token` — the same set\nas the schema-level\n`CHECK (source_principal_kind IN (...))` constraint."},"target_org_id":{"type":"string","description":"UUIDv7 of the target org — the org the assumed session\nruns against. The list endpoint scopes\n`WHERE target_org_id = ?` to the path-resolved org so a\nrow's `target_org_id` always matches the path id."}}},"CryptoCheckoutRequest":{"type":"object","description":"Request body for `POST /billing/checkout/crypto`.","required":["plan_id","billing_cycle","currency"],"properties":{"billing_cycle":{"type":"string","description":"One of `monthly` / `biweekly` / `annual`. Surfaces 422\n`billing_cycle_invalid` for any other value."},"currency":{"type":"string","description":"One of `BTC` / `ETH` / `LTC` (case-sensitive uppercase).\nSurfaces 422 `currency_invalid` for any other value."},"org_id":{"type":["string","null"],"format":"uuid","description":"The org the payment is for (the console's workspace). Defaults to\nthe caller's personal org."},"plan_id":{"type":"string","format":"uuid","description":"UUIDv7 of the target plan. Must reference an existing row in\n`plans` with `active=1`, `visible=1`, and a non-zero price for\nthe requested cycle."}}},"CryptoPaymentListResponse":{"type":"object","description":"Wire response for `GET /billing/crypto/payments`. One-array\nenvelope plus an opaque `next_cursor` token. Mirrors the\n`AddonListResponse` and `BandwidthHistoryListResponse`\nprecedents in the sibling type modules.\n\n`next_cursor` is `None` on the last page (the page returned\nfewer than `limit` rows); a non-null cursor MUST be passed back\nverbatim on the follow-up call. The cursor codec ships with\nthis type (below); the matching list handler consumes\nit.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CryptoPaymentRead"},"description":"Crypto payments scoped to the caller's resolved org,\nordered `(created_at DESC, id DESC)` (newest first). The\nhandler PR pins the ordering; the type carries no ordering\nguarantee on its own — frontends MUST render in vector\norder."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad-encoded cursor for the next page;\n`null` when the current page is the last."}}},"CryptoPaymentRead":{"type":"object","description":"One row of `GET /billing/crypto/payments`\nand `GET /billing/crypto/payments/{id}` (same line). Mirrors\nevery customer-relevant column of the `crypto_payments` table\n(migration 0003 `0003_billing_init.sql`) projected to the wire.\n\n`qr_code_data` is intentionally omitted from this read shape:\nthe QR is created-once at checkout (the create response surfaces\nit directly) and is heavy enough on the wire that re-shipping it\non every list/get page would dominate the response size for no\nfrontend benefit. If a future surface needs the QR on a single\nread it can land in a follow-up sub-area without reshaping the\nlist contract.\n\n`wallet_address` and `sender_address` are public-by-design\n(on-chain destination + sender are observable on any block\nexplorer). Binds only on column names matching\n`*_password|*_secret|*_token|api_key|...`; these are exempt.","required":["id","org_id","plan_id","billing_cycle","currency","wallet_address","amount_crypto","amount_usd","exchange_rate","months","discount","total_usd","confirmations","status","expires_at","payment_uri","created_at","updated_at"],"properties":{"amount_crypto":{"type":"string","description":"Quoted amount in the chosen `currency`\n(`crypto_payments.amount_crypto`). String to preserve\narbitrary-precision (BTC has 8 decimals, XMR has 12, etc.;\nJSON `number` would round-trip via `f64` and lose\nprecision)."},"amount_received":{"type":["string","null"],"description":"Crypto amount actually received in the matched tx\n(`crypto_payments.amount_received`). String to match the\narbitrary-precision rationale of `amount_crypto`. NULL\nuntil matched."},"amount_usd":{"type":"number","format":"double","description":"USD-equivalent of `amount_crypto` at the rate captured by\n[`CryptoPaymentRead::exchange_rate`]\n(`crypto_payments.amount_usd`)."},"billing_cycle":{"type":"string","description":"One of `monthly` / `biweekly` / `annual`\n(`crypto_payments.billing_cycle`). The schema CHECK\nconstraint guarantees the value is one of those three."},"confirmations":{"type":"integer","format":"int64","description":"Number of confirmations the matched tx has accumulated\n(`crypto_payments.confirmations`). `0` until the watcher\nobserves the first inclusion; advances as new blocks\nbuild on top."},"confirmed_at":{"type":["string","null"],"description":"RFC3339 UTC timestamp the payment was confirmed\n(`crypto_payments.confirmed_at`). NULL while\n`status != 'completed'`."},"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp\n(`crypto_payments.created_at`)."},"currency":{"type":"string","description":"Crypto currency code the payment was quoted in\n(`crypto_payments.currency`). E.g. `BTC`, `ETH`, `USDT`,\n`XMR`. Free-form on the schema; the customer-facing UI\nrenders against the same catalogue surfaced by\n[`CryptoRateRead`]."},"discount":{"type":"number","format":"double","description":"Discount applied at create time\n(`crypto_payments.discount`). `0.0` for no discount, else\nthe fractional amount (e.g. `0.10` for a 10% promo)."},"exchange_rate":{"type":"number","format":"double","description":"Per-unit USD exchange rate at create time\n(`crypto_payments.exchange_rate`). Pinned at create time —\n`crypto_rates` updates do not retroactively re-quote."},"expires_at":{"type":"string","description":"RFC3339 UTC timestamp the quote expires\n(`crypto_payments.expires_at`). The lifecycle worker\ntransitions `pending → expired` past this boundary\n(allowed clock-driven housekeeping)."},"id":{"type":"string","description":"UUIDv7 primary key (`crypto_payments.id`). RFC4122 string\nform on the wire — matches the rest of the customer-facing\nread shapes."},"months":{"type":"integer","format":"int64","description":"Number of months the payment is purchasing\n(`crypto_payments.months`). The schema CHECK constraint\nguarantees `months > 0`."},"org_id":{"type":"string","description":"Owning org (`crypto_payments.org_id`). The caller's\nprincipal must hold `billing:payment:read` against this org\nfor the row to surface."},"payment_uri":{"type":"string","description":"Wallet-protocol payment URI (e.g.\n`bitcoin:<address>?amount=<amount>`)\n(`crypto_payments.payment_uri`). Public-by-design — this\nis the deep-link the customer's wallet consumes."},"plan_id":{"type":"string","description":"Plan the payment is purchasing (`crypto_payments.plan_id`).\nResolves against `plans.id`; pinned at create time so a\nfuture plan-price-change does not retroactively rewrite the\nquote."},"sender_address":{"type":["string","null"],"description":"Sender wallet address observed in the matched tx\n(`crypto_payments.sender_address`). NULL until matched."},"status":{"type":"string","description":"One of `pending` / `confirming` / `completed` / `expired` /\n`failed` (`crypto_payments.status`). The schema CHECK\nconstraint guarantees the value is one of those five."},"subscription_id":{"type":["string","null"],"description":"Subscription created when the payment completed\n(`crypto_payments.subscription_id`). NULL until the payment\nreaches `status='completed'` (the schema column is nullable\nfor the same reason)."},"total_usd":{"type":"number","format":"double","description":"Final USD total billed\n(`crypto_payments.total_usd`) — the `amount_usd * months *\n(1 - discount)` rollup pinned at create time."},"tx_hash":{"type":["string","null"],"description":"On-chain transaction hash once the customer's wallet has\nbroadcast (`crypto_payments.tx_hash`). NULL until the\nblockchain watcher observes the first matching tx."},"updated_at":{"type":"string","description":"RFC3339 UTC last-update timestamp\n(`crypto_payments.updated_at`). Advances every time the\nblockchain watcher updates `status` / `confirmations` /\n`tx_hash`."},"user_id":{"type":["string","null"],"description":"User who initiated the checkout\n(`crypto_payments.user_id`). NULL when the user has been\nremoved (`ON DELETE SET NULL`); the row stays attached to\nthe org for audit purposes."},"wallet_address":{"type":"string","description":"Destination wallet address the customer must send to\n(`crypto_payments.wallet_address`). Public-by-design — this\nis the address the customer types into their wallet."}}},"CryptoPaymentResolve":{"type":"object","description":"The settlement.","required":["resolution","note"],"properties":{"note":{"type":"string","description":"What was done (refund transaction, how it was applied)."},"resolution":{"$ref":"#/components/schemas/CryptoResolution"}}},"CryptoPaymentResolved":{"type":"object","description":"The payment after.","required":["id","status"],"properties":{"failure_reason":{"type":["string","null"]},"id":{"type":"string"},"resolution":{"type":["string","null"]},"resolution_note":{"type":["string","null"]},"resolved_at":{"type":["string","null"]},"status":{"type":"string"}}},"CryptoRateListResponse":{"type":"object","description":"Wire response for `GET /billing/crypto/rates`.\nOne-array envelope mirroring the `OrgCustomRoleListResponse`\nno-pagination precedent: the rate catalogue is small (one row\nper supported currency) so paginating it would only add\nindirection without saving bytes.\n\nEmpty catalogue surfaces as `{\"items\": []}` rather than `null`\nso frontends can iterate without a presence guard.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CryptoRateRead"},"description":"Per-currency rate rows, ordered `currency ASC` so the\nresponse is stable across repeated polls and the frontend\ncan render in a deterministic order without re-sorting."}}},"CryptoRateRead":{"type":"object","description":"One row of `GET /billing/crypto/rates`.\nProjects `crypto_rates` (migration 0003) to the wire.\nThe catalogue is small (one row per supported currency) so\nthe handler returns the full list with no pagination.\n\nEvery field is public-by-design — the rate catalogue is the\nsame one quoted on the customer-facing pricing surface before\nsignup; there is nothing sensitive about it.","required":["currency","usd_rate","source","updated_at"],"properties":{"currency":{"type":"string","description":"Crypto currency code (`crypto_rates.currency`). Primary\nkey of the lookup table. E.g. `BTC`, `ETH`, `USDT`, `XMR`."},"source":{"type":"string","description":"Provenance of the rate (`crypto_rates.source`). E.g.\n`coingecko` / `coinbase`. Surfaced on the wire for\ntransparency."},"updated_at":{"type":"string","description":"RFC3339 UTC timestamp the rate was last refreshed\n(`crypto_rates.updated_at`)."},"usd_rate":{"type":"number","format":"double","description":"USD per unit of `currency` (`crypto_rates.usd_rate`).\nUpdated by the rate-poller worker; the customer-facing\nquote pins this value at checkout time into\n[`CryptoPaymentRead::exchange_rate`]."}}},"CryptoResolution":{"type":"string","description":"How the payment was settled.","enum":["refunded","applied_manually"]},"CryptoSettingsRead":{"type":"object","description":"Read shape for `GET /settings/crypto` and the\n`PATCH /settings/crypto` 200 response. One field per\n`crypto_settings` column with the wire naming preserved 1:1.\n\nLazy-row contract (same as `SystemSettingsRead` /\n`StripeSettingsRead` / `BillingSettingsRead`): the row at\n`id = 1` is created lazily by the first writer (comment in\n0008). A GET against an empty `crypto_settings` table surfaces\nthe column DEFAULTs (`enabled = false`, every wallet address\n`None`, `confirmation_threshold = 2`, `payment_window_minutes\n= 30`,\n`updated_at = \"1970-01-01T00:00:00Z\"`) so the wire shape stays\nuniform regardless of whether a write has happened yet. The\nmatching handler is responsible for the lazy-default\nprojection.\n\nThe three wallet-address fields are `Option<String>` because the\nschema columns are nullable TEXT; the three non-nullable columns\n(`enabled`, `confirmation_threshold`, `payment_window_minutes`)\nsurface as non-optional fields.\n\n`updated_at` is RFC3339 UTC. It is server-stamped on every PATCH\n(via `state.clock.now()`) and read-only — absent from the\nmatching [`CryptoSettingsUpdate`] type.","required":["enabled","confirmation_threshold","payment_window_minutes","updated_at"],"properties":{"btc_wallet_address":{"type":["string","null"],"description":"Optional Bitcoin payout address. Nullable TEXT in the\nschema — `None` is wire-equivalent to \"operator has not\nset one yet\"; the BTC checkout path refuses to mint a new\n`crypto_payments` row in that case."},"confirmation_threshold":{"type":"integer","format":"int64","description":"Number of on-chain confirmations required before a\n`crypto_payments` row transitions out of `pending`. Not enforced\nyet: the confirmation webhook (`webhooks/crypto_webhook.rs`)\ncompletes a payment on the provider's\n`confirmation_threshold_reached` event without comparing the\nreported `confirmations` with this value.\nSchema CHECK is `>= 1`; the\n[`CryptoSettingsUpdate`] validator additionally caps at\n50 so a typo can never silently land a multi-thousand-\nconfirmation requirement that would never settle."},"enabled":{"type":"boolean","description":"Master toggle. When `false`, the customer-facing crypto\ncheckout endpoints return 503 even if wallet\naddresses are configured. Backed by the schema's\n`enabled INTEGER NOT NULL DEFAULT 0 CHECK (enabled IN\n(0, 1))` column; the wire form is a plain bool and the\nhandlers do the int↔bool conversion."},"eth_wallet_address":{"type":["string","null"],"description":"Optional Ethereum payout address. Same nullable contract\nas `btc_wallet_address`."},"ltc_wallet_address":{"type":["string","null"],"description":"Optional Litecoin payout address. Same nullable contract\nas `btc_wallet_address`."},"payment_window_minutes":{"type":"integer","format":"int64","description":"How long, in minutes, the customer has to settle the\npayment before worker N transitions the row from\n`pending` → `expired`. Schema CHECK is `>= 1`; the\n[`CryptoSettingsUpdate`] validator additionally caps at\n1440 (24 hours)."},"updated_at":{"type":"string","description":"RFC3339 UTC timestamp of the last write. Server-stamped\non every PATCH; on a fresh deployment with no write yet,\nthe handler surfaces `\"1970-01-01T00:00:00Z\"` so the\nwire shape stays non-optional."}}},"CryptoSettingsUpdate":{"type":"object","description":"Request body for `PATCH /settings/crypto`. Every field is\n`Option<T>` so a JSON object that omits a key leaves the column\nunchanged. An empty-object PATCH (`{}`) is a no-op at the\ncolumn level — only `updated_at` advances (the handler\nmirrors the no-op semantics).\n\nThe three nullable wallet-address columns\n(`btc_wallet_address` / `eth_wallet_address` /\n`ltc_wallet_address`) use `Option<String>`. The matching\nhandler treats an explicit empty string as \"clear to NULL\"\n(i.e. `{\"btc_wallet_address\": \"\"}` clears the column); a\nnon-empty string sets the column. Distinguishing \"omit\" from\n\"explicit null\" without that convention requires an\n`Option<Option<T>>` double-option pattern; the\nempty-string-clears convention is strictly simpler and matches\nhow the dashboard's text inputs already round-trip. The\nvalidator's `length(max = 128)` rule accepts the empty string\nthe handler will then short-circuit on; the lower bound check\nlives in the handler, not the validator.\n\n`garde` constraints fire only when the field is `Some(_)` —\n`None` is skipped automatically by the `garde` crate's\n`Option` semantics.\n\n`updated_at` is server-stamped on every PATCH and is\nintentionally absent from this type — the wire cannot override\nthe timestamp.","properties":{"btc_wallet_address":{"type":["string","null"],"description":"New `btc_wallet_address`. Capped at 128 chars (well above\nthe longest supported BTC address form). Empty string\nclears the column to NULL (handler convention)."},"confirmation_threshold":{"type":["integer","null"],"format":"int64","description":"New `confirmation_threshold`. Schema CHECK pins `>= 1`;\nthe validator additionally caps at 50 (well past the\npractical Bitcoin ceiling)."},"enabled":{"type":["boolean","null"],"description":"New `enabled` flag. Plain bool on the wire; the\nhandler converts to the schema's `0` / `1` storage form."},"eth_wallet_address":{"type":["string","null"],"description":"New `eth_wallet_address`. Same shape as\n`btc_wallet_address`."},"ltc_wallet_address":{"type":["string","null"],"description":"New `ltc_wallet_address`. Same shape as\n`btc_wallet_address`."},"payment_window_minutes":{"type":["integer","null"],"format":"int64","description":"New `payment_window_minutes`. Schema CHECK pins `>= 1`;\nthe validator additionally caps at 1440 (24 hours)."}}},"CurrentBindingRef":{"type":"object","description":"Binding information nested inside [`PublicIpRead::current_binding`]\nwhen an active or pending binding exists for the IP.","required":["id","tunnel_id","status","rule_type"],"properties":{"applied_at":{"type":["string","null"],"description":"RFC3339 timestamp when the routing agent confirmed the rule is\nactive (`bindings.applied_at`). `null` while still pending."},"dest_ports":{"type":["string","null"],"description":"Optional port-forward subset (`\"tcp/443,udp/53\"` style).\n`null` when the full IP is routed (default 1:1 mode)."},"id":{"type":"string","description":"UUIDv7 primary key of the `bindings` row."},"rule_type":{"type":"string","description":"Rule type governing traffic direction: `\"dnat\"`, `\"snat\"`, `\"both\"`."},"status":{"type":"string","description":"Binding lifecycle status: `\"pending\"`, `\"active\"`, `\"removing\"`."},"tunnel_id":{"type":"string","description":"UUIDv7 of the tunnel this IP is bound to (`bindings.tunnel_id`)."}}},"DashboardServerEvent":{"oneOf":[{"type":"object","description":"Initial topology snapshot for a `topology:org:*` or\n`topology:fleet` subscription.","required":["topic","devices","event"],"properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/TopologyDevice"},"description":"Devices visible in the topology."},"event":{"type":"string","enum":["snapshot"]},"topic":{"type":"string","description":"The topic this snapshot belongs to."}}},{"type":"object","description":"Device-status delta event (online/offline transitions, current\nconnection changes), published by the heartbeat (V) and\nconnection (W) producers.","required":["topic","device_id","online","event"],"properties":{"device_id":{"type":"string","description":"Affected device id."},"event":{"type":"string","enum":["device_status"]},"online":{"type":"boolean","description":"`true` when the device's latest heartbeat is fresh."},"topic":{"type":"string","description":"The topic this delta belongs to."}}},{"type":"object","description":"Flow-rate sample (1 Hz), published by the metering producer (M).","required":["topic","src_device_id","bytes_per_sec","protocol_class","event"],"properties":{"bytes_per_sec":{"type":"integer","format":"int64","description":"Aggregate bytes/sec for this flow class."},"event":{"type":"string","enum":["flow_rate"]},"protocol_class":{"type":"string","description":"Wire protocol class (`tcp`, `udp`, `quic`, ...)."},"src_device_id":{"type":"string","description":"Source device id."},"topic":{"type":"string","description":"The topic this sample belongs to."}}},{"type":"object","description":"Device lifecycle delta: the device entered `status`\n(`joined` on enrolment, `revoked` on revoke, `deleted` when\nthe row is removed). Published by the V device surfaces.","required":["topic","device_id","status","event"],"properties":{"device_id":{"type":"string","description":"Affected device id."},"event":{"type":"string","enum":["device_lifecycle"]},"status":{"type":"string","description":"New lifecycle state: `joined`, `paused`, `revoked`, or\n`deleted`."},"topic":{"type":"string","description":"The topic this delta belongs to."}}},{"type":"object","description":"Connection delta: a `client_connections` row opened\n(`open = true`) or closed (`open = false`). Published by the\nW connection surfaces.","required":["topic","device_id","connection_id","open","event"],"properties":{"connection_id":{"type":"string","description":"The `client_connections.id` affected."},"device_id":{"type":"string","description":"Device that owns the connection."},"event":{"type":"string","enum":["connection_status"]},"open":{"type":"boolean","description":"`true` on open, `false` on close."},"topic":{"type":"string","description":"The topic this delta belongs to."}}},{"type":"object","description":"Bridge delta: a mesh bridge transitioned to `status`\n(`active` on approve, `revoked` on revoke / TTL expiry).\nPublished by the AA bridge surfaces and the TTL worker.","required":["topic","bridge_id","status","event"],"properties":{"bridge_id":{"type":"string","description":"The `mesh_bridges.id` affected."},"event":{"type":"string","enum":["bridge_status"]},"status":{"type":"string","description":"New bridge state: `active` or `revoked`."},"topic":{"type":"string","description":"The topic this delta belongs to."}}},{"type":"object","description":"Peer-path delta: the optimizer recomputed the chosen path for\none device pair (\"peer_path recomputed\").","required":["topic","src_device_id","dst_device_id","via","event"],"properties":{"dst_device_id":{"type":"string","description":"Canonical pair destination (`peer_paths.dst_device_id`)."},"event":{"type":"string","enum":["path_recomputed"]},"src_device_id":{"type":"string","description":"Canonical pair source (`peer_paths.src_device_id`)."},"topic":{"type":"string","description":"The topic this delta belongs to."},"via":{"type":"string","description":"The new `peer_paths.via` (`direct`, `bridge:<id>`,\n`hub:<server_id>`)."}}},{"type":"object","description":"Path-tier cap notice: a subscription crossed its tier's\nincluded monthly allowance with overages disabled. Published\nonce per (subscription, tier, period) by the path-usage\nworker's cap-surfacer pass.","required":["topic","subscription_id","path_tier_id","used_bytes","included_bytes","event"],"properties":{"event":{"type":"string","enum":["tier_capped"]},"included_bytes":{"type":"integer","format":"int64","description":"The tier's included monthly allowance in bytes."},"path_tier_id":{"type":"string","description":"The capped `network_path_tiers.id`."},"subscription_id":{"type":"string","description":"Affected subscription id."},"topic":{"type":"string","description":"The topic this notice belongs to."},"used_bytes":{"type":"integer","format":"int64","description":"Bytes used this period (`bytes_in + bytes_out`)."}}},{"type":"object","description":"Exit-reroute delta: the anycast PoP optimizer moved a\nbinding's egress to a better-measured PoP's server. Published\nonce per reroute on the org + fleet topics.","required":["topic","binding_id","exit_server_id","event"],"properties":{"binding_id":{"type":"string","description":"The rerouted `bindings.id`."},"event":{"type":"string","enum":["exit_rerouted"]},"exit_server_id":{"type":"string","description":"The new `bindings.exit_server_id`."},"topic":{"type":"string","description":"The topic this delta belongs to."}}},{"type":"object","description":"Backpressure notice: the subscriber fell behind and the hub\ndropped frames. The frontend re-fetches a snapshot and resumes.","required":["topic","event"],"properties":{"event":{"type":"string","enum":["lag"]},"topic":{"type":"string","description":"The topic where the drop occurred."}}},{"type":"object","description":"Subscription was refused (the principal lacks access to the\nrequested topic). Server closes the socket after sending.","required":["topic","event"],"properties":{"event":{"type":"string","enum":["forbidden"]},"topic":{"type":"string","description":"The rejected topic."}}},{"type":"object","description":"The user's session was revoked or the org membership changed.\nServer closes the socket after sending.","required":["event"],"properties":{"event":{"type":"string","enum":["revoke"]}}}],"description":"Outbound server-to-client event frame, tagged by `event`."},"DeleteAccountRequest":{"type":"object","description":"`DELETE /auth/me` body.","properties":{"team_successors":{"type":"array","items":{"$ref":"#/components/schemas/SuccessorChoice"},"description":"Who takes over each team the person is the only administrator of.\nA team left out passes to its longest-standing member."}}},"DeleteAccountResponse":{"type":"object","description":"`DELETE /auth/me` response.","required":["ok","deletion"],"properties":{"deletion":{"$ref":"#/components/schemas/CloseOutcome","description":"The deletion."},"ok":{"type":"boolean","description":"Always `true` on success."}}},"DeleteUserRequest":{"type":"object","description":"`DELETE /platform/users/{id}` body.","required":["mode"],"properties":{"mode":{"$ref":"#/components/schemas/StaffDeleteMode","description":"Standard or spam removal."},"note":{"type":["string","null"],"description":"What staff record about it: required for spam removal (3 to 500\ncharacters)."},"reason":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/StaffCloseReason","description":"Why (standard mode; spam removal is always `abuse`)."}]},"team_successors":{"type":"array","items":{"$ref":"#/components/schemas/SuccessorChoice"},"description":"Who takes over each team the person is the only administrator of."}}},"DeleteUserResponse":{"type":"object","description":"`DELETE /platform/users/{id}` response.","required":["ok","deletion"],"properties":{"deletion":{"$ref":"#/components/schemas/CloseOutcome","description":"The deletion."},"ok":{"type":"boolean","description":"Always `true` on success."}}},"DeletionImpact":{"type":"object","description":"Everything the confirmation shows.","required":["can_close","refusals","subscriptions","resources","teams","grace_days","email_verified","is_staff","purge_held","disputed"],"properties":{"can_close":{"type":"boolean","description":"The owner may delete it now: no refusal stands."},"closed_at":{"type":["string","null"],"description":"When the account was closed, if it is."},"closed_reason":{"type":["string","null"],"description":"Why it was closed."},"deletion":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/DeletionState","description":"The latest deletion of the account."}]},"disputed":{"type":"boolean","description":"A card payment is disputed: not erased while it is open."},"email_verified":{"type":"boolean","description":"The address was verified (only a verified address is emailed)."},"grace_days":{"type":"integer","format":"int64","description":"Days the account can be restored after it is deleted."},"is_staff":{"type":"boolean","description":"The account holds a platform role."},"purge_after":{"type":["string","null"],"description":"When a closed account is erased."},"purge_held":{"type":"boolean","description":"Staff placed a purge hold."},"purge_hold_reason":{"type":["string","null"],"description":"Why."},"refusals":{"type":"array","items":{"$ref":"#/components/schemas/Refusal"},"description":"What must be settled first (as the owner would be refused)."},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceCount"},"description":"Resources deleted at the end of the grace period."},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionImpact"},"description":"Subscriptions cancelled at once, with the refund under the Terms."},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamPlan"},"description":"Teams: left, handed to a successor, or dissolved."}}},"DeletionState":{"type":"object","description":"A deletion's progress, for staff and for a closed account's owner.","required":["id","status","mode","reason","requested_at","purge_after","attempts"],"properties":{"attempts":{"type":"integer","format":"int64","description":"Failed runs in a row."},"billing_done_at":{"type":["string","null"],"description":"Billing stopped."},"completed_at":{"type":["string","null"],"description":"Finished."},"erased_at":{"type":["string","null"],"description":"Personal data erased."},"failed_at":{"type":["string","null"],"description":"When it was handed to staff."},"id":{"type":"string","description":"Its id."},"last_error":{"type":["string","null"],"description":"The last failure."},"mode":{"type":"string","description":"`standard` or `immediate`."},"note":{"type":["string","null"],"description":"Staff's note."},"purge_after":{"type":"string","description":"When the purge may start."},"reason":{"type":"string","description":"Why."},"requested_at":{"type":"string","description":"When it was asked for."},"status":{"type":"string","description":"`scheduled`, `purging`, `completed`, `failed`, `cancelled`."}}},"DeviceCertEnrollRequest":{"type":"object","description":"`POST /client/me/cert` request — the enrolling device's\nself-generated CSR. The device holds the matching private key\nlocally and never sends it (custody model); the\nCSR's embedded self-signature is the server's proof the caller\nactually holds that key.","required":["csr_pem"],"properties":{"csr_pem":{"type":"string","description":"PEM-encoded PKCS#10 certificate signing request. The server\nignores any subject / SAN the CSR carries — the issued cert's\nsubject is always the authenticated device's id."}},"additionalProperties":false},"DeviceCertEnrollResponse":{"type":"object","description":"`POST /client/me/cert` response — the issued leaf plus the CA\ncertificate the device needs to complete a local trust chain (or\npin the root for auth-time verification).","required":["cert_pem","ca_cert_pem","fingerprint_sha256","serial_hex","not_before","not_after"],"properties":{"ca_cert_pem":{"type":"string","description":"PEM of the issuing device-CA certificate (public; not secret).\nDevices pin or chain against this root when presenting the leaf."},"cert_pem":{"type":"string","description":"PEM of the newly issued device certificate."},"fingerprint_sha256":{"type":"string","description":"SHA-256 hex fingerprint of the issued leaf's DER encoding."},"not_after":{"type":"string","description":"RFC3339 validity end."},"not_before":{"type":"string","description":"RFC3339 validity start."},"serial_hex":{"type":"string","description":"Hex-encoded certificate serial number."}}},"DeviceCertRevokeResponse":{"type":"object","description":"`POST /devices/{id}/cert/revoke` response.","required":["device_id","cert_id","revoked_at"],"properties":{"cert_id":{"type":"string","description":"The revoked `device_certs` row id."},"device_id":{"type":"string","description":"The device whose active cert was revoked."},"revoked_at":{"type":"string","description":"RFC3339 instant the revoke landed."}}},"DeviceConnectRequest":{"type":"object","description":"Request body for `POST /devices/{id}/connect`. The handler\nvalidates that the tunnel exists and lives in the same org as\nthe device, then records the operator intent (audit + a future\n`connect_requested` WS push).","required":["tunnel_id"],"properties":{"tunnel_id":{"type":"string","format":"uuid","description":"UUIDv7 of the tunnel the device should apply. Must be a\ntunnel in the same org as the device — cross-org tunnel\nsurfaces as 422 `invalid_tunnel`."}}},"DeviceConnectResponse":{"type":"object","description":"Response body for `POST /devices/{id}/connect`. 202 Accepted on\nthe success path; the audit row is the canonical record of the\noperator intent.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"DeviceConnectionListResponse":{"type":"object","description":"Response body for `GET /devices/{id}/connections`. Envelope\nshape mirrors `AgentListResponse` / `JoinTokenListResponse` so\nevery cursor-paginated list across the codebase carries\n`{ items, next_cursor }`.","required":["connections"],"properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/DeviceConnectionRead"},"description":"Connections newest-first (`started_at DESC, id DESC`).\nBounded by the request's `limit` (default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor that resumes the listing at the next page.\n`None` when the current page is the last."}}},"DeviceConnectionRead":{"type":"object","description":"One row of the per-device session log. Mirrors\n`client_connections` columns with no transformation — every\nnumeric column projects as-is; `tunnel_id` / `server_id` /\n`public_endpoint` / `ended_at` / `last_handshake_at` /\n`last_telemetry_at` / `rtt_ms` / `packet_loss_pct` /\n`datagrams_in` / `datagrams_out` / `streams_open` /\n`ended_reason` carry `None` when their column is NULL.","required":["id","started_at","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Cumulative bytes received over the session (last reported\ntelemetry value)."},"bytes_out":{"type":"integer","format":"int64","description":"Cumulative bytes sent over the session."},"datagrams_in":{"type":["integer","null"],"format":"int64","description":"Cumulative inbound QUIC datagrams over the session\n(last reported telemetry value). `None` for WireGuard\nconnections, which have no datagram-granularity counter."},"datagrams_out":{"type":["integer","null"],"format":"int64","description":"Cumulative outbound QUIC datagrams over the session. See\n`datagrams_in`."},"ended_at":{"type":["string","null"],"description":"RFC3339 timestamp the session closed. `None` while the\nsession is still open."},"ended_reason":{"type":["string","null"],"description":"Optional close reason — only populated when `ended_at` is\nset. Free-form string; the device control plane writes the\ncanonical set (`user_disconnect`, `tunnel_revoked`, etc.)."},"id":{"type":"string","description":"UUIDv7 identifier of the connection row."},"last_handshake_at":{"type":["string","null"],"description":"RFC3339 timestamp of the most recent handshake the device\nreported. `None` until the first telemetry tick."},"last_telemetry_at":{"type":["string","null"],"description":"RFC3339 timestamp of the most recent telemetry tick. `None`\nuntil the first one lands."},"packet_loss_pct":{"type":["number","null"],"format":"double","description":"Last reported packet loss percentage `0..=100`. `None`\nuntil measured."},"public_endpoint":{"type":["string","null"],"description":"`ip:port` the device dialed from on the public internet;\n`None` when not yet reported."},"rtt_ms":{"type":["integer","null"],"format":"int64","description":"Last reported round-trip-time over the tunnel in\nmilliseconds. `None` until measured."},"server_id":{"type":["string","null"],"description":"Server the session terminated at (FK to `servers.id`;\nnullable for the same `ON DELETE SET NULL` reason as\n`tunnel_id`)."},"started_at":{"type":"string","description":"RFC3339 timestamp the session opened. Cursor uses this\ncolumn as the primary ordering key."},"streams_open":{"type":["integer","null"],"format":"int64","description":"Currently open QUIC streams on the session. `None` until a\ndaemon build reports it (see\n`client_connection_patch_types::ClientConnectionPatchRequest::streams_open`)."},"tunnel_id":{"type":["string","null"],"description":"Tunnel the session ran over (FK to `tunnels.id`; nullable\nbecause the FK is `ON DELETE SET NULL` — the connection\nlog survives tunnel deletion)."}}},"DeviceConnectionSummary":{"type":"object","description":"Compact current-connection summary surfaced on the list (full\ntelemetry — RTT, packet loss, handshake timestamps — is available\nfrom `GET /devices/{id}/connections`). Fields mirror the\n`client_connections` projection but only the columns a dashboard\nrow needs to render the \"currently connected via X\" badge.","required":["id","bytes_in","bytes_out","started_at"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Cumulative inbound bytes for this session."},"bytes_out":{"type":"integer","format":"int64","description":"Cumulative outbound bytes for this session."},"id":{"type":"string","description":"`client_connections.id`."},"server_id":{"type":["string","null"],"description":"Hub server the session terminated on (NULL when deleted)."},"started_at":{"type":"string","description":"RFC3339 instant the session opened."},"tunnel_id":{"type":["string","null"],"description":"The tunnel the session uses (NULL when the connection is\norphaned from a deleted tunnel)."}}},"DeviceCreateRequest":{"type":"object","description":"`POST /devices` request — a customer enrolls one client device into\ntheir own org. `platform` / `device_type` are validated against the\nshipped CHECK domains in the handler (fail-fast 400 before any DB\nwork) so the constraint is never reached on bad input.","required":["device_name","platform","device_type"],"properties":{"capabilities":{"type":"array","items":{"type":"string"},"description":"Capability slugs the device offers at join\n(negotiation). The handler keeps the recognised subset — offered\n∩ the [`ClientCapability`](crate::platform::iam::principal::ClientCapability)\ncatalog — and persists it to `client_devices.capabilities`.\nUnrecognised slugs are dropped, not 422'd: the read path\n(`parse_client_capabilities`) and the `agents.capabilities`\nprecedent the `0023` migration cites both drop unknowns, so a\nnewer device offering a slug an older control-plane has not\nlearned yet is forward-compatible. Omitted ⇒ empty (back-compat\nwith pre-I-10 clients; the column keeps its `'[]'` default).\nBounded to 16 entries to cap input before the catalog filter."},"device_name":{"type":"string","description":"Human label, unique within the org (the `UNIQUE (org_id,\ndevice_name)` constraint). 1..=128 chars."},"device_type":{"type":"string","description":"One of [`ALLOWED_DEVICE_TYPES`]."},"platform":{"type":"string","description":"One of [`ALLOWED_PLATFORMS`]."}},"additionalProperties":false},"DeviceCreateResponse":{"allOf":[{"$ref":"#/components/schemas/DeviceRead","description":"The enrolled device."},{"type":"object","required":["agent_key"],"properties":{"agent_key":{"type":"string","description":"One-time plaintext bearer (`cdv_…`). Not recoverable later."}}}],"description":"`POST /devices` response (201). Carries the one-time `cdv_` bearer\nin `agent_key` — it is shown exactly once and stored nowhere (only\nits SHA-256(+pepper) hash lands in `client_devices.agent_key_hash`)."},"DeviceDeleteResponse":{"allOf":[{"$ref":"#/components/schemas/DeviceRead","description":"The revoked device."},{"type":"object","required":["connections_closed"],"properties":{"connections_closed":{"type":"integer","format":"int64","description":"Number of open `client_connections` rows the handler closed\n(set `ended_at` + `ended_reason = 'revoked'`). 0 when the\ndevice had no active session at delete time."}}}],"description":"Response body for `DELETE /devices/{id}`. The device record\nafter the transition to `status = 'revoked'`, plus a count of\nactive sessions the server closed on the way (the customer-side\nsurface that `client_connections.ended_reason = 'revoked'`\nreflects)."},"DeviceDetail":{"type":"object","description":"`GET /devices/{id}` response — full per-device projection: policy\ncolumns, the latest open connection, and the device's services +\nsubnet routes (both org-public to org members; the device-detail\npage is the customer's single view).","required":["id","org_id","user_id","device_name","platform","device_type","status","always_on","kill_switch","trusted_networks","services","subnet_routes","joined_at","created_at","updated_at"],"properties":{"always_on":{"type":"integer","format":"int64","description":"`always_on` policy (0 / 1)."},"created_at":{"type":"string","description":"RFC3339 row-create instant."},"current_connection":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/DeviceConnectionSummary","description":"Open connection summary, or null when offline."}]},"device_name":{"type":"string","description":"Human label."},"device_type":{"type":"string","description":"Device class."},"id":{"type":"string","description":"`client_devices.id` (UUIDv7)."},"joined_at":{"type":"string","description":"RFC3339 enrolment instant."},"kill_switch":{"type":"integer","format":"int64","description":"`kill_switch` policy (0 / 1)."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 last-heartbeat instant."},"org_id":{"type":"string","description":"Owning org."},"platform":{"type":"string","description":"Reported platform."},"services":{"type":"array","items":{"$ref":"#/components/schemas/DeviceServiceRead"},"description":"Exposed services advertised by the device."},"status":{"type":"string","description":"`joined` / `paused` / `revoked`."},"subnet_routes":{"type":"array","items":{"$ref":"#/components/schemas/DeviceSubnetRouteRead"},"description":"Subnet routes the device advertises."},"trusted_networks":{"type":"string","description":"JSON-encoded list of SSIDs / network names treated as trusted."},"tunnel_ip":{"type":["string","null"],"description":"In-mesh tunnel IP (NULL until W's `/client/join` allocates)."},"updated_at":{"type":"string","description":"RFC3339 row-update instant."},"user_id":{"type":"string","description":"Owning user."}}},"DeviceDisconnectResponse":{"type":"object","description":"Response body for `POST /devices/{id}/disconnect`. The handler\nrecords the operator intent (audit row +, once the W client-agent\nWS surface lands, a `disconnect_requested` event pushed to the\ndevice). 202 Accepted on the success path.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"DeviceLinkStartRequest":{"type":"object","description":"Optional request body for `POST /auth/device-link/start`.","properties":{"org_id":{"type":["string","null"],"format":"uuid","description":"The org the linked device joins. Defaults to the user's default\norg. The user must be a member holding `devices:device:create`\nthere."}}},"DeviceLinkStartResponse":{"type":"object","description":"Response body for `POST /auth/device-link/start`. The dashboard\nwizard renders `code` for the user to type into the CLI/app;\n`expires_in` drives the wizard's countdown.","required":["code","expires_in"],"properties":{"code":{"type":"string","description":"Short human-typed link code, canonical `XXXX-XXXX` form\n(8 base32 chars + midpoint hyphen). Single-use; redeemed by\n`POST /auth/device-link/verify` within `expires_in` seconds."},"expires_in":{"type":"integer","format":"int64","description":"Seconds until the code expires. Matches\n`device_link_tokens.expires_at - created_at` (5 minutes)."}}},"DeviceLinkVerifyRequest":{"type":"object","description":"Request body for `POST /auth/device-link/verify` — the CLI/app\nredeems the code the user typed. Anonymous; the code is the\ncredential. The server is tolerant of case + dash formatting\n(the user might type `qwxy-abcd` or `QWXYABCD`).","required":["code","device_metadata"],"properties":{"code":{"type":"string","description":"The human-typed code from the dashboard wizard. Free-form\nlength 8..=16 — the server normalises (case-fold uppercase,\nstrip non-alnum) before lookup, so any form the user might\ntype resolves to the canonical `XXXX-XXXX` shape."},"device_metadata":{"$ref":"#/components/schemas/DeviceMetadataInput","description":"What the redeeming device says about itself — becomes the\n`client_devices` row's name / platform / type, exactly as the\nRFC 8628 token-poll provisioning path stores it."}}},"DeviceLinkVerifyResponse":{"type":"object","description":"Response body for `POST /auth/device-link/verify` on the success\npath. Same shape as `OauthDeviceTokenResponse` / `ClientJoinResponse`\nso the device-side client handles every join path through one\ndeserialiser. The `cdv_…` bearer is returned EXACTLY ONCE here;\nthe server stores only its hash.","required":["device_id","bearer_token","org_id"],"properties":{"bearer_token":{"type":"string","description":"Bearer plaintext (`cdv_<base64url>`) the daemon presents in\n`Authorization: Bearer …` for every future request. Stored\nserver-side only as `client_devices.agent_key_hash` (SHA-256 +\npepper); the plaintext is never recoverable."},"device_id":{"type":"string","description":"UUIDv7 of the `client_devices` row the handler created in the\nsame transaction as the consume."},"org_id":{"type":"string","description":"The org the new device joined under (the minting user's\ndefault org at verify time)."},"org_slug":{"type":["string","null"],"description":"Owning org's slug, when one is configured. Mirrors\n`ClientJoinResponse.org_slug` so the device-side CLI writes\nthe same on-disk `ClientConfig` shape every join path\nproduces. `None` when `orgs.slug` is NULL (pre-trigger rows;\nmodern signups always have one via the personal-org trigger)."}}},"DeviceListItem":{"type":"object","description":"One row in the caller's device list. Optional `tunnel_ip` and\n`last_seen_at` reflect the columns' NULL semantics; `trusted_networks`\nis stored as a JSON-encoded array string and projected verbatim.","required":["id","org_id","user_id","device_name","platform","device_type","status","always_on","kill_switch","trusted_networks","joined_at","created_at","updated_at"],"properties":{"always_on":{"type":"integer","format":"int64","description":"`always_on` policy (0 / 1)."},"created_at":{"type":"string","description":"RFC3339 row-create instant."},"current_connection":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/DeviceConnectionSummary","description":"Current open connection summary (NULL when no active session)."}]},"device_name":{"type":"string","description":"Human label."},"device_type":{"type":"string","description":"Device class."},"id":{"type":"string","description":"`client_devices.id` (UUIDv7)."},"joined_at":{"type":"string","description":"RFC3339 enrolment instant."},"kill_switch":{"type":"integer","format":"int64","description":"`kill_switch` policy (0 / 1)."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 instant of the last heartbeat (NULL until first ping)."},"org_id":{"type":"string","description":"Owning org."},"platform":{"type":"string","description":"Reported platform."},"status":{"type":"string","description":"`joined` / `paused` / `revoked`."},"trusted_networks":{"type":"string","description":"JSON-encoded list of SSIDs / network names treated as trusted."},"tunnel_ip":{"type":["string","null"],"description":"In-mesh tunnel IP (NULL until W's `/client/join` allocates one)."},"updated_at":{"type":"string","description":"RFC3339 row-update instant."},"user_id":{"type":"string","description":"Owning user (the enroller)."}}},"DeviceListResponse":{"type":"object","description":"Response body for `GET /devices`.","required":["devices"],"properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/DeviceListItem"},"description":"Page of device records, ordered `created_at DESC, id DESC`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` when exhausted."}}},"DeviceMetadataInput":{"type":"object","description":"What the device sends about itself in the initiate request so\nthe dashboard's approval page can show \"approve this Linux\nlaptop named `<hostname>`.\" Stored as JSON in\n`oauth_device_codes.device_metadata`.","required":["hostname","platform","device_type"],"properties":{"device_type":{"type":"string","description":"One of [`ALLOWED_OAUTH_DEVICE_TYPES`]. Same shape as\n`platform` above."},"hostname":{"type":"string","description":"Device hostname (1..=255 chars). Free-form — the dashboard\nrenders it verbatim. The validator only bounds the length so\nthe column has a finite size; format checks (e.g. no\n`[<>]`) are not run because that's a frontend rendering\nconcern, not a stored-data concern."},"platform":{"type":"string","description":"One of [`ALLOWED_OAUTH_DEVICE_PLATFORMS`]. The string is\nvalidated by the handler against the slice (the migration's\nCHECK constraint on `client_devices.platform` is the\ndownstream gate when PR14b's approve handler inserts the\n`client_devices` row from this metadata)."}}},"DevicePatchRequest":{"type":"object","description":"`PATCH /devices/{id}` request — every field optional. Absent fields\nleave the corresponding column unchanged. Validated server-side\nbefore any write.","properties":{"always_on":{"type":["integer","null"],"format":"int64","description":"Flip `always_on` (must be 0 or 1; CHECK domain mirrored here)."},"client_request_timeout_seconds":{"type":["integer","null"],"format":"int64","description":"Set the per-device control-plane HTTP request timeout in whole\nseconds (`client_devices.client_request_timeout_seconds`).\nBounded `[1, 3600]`; the daemon keeps its built-in default while\nthis stays unset (`null`)."},"device_name":{"type":["string","null"],"description":"Rename. Collision-checked against `UNIQUE (org_id, device_name)`\n— clash ⇒ `409 device_name_taken` (magic-DNS uniqueness)."},"kill_switch":{"type":["integer","null"],"format":"int64","description":"Flip `kill_switch` (0 or 1)."},"trusted_networks":{"type":["array","null"],"items":{"type":"string"},"description":"Replace `trusted_networks`. JSON-encoded list of strings;\nhandler validates the structure before writing."}}},"DevicePolicyBlock":{"type":"object","description":"The org-wide device-compliance policy block injected into\n[`ClientConfigBlock`] (F-SEC3). Mirrors\n`platform::iam::org_device_policy_types::OrgDevicePolicyRead`\nminus the org-identifying / bookkeeping fields (`org_id`,\n`updated_at`) the daemon has no use for — the device already\nknows its own org, and the policy's own change is what flips the\ncarrying endpoint's ETag.","required":["require_disk_encryption","require_screen_lock","enforcement_mode"],"properties":{"enforcement_mode":{"type":"string","description":"`report` (surface non-compliance locally, never block) or\n`block` (refuse to bring the tunnel up while any required\nattribute is unmet)."},"min_os_version":{"type":["string","null"],"description":"Minimum daemon/OS version string the device must report, or\n`None` when the org sets no floor."},"require_disk_encryption":{"type":"boolean","description":"The device must attest full-disk encryption."},"require_screen_lock":{"type":"boolean","description":"The device must attest an active screen-lock policy."}}},"DevicePostureCompliance":{"type":"object","description":"One device's compliance projection.","required":["device_id","device_name","platform","status","compliant","checks"],"properties":{"checks":{"type":"array","items":{"$ref":"#/components/schemas/PostureCheckResult"},"description":"Per-dimension verdicts; only dimensions the policy requires\nare present."},"compliant":{"type":"boolean","description":"`true` iff every check below is `Pass` (a policy with no\nrequirements produces zero checks, so every device is\ntrivially compliant)."},"device_id":{"type":"string","description":"`client_devices.id`."},"device_name":{"type":"string","description":"`client_devices.device_name`."},"platform":{"type":"string","description":"`client_devices.platform` (`linux`, `macos`, `windows`, `ios`,\n`android`, `headless`)."},"posture_reported_at":{"type":["string","null"],"description":"RFC3339 timestamp of the device's most recent posture-bearing\nheartbeat, or `None` if it has never reported any posture\nfield."},"status":{"type":"string","description":"`client_devices.status` (`joined` or `paused` — a `revoked`\ndevice is excluded from this projection entirely)."}}},"DeviceRead":{"type":"object","description":"One `client_devices` row as the customer sees it. The\n`agent_key_hash` is never exposed; the plaintext bearer is returned\nexactly once, only by [`DeviceCreateResponse`].","required":["id","org_id","user_id","device_name","platform","device_type","status","joined_at","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 row-create instant."},"device_name":{"type":"string","description":"Human label."},"device_type":{"type":"string","description":"Device class."},"id":{"type":"string","description":"`client_devices.id` (UUIDv7)."},"joined_at":{"type":"string","description":"RFC3339 enrolment instant."},"org_id":{"type":"string","description":"Owning org."},"platform":{"type":"string","description":"Reported platform."},"status":{"type":"string","description":"`joined` / `paused` / `revoked`."},"updated_at":{"type":"string","description":"RFC3339 last-update instant."},"user_id":{"type":"string","description":"Owning user (the enrolling principal)."}}},"DeviceRevokeResponse":{"allOf":[{"$ref":"#/components/schemas/DeviceRead","description":"The revoked device."}],"description":"`POST /devices/{id}/revoke` response — the device row after the\ntransition to `status = 'revoked'`."},"DeviceRow":{"type":"object","description":"One client device.","required":["id","device_name","org_id","status"],"properties":{"device_name":{"type":"string","description":"Name."},"id":{"type":"string","description":"Device id."},"org_id":{"type":"string","description":"Org it joined under."},"status":{"type":"string","description":"Status."}}},"DeviceServiceCreateRequest":{"type":"object","description":"`POST /devices/{id}/services` request body. The device id is captured\nfrom the path, so the body holds only the per-service fields.","required":["service_name","protocol","port"],"properties":{"port":{"type":"integer","format":"int64","description":"Port number; `1..=65535` matches the CHECK in `device_services`."},"protocol":{"type":"string","description":"Either `tcp` or `udp`. The handler enforces the enum at the\nboundary (returns `400 invalid_protocol` on anything else); the\nschema's `CHECK (protocol IN ('tcp','udp'))` is the structural\nbackstop."},"service_name":{"type":"string","description":"Human label for the service (e.g. `\"ssh\"`, `\"web\"`)."}}},"DeviceServiceDeleteResponse":{"type":"object","description":"`DELETE /devices/{id}/services/{svc_id}` response. The endpoint returns\na small confirmation body so OpenAPI can declare a typed 200 (matching\nthe project's other DELETE handlers — e.g. `agents_retire`).","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"`true` on success."},"id":{"type":"string","description":"The `device_services.id` that was removed (echoed for client\nreconciliation; the row is gone after this returns)."}}},"DeviceServiceListResponse":{"type":"object","description":"`GET /devices/{id}/services` response — every service declared on the\ndevice, visible to any member of the device's org. Ordered\ndeterministically: by protocol then port (the same order used by\n`devices_get`'s embedded `services` projection).","required":["services"],"properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/DeviceServiceRead"},"description":"Service rows for the addressed device."}}},"DeviceServiceRead":{"type":"object","description":"One `device_services` row.","required":["id","service_name","protocol","port","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 row-create instant."},"id":{"type":"string","description":"`device_services.id` (UUIDv7)."},"port":{"type":"integer","format":"int64","description":"Port number (1..=65535)."},"protocol":{"type":"string","description":"`tcp` or `udp`."},"service_name":{"type":"string","description":"Human label for the service."}}},"DeviceSubnetRouteApproveResponse":{"type":"object","description":"`POST /platform/devices/{id}/subnet-routes/{route_id}/approve`\nresponse — the freshly-approved route, with `approved_at` and\n`approved_by_user_id` populated.","required":["route"],"properties":{"route":{"$ref":"#/components/schemas/DeviceSubnetRouteRead","description":"The approved route's full projection."}}},"DeviceSubnetRouteCreateRequest":{"type":"object","description":"`POST /devices/{id}/subnet-routes` request body. The device id is\ncaptured from the path; the body holds only the per-route fields.","required":["cidr"],"properties":{"cidr":{"type":"string","description":"IPv4 or IPv6 CIDR. Length-validated at the boundary (the handler\nadditionally checks that it parses as `ipnetwork::IpNetwork`)."}}},"DeviceSubnetRouteDeleteResponse":{"type":"object","description":"`DELETE /devices/{id}/subnet-routes/{route_id}` response. Mirrors the\n`DeviceServiceDeleteResponse` shape so OpenAPI can declare a typed 200.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"`true` on success."},"id":{"type":"string","description":"The `device_subnet_routes.id` that was removed."}}},"DeviceSubnetRouteListResponse":{"type":"object","description":"`GET /devices/{id}/subnet-routes` response — every route declared on\nthe device, visible to any member of the device's org.","required":["subnet_routes"],"properties":{"subnet_routes":{"type":"array","items":{"$ref":"#/components/schemas/DeviceSubnetRouteRead"},"description":"Route rows for the addressed device."}}},"DeviceSubnetRouteRead":{"type":"object","description":"One `device_subnet_routes` row.","required":["id","cidr","advertised_at"],"properties":{"advertised_at":{"type":"string","description":"RFC3339 instant the device advertised the route."},"approved_at":{"type":["string","null"],"description":"RFC3339 instant of admin approval (NULL until approved)."},"approved_by_user_id":{"type":["string","null"],"description":"User who approved (NULL until approved)."},"cidr":{"type":"string","description":"Advertised CIDR."},"id":{"type":"string","description":"`device_subnet_routes.id` (UUIDv7)."}}},"DeviceVersionPinRequest":{"type":"object","description":"Request body for `PATCH /platform/devices/{id}/version` — the\nper-device manual pin that beats any rollout wave.","required":["expected_version"],"properties":{"expected_version":{"type":"string","description":"Version to pin; must be an allowlisted\n`release_versions(component='client')` row. Empty string clears\nthe pin (NULL), returning the device to rollout-cohort\neligibility (the `agents_patch` empty-string-clears convention)."}}},"DeviceVersionPinResponse":{"type":"object","description":"Response body for `PATCH /platform/devices/{id}/version`.","required":["id","updated_at"],"properties":{"expected_version":{"type":["string","null"],"description":"The pin after the write; `null` when cleared."},"id":{"type":"string","description":"The device id."},"updated_at":{"type":"string","description":"RFC3339 instant of the write."}}},"DnsAgentAssignmentRead":{"type":"object","description":"One assignment row the resolver must serve. Scoped to the\nauth'd agent's `dns_servers` ownership (the SELECT predicate is\nthe source of truth — see [`super::assignments_get`]).","required":["id","subscription_id","created_at","updated_at"],"properties":{"allowed_source_cidr":{"type":["string","null"],"description":"Source clamp the resolver enforces on answers for this\nassignment. Joined from `wireguard_tunnels.allocated_ip`\nrendered as a `/32` host CIDR (WG allocations are single\nIPv4 hosts — same convention as\n`products::vpn::tunnels_config`). `null` when the\nassignment is subscription-wide (`tunnel_id IS NULL`) or\nthe tunnel is not a WireGuard tunnel, in which case the\nresolver does not source-clamp."},"created_at":{"type":"string","format":"date-time","description":"RFC3339 creation timestamp (`dns_assignments.created_at`)."},"filter_list_id":{"type":["string","null"],"description":"Active filter list (`dns_assignments.filter_list_id`).\n`null` ⇒ the resolver runs unfiltered for this assignment.\nThe matching entry set is streamed\n(`GET /dns_agent/filter-lists/{id}/entries`)."},"id":{"type":"string","description":"`dns_assignments.id` (UUIDv7). Stable handle the resolver\nuses to diff its local view against successive polls."},"subscription_id":{"type":"string","description":"Parent subscription (`dns_assignments.subscription_id`).\nThe resolver tags query-log telemetry with this so the\nupload attributes usage to the right tenant."},"tunnel_id":{"type":["string","null"],"description":"Per-tunnel scope (`dns_assignments.tunnel_id`). `null` ⇒\nthe assignment is subscription-wide."},"updated_at":{"type":"string","format":"date-time","description":"RFC3339 last-updated timestamp\n(`dns_assignments.updated_at`). Any change here flips the\nresponse ETag and cuts a pending long-poll short."}}},"DnsAgentAssignmentsResponse":{"type":"object","description":"Response shape for `GET /dns_agent/assignments`. The\n`assignments` array is `[]` when the auth'd agent's\n`dns_servers` rows have no assignments.","required":["assignments","server_time"],"properties":{"assignments":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentAssignmentRead"},"description":"Zero or more assignment rows scoped to the auth'd agent's\n`dns_servers` ownership. Order is stable — `(id ASC)` — so\nthe SHA-256 ETag computed on the handler side is\nbyte-deterministic for a given assignment set."},"server_time":{"type":"string","format":"date-time","description":"Server-derived \"now\" for the resolver's metrics. RFC3339\nwire form."}}},"DnsAgentConfigRead":{"type":"object","description":"Read shape for `GET /dns_agent/config`. Versioned, ETag-cacheable\n— the DNS agent sends `If-None-Match: <version>`; 304 if\nunchanged. Lets ops roll a config tweak to every resolver node\nin one shot by bumping the build-time `version` constant (the\nhandler renders it from a constant baked into the binary).\n\nEvery timing knob carries the `_seconds` suffix so the units are\nunambiguous on the wire (precedent:\n[`super::super::agents::agent_join_types::AgentJoinConfig::heartbeat_interval_seconds`]).\nThe agent's poll loop applies these values directly without\nunit-conversion logic.\n\n`version` is opaque to the agent — the agent feeds it back\nthrough `If-None-Match` verbatim on the next poll. The\nhandler renders it as a plain `String` so no parsing layer\nstands between the wire and the ETag header.\n\n`allowed_zones` is the set of DNS zone suffixes this deployment\npermits the resolver to answer authoritatively / via magic-DNS\nfor. It is a list so a future deployment can add\na second internal zone without an agent rebuild; an empty list\nmeans recursion-only (no authoritative serving). Order is\nsignificant only as a stable rendering — the agent treats it as\na set.","required":["version","heartbeat_interval_seconds","log_batch_seconds","max_log_batch","allowed_zones"],"properties":{"allowed_zones":{"type":"array","items":{"type":"string"},"description":"DNS zone suffixes this deployment permits the resolver to\nanswer for beyond plain recursion (magic-DNS / future\nauthoritative serving). Empty list ⇒ recursion-only. The\nagent treats the list as a set; the rendering order is\nstable but not semantically ordered."},"heartbeat_interval_seconds":{"type":"integer","format":"int64","description":"Interval, in seconds, between agent posts to\n`POST /dns_agent/heartbeat`. Default 30 s."},"log_batch_seconds":{"type":"integer","format":"int64","description":"Interval, in seconds, between batched\n`POST /dns_agent/query-log` uploads. The agent\naccumulates query-log rows for this long, then flushes the\nbatch. Default 5 s."},"max_log_batch":{"type":"integer","format":"int64","description":"Maximum number of query-log rows the agent may send in one\n`POST /dns_agent/query-log` call. The handler rejects a\nbatch larger than this (pins the cap at 1000).\nA count, not a duration — no `_seconds` suffix."},"version":{"type":"string","description":"Opaque version tag. Bumped by ops when any other field in\nthis struct changes; the agent treats it as the ETag value\nfor the next poll's `If-None-Match` header. Renders it\nfrom a build-time constant baked into the binary."}}},"DnsAgentFilterListEntriesResponse":{"type":"object","description":"Response shape for `GET /dns_agent/filter-lists/{id}/entries`.\n`entries` is `[]` when the list has no rows at or after the\ncursor; `next_cursor` is `null` on the last page.","required":["entries"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentFilterListEntryRead"},"description":"One page of entries, ordered by\n`dns_filter_entries.id ASC` (UUIDv7, stable + deterministic)."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."}}},"DnsAgentFilterListEntryRead":{"type":"object","description":"One filter rule the resolver must apply. Sourced from a\n`dns_filter_entries` row; the internal `id` / `filter_list_id` /\n`created_at` columns are intentionally dropped — the resolver\nmatches on `domain` and does not need control-plane bookkeeping.","required":["domain","action"],"properties":{"action":{"type":"string","description":"What the resolver does on a match\n(`dns_filter_entries.action`): `block`, `sinkhole`,\n`rewrite`, or `allow`."},"domain":{"type":"string","description":"The domain this rule matches (`dns_filter_entries.domain`)."},"rewrite_to":{"type":["string","null"],"description":"The target the resolver answers with when\n`action = \"rewrite\"` (`dns_filter_entries.rewrite_to`).\n`null` for `block` / `sinkhole` / `allow` entries."}}},"DnsAgentFilterListRead":{"type":"object","description":"One filter list the resolver must keep synced. Scoped to the\nauth'd agent's `dns_servers` ownership (the SELECT predicate is\nthe source of truth — see [`super::filter_lists_get`]).","required":["id","slug","entries_url"],"properties":{"entries_url":{"type":"string","description":"Relative path the resolver appends to its API base to\nstream this list's entry set\n(`GET /dns_agent/filter-lists/{id}/entries`). Entry sets are\nnot inlined here — a single list can be hundreds of\nthousands of rows."},"id":{"type":"string","description":"`dns_filter_lists.id` (UUIDv7). Stable handle the resolver\nuses to diff its local set against successive polls and to\naddress the entry stream."},"last_synced_at":{"type":["string","null"],"format":"date-time","description":"Last time the control plane refreshed this list from\n`source_url` (`dns_filter_lists.last_synced_at`). RFC3339\nwire form; `null` when the list has never been synced."},"slug":{"type":"string","description":"Stable slug (`dns_filter_lists.slug`). Distinct per list;\nthe resolver may key its on-disk cache by this."},"source_url":{"type":["string","null"],"description":"Upstream source the list is synced from\n(`dns_filter_lists.source_url`). `null` for a list curated\ndirectly in the control plane (no external source)."}}},"DnsAgentFilterListsResponse":{"type":"object","description":"Response shape for `GET /dns_agent/filter-lists`. The\n`filter_lists` array is `[]` when the auth'd agent's\n`dns_servers` rows have no assignments referencing a filter\nlist.","required":["filter_lists","server_time"],"properties":{"filter_lists":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentFilterListRead"},"description":"Zero or more distinct filter lists scoped to the auth'd\nagent's `dns_servers` ownership. Order is stable —\n`(id ASC)` — so a resolver diffing successive polls sees a\ndeterministic ordering."},"server_time":{"type":"string","format":"date-time","description":"Server-derived \"now\" for the resolver's sync metrics.\nRFC3339 wire form."}}},"DnsAgentInfraRecord":{"type":"object","description":"One record on the agent sync surface — the lean projection a\nresolver compiles into its exact-name override map.","required":["name","record_type","value","ttl"],"properties":{"name":{"type":"string","description":"Exact FQDN (lowercased, no trailing dot)."},"record_type":{"type":"string","description":"`A` or `AAAA`."},"ttl":{"type":"integer","format":"int64","description":"Answer TTL in seconds."},"value":{"type":"string","description":"IP address the name resolves to."}}},"DnsAgentInfraRecordsResponse":{"type":"object","description":"Response for `GET /dns_agent/infra-records` — every active infra\nrecord plus the server clock (parity with the other agent sync\nreads).","required":["records","server_time"],"properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentInfraRecord"},"description":"Every active infra record, `(name, record_type)` ordered."},"server_time":{"type":"string","format":"date-time","description":"Server wall-clock at read time (RFC3339)."}}},"DnsAgentNetPolicyDomainRule":{"type":"object","description":"One ordered domain rule for a tunnel: match the domain (label-boundary,\nsubdomain-inclusive) and apply the verdict.","required":["domain","verdict"],"properties":{"domain":{"type":"string","description":"Lowercase hostname the rule matches, subdomain-inclusive\n(`example.com` covers `ads.example.com`). Already validated by the\npolicy write boundary; category endpoints arrive pre-expanded to\ntheir member domains."},"verdict":{"type":"string","description":"`\"allow\" | \"deny\"`. The first rule matching a query name decides:\n`deny` answers `NXDOMAIN`, `allow` resolves normally (an explicit\nexception above a later, broader deny)."}}},"DnsAgentNetPolicyDomainsResponse":{"type":"object","description":"Response body for the net-policy domain-rule poll.","required":["tunnels","server_time"],"properties":{"server_time":{"type":"string","format":"date-time","description":"Server wall-clock at assembly (RFC3339)."},"tunnels":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentNetPolicyTunnelRules"},"description":"One entry per tunnel that both resolves through the requesting\nagent and carries at least one domain/category policy rule."}}},"DnsAgentNetPolicyTunnelRules":{"type":"object","description":"The ordered rule set for one tunnel (the resolver's attribution key).","required":["tunnel_id","rules"],"properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentNetPolicyDomainRule"},"description":"Rules in plan evaluation order; first match wins."},"tunnel_id":{"type":"string","description":"`tunnels.id` the rules govern — matched against the query's\nsource-IP attribution."}}},"DnsAgentZoneDnssecKeyRead":{"type":"object","description":"One ACTIVE DNSSEC signing key of a zone, as distributed to the\nauthoritative agent fleet by\n`GET /dns_agent/zones/{zone_id}/dnssec-keys` (Q-AUTH stage 4 —\nonline signing happens agent-side with the per-zone keys).\n\n`private_key_seed` is the base64 of the AEAD-unsealed raw 32-byte\ned25519 seed. It crosses ONLY this mutually-authenticated machine\nsurface (FleetAgent bearer, `dns` capability) so the agent can\nsign RRsets online; the agent holds it in memory only and never\npersists it. This is the single deliberate exception to \"the\nprivate key never leaves the control plane\" — without it there is\nno online signing at the edge. The manual `Debug` impl redacts\nthe seed so the shape can never leak it through a log line.","required":["key_kind","algorithm","public_key","private_key_seed","created_at"],"properties":{"algorithm":{"type":"string","description":"DNSSEC algorithm — `ed25519` (RFC 8080, algorithm 15)."},"created_at":{"type":"string","format":"date-time","description":"RFC3339 key-creation timestamp\n(`dns_zone_dnssec_keys.created_at`)."},"key_kind":{"type":"string","description":"`ksk` (key-signing) or `zsk` (zone-signing)."},"private_key_seed":{"type":"string","description":"Base64 of the raw 32-byte private seed. Machine-surface-only;\nnever rendered by `Debug`, never persisted agent-side."},"public_key":{"type":"string","description":"Base64 of the 32-byte public key (the DNSKEY rdata payload)."}}},"DnsAgentZoneDnssecKeysResponse":{"type":"object","description":"Response shape for `GET /dns_agent/zones/{zone_id}/dnssec-keys`:\nevery ACTIVE key row of one dnssec-enabled zone (one `ksk`, one\n`zsk` in steady state; rotation windows may briefly widen the\nset).","required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentZoneDnssecKeyRead"},"description":"The zone's active signing keys, `key_kind ASC` (`ksk` before\n`zsk`) for a deterministic wire order."}}},"DnsAgentZoneRead":{"type":"object","description":"One authoritative zone the agent must serve. Present iff the\nowning org holds a live subscription (`status IN ('active',\n'grace')` — the platform's canonical live-subscription\npredicate); a suspended customer's zone drops out of the roster\non the agent's next poll. NO key material and NO record values\nride this shape.","required":["id","name","serial","refresh","retry","expire","minimum_ttl","primary_ns","contact_email","dnssec_enabled","record_count","updated_at"],"properties":{"contact_email":{"type":"string","description":"SOA RNAME source (`dns_zones.contact_email`), rendered into\nthe mailbox form by the agent when it serves SOA."},"dnssec_enabled":{"type":"boolean","description":"Whether the zone is DNSSEC-signed\n(`dns_zones.dnssec_enabled`). Signing happens control-plane\nside; the agent never receives key material on this surface."},"expire":{"type":"integer","format":"int64","description":"SOA expire bound in seconds (`dns_zones.expire`)."},"id":{"type":"string","description":"`dns_zones.id` (UUIDv7). Stable handle the agent uses to\ndiff its local view and to page the record-transfer sibling\n(`GET /dns_agent/zones/{zone_id}/records`)."},"minimum_ttl":{"type":"integer","format":"int64","description":"SOA minimum / negative-caching TTL in seconds\n(`dns_zones.minimum_ttl`)."},"name":{"type":"string","description":"Zone apex (`dns_zones.name`), e.g. `example.com`."},"primary_ns":{"type":"string","description":"SOA MNAME (`dns_zones.primary_ns`), e.g. `ns1.appsynergy.io`."},"record_count":{"type":"integer","format":"int64","description":"Number of `dns_records` rows currently in the zone. Lets the\nagent sanity-check a completed record transfer against the\nroster snapshot it paged from."},"refresh":{"type":"integer","format":"int64","description":"SOA refresh interval in seconds (`dns_zones.refresh`)."},"retry":{"type":"integer","format":"int64","description":"SOA retry interval in seconds (`dns_zones.retry`)."},"serial":{"type":"integer","format":"int64","description":"SOA serial (`dns_zones.serial`). Bumped by every record\nwrite and by force-resign, so a changed serial flips the\nroster ETag and cuts a pending long-poll short — the agent's\nsignal to re-pull the zone's records."},"updated_at":{"type":"string","format":"date-time","description":"RFC3339 last-updated timestamp (`dns_zones.updated_at`). In\nthe ETag canonical form, so any zone edit flips the digest\nand cuts a pending long-poll short."}}},"DnsAgentZoneRecordRead":{"type":"object","description":"One `dns_records` row the agent must serve. The owning\n`zone_id` is the path parameter and `created_at` is not\nserving-relevant, so neither rides the wire.","required":["id","name","record_type","value","ttl","updated_at"],"properties":{"id":{"type":"string","description":"`dns_records.id` (UUIDv7). Stable handle the agent uses to\ndiff successive transfers; also the cursor key (echoed only\nthrough the opaque `next_cursor`)."},"name":{"type":"string","description":"Record name relative to the zone apex\n(`dns_records.name`); `@` for the apex itself."},"port":{"type":["integer","null"],"format":"int64","description":"Optional port (`dns_records.port`; SRV only, 0..65535,\n`null` otherwise)."},"priority":{"type":["integer","null"],"format":"int64","description":"Optional priority (`dns_records.priority`; MX / SRV only,\n`null` otherwise)."},"record_type":{"type":"string","description":"DNS record type (`dns_records.record_type`) — one of `A`,\n`AAAA`, `CNAME`, `MX`, `TXT`, `SRV`, `NS`, `SOA`, `CAA`,\n`PTR`, `ALIAS`."},"ttl":{"type":"integer","format":"int64","description":"Record TTL in seconds (`dns_records.ttl`)."},"updated_at":{"type":"string","format":"date-time","description":"RFC3339 last-updated timestamp (`dns_records.updated_at`)."},"value":{"type":"string","description":"Record rdata as a string (`dns_records.value`). The exact\nformat is record-type dependent."},"weight":{"type":["integer","null"],"format":"int64","description":"Optional weight (`dns_records.weight`; SRV only, `null`\notherwise)."}}},"DnsAgentZoneRecordsResponse":{"type":"object","description":"Response shape for `GET /dns_agent/zones/{zone_id}/records`.\n`records` is `[]` when the zone has no rows at or after the\ncursor; `next_cursor` is `null` on the last page.","required":["records"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."},"records":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentZoneRecordRead"},"description":"One page of records, ordered by `dns_records.id ASC`\n(UUIDv7, stable + deterministic)."}}},"DnsAgentZonesResponse":{"type":"object","description":"Response shape for `GET /dns_agent/zones`. The `zones` array is\n`[]` when no org with a live subscription owns a zone.","required":["zones","server_time"],"properties":{"server_time":{"type":"string","format":"date-time","description":"Server-derived \"now\" for the agent's metrics. RFC3339 wire\nform (same contract as the assignments read)."},"zones":{"type":"array","items":{"$ref":"#/components/schemas/DnsAgentZoneRead"},"description":"Zero or more zones, every one owned by an org with a live\nsubscription. Order is stable — `(id ASC)` — so the SHA-256\nETag computed on the handler side is byte-deterministic for\na given roster."}}},"DnsAssignmentCreateRequest":{"type":"object","description":"Request body for `POST /dns/assignments`. Creates one assignment.\nThe handler validates subscription ownership, that the DNS server is\n`status = 'active'`, and (when set) that the filter list is\n`is_active = 1`. The `(subscription_id, tunnel_id, dns_server_id)`\ntuple is unique (collapsing a NULL tunnel) — a duplicate is 409.","required":["subscription_id","dns_server_id"],"properties":{"dns_server_id":{"type":"string","description":"Resolver to assign. Must be `status = 'active'`."},"filter_list_id":{"type":["string","null"],"description":"Optional filter list. Absent / `null` ⇒ unfiltered."},"subscription_id":{"type":"string","description":"Subscription to attach the assignment to. Must be owned by the\ncaller's org."},"tunnel_id":{"type":["string","null"],"description":"Optional per-tunnel scope. Absent / `null` ⇒ subscription-wide."}}},"DnsAssignmentDeleteResponse":{"type":"object","description":"Response body for `DELETE /dns/assignments/{id}`.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the 200 success path."}}},"DnsAssignmentListResponse":{"type":"object","description":"Response body for `GET /dns/assignments`.","required":["assignments"],"properties":{"assignments":{"type":"array","items":{"$ref":"#/components/schemas/DnsAssignmentRead"},"description":"Page of assignments owned by the caller's org, ordered by\n`created_at DESC, id DESC`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."}}},"DnsAssignmentRead":{"type":"object","description":"Wire shape of a `dns_assignments` row. Returned by\n`GET /dns/assignments` (list items), `GET /dns/assignments/{id}`,\n`POST /dns/assignments` (the created row), and\n`PATCH /dns/assignments/{id}` (the updated row).","required":["id","subscription_id","dns_server_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation timestamp."},"dns_server_id":{"type":"string","description":"Resolver this assignment points at (`dns_assignments.dns_server_id`)."},"filter_list_id":{"type":["string","null"],"description":"Active filter list, if any (`dns_assignments.filter_list_id`).\n`null` ⇒ resolver runs unfiltered for this assignment."},"id":{"type":"string","description":"UUIDv7 primary key (`dns_assignments.id`)."},"subscription_id":{"type":"string","description":"Parent subscription (`dns_assignments.subscription_id`)."},"tunnel_id":{"type":["string","null"],"description":"Per-tunnel scope. `null` ⇒ subscription-wide assignment."},"updated_at":{"type":"string","description":"RFC3339 last-updated timestamp."}}},"DnsAssignmentUpdateRequest":{"type":"object","description":"Request body for `PATCH /dns/assignments/{id}`. Only `filter_list_id`\nis mutable — server / scope changes require delete + create so the\nDNS agent's view stays simple. The field is always carried: a JSON\n`null` clears filtering, a value sets it.","properties":{"filter_list_id":{"type":["string","null"],"description":"New filter list, or `null` to run this assignment unfiltered.\nWhen set, must reference an `is_active = 1` list."}}},"DnsBlockedDomain":{"type":"object","description":"One entry in the top-blocked-domains breakdown.","required":["domain","blocked"],"properties":{"blocked":{"type":"integer","format":"int64","description":"How many times it was blocked in the window."},"domain":{"type":"string","description":"The blocked query name."}}},"DnsFilterListListResponse":{"type":"object","description":"Response body for `GET /dns/filter-lists`.","required":["filter_lists"],"properties":{"filter_lists":{"type":"array","items":{"$ref":"#/components/schemas/DnsFilterListRead"},"description":"Active filter lists ordered by `name ASC, id ASC`."}}},"DnsFilterListRead":{"type":"object","description":"One row in the anonymous `GET /dns/filter-lists` SKU catalog. The\ncustomer picks a list by `slug`. Only `is_active = 1` lists appear.","required":["id","name","slug"],"properties":{"description":{"type":["string","null"],"description":"Marketing / explanatory description. `null` when unset."},"id":{"type":"string","description":"`dns_filter_lists.id` primary key."},"name":{"type":"string","description":"Human-readable list display name."},"slug":{"type":"string","description":"Stable slug the customer selects by (`dns_filter_lists.slug`)."}}},"DnsHeartbeatRequest":{"type":"object","description":"Heartbeat payload posted by a DNS resolver agent at the\n`heartbeat_interval_seconds` cadence the config response\nreturned. The handler upserts liveness state onto the matching\n`dns_servers` row (keyed off [`Self::server_id`] under a\ncross-agent integrity guard — the row's `agent_id` must equal\nthe auth'd `Principal::FleetAgent`'s `agent_id`).\n\nCounter semantics — populated by the resolver against its local\nrecursive-resolver state over the last 5-minute window:\n\n- [`Self::queries_5min`] — total queries the resolver answered.\n- [`Self::blocks_5min`] — queries blocked/sinkholed/rewritten by\n  an active filter list.\n- [`Self::upstream_failures_5min`] — recursion attempts that\n  failed to resolve against the upstream root/authoritative path\n  (SERVFAIL, timeout, etc.).\n- [`Self::cache_hit_rate`] — fraction of queries served from the\n  resolver cache, in `[0.0, 1.0]`.\n- [`Self::mem_bytes`] — resident set size of the resolver\n  process in bytes.\n\nTelemetry is reported, never auto-corrected — the\nhandler appends the snapshot to a rolling blob and surfaces it\nto operator dashboards; remediation is the admin's call.","required":["server_id","agent_version","build_commit","started_at","queries_5min","blocks_5min","upstream_failures_5min","cache_hit_rate","mem_bytes"],"properties":{"agent_version":{"type":"string","description":"Semantic version of the running agent binary (`\"0.4.0\"`,\n`\"0.4.1-rc.2\"`, …). Surfaces on the rolling telemetry blob\nfor version-skew dashboards."},"blocks_5min":{"type":"integer","format":"int64","description":"Queries blocked/sinkholed/rewritten by an active filter\nlist in the trailing 5-minute window."},"build_commit":{"type":"string","description":"Git commit SHA of the running agent build. 7-64 chars\n(short or full SHA, both admitted)."},"cache_hit_rate":{"type":"number","format":"double","description":"Fraction of queries served from cache, `[0.0, 1.0]`."},"last_query_at":{"type":["string","null"],"format":"date-time","description":"Timestamp of the most recent query the resolver answered.\n`None` when the resolver has not yet served a query since\nprocess start (cold-start heartbeat)."},"mem_bytes":{"type":"integer","format":"int64","description":"Resident set size of the resolver process, in bytes."},"queries_5min":{"type":"integer","format":"int64","description":"Total queries answered in the trailing 5-minute window."},"server_id":{"type":"string","format":"uuid","description":"`dns_servers.id` for the resolver this agent is the DNS\nserver on. Cross-agent integrity check: the handler\nrefuses `409 server_mismatch` when this id resolves to a\n`dns_servers` row whose `agent_id` does not match the auth'd\n`Principal::FleetAgent`'s `agent_id`."},"started_at":{"type":"string","format":"date-time","description":"Process-start timestamp of the running resolver. Lets the\nAPI reason about resolver uptime without a separate\n`uptime_seconds` field that drifts under clock skew."},"upstream_failures_5min":{"type":"integer","format":"int64","description":"Recursion attempts that failed upstream (SERVFAIL, timeout)\nin the trailing 5-minute window."}}},"DnsHeartbeatResponse":{"type":"object","description":"Response shape for `POST /dns_agent/heartbeat`. The wire carries\none boolean acknowledgement — the agent uses it to confirm the\nAPI accepted the post; a non-200 surfaces via the standard\n[`crate::error::ApiErrorBody`] path.\n\nDeliberately minimal. Anything richer (e.g. \"your build is\nstale, please re-pull config\") rides the\n`GET /dns_agent/config` ETag channel so the heartbeat path\nstays a one-way liveness sink — same split as the routing-agent\nprecedent.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on a 200 response. The field exists so the\nwire type is non-unit (utoipa cannot describe a unit-struct\nas a JSON body) and so future variants can append without a\nshape change."}}},"DnsKey":{"type":"object","description":"Single `dns_zone_dnssec_keys` row projected to the wire. Mirrors the\nschema 1:1 minus `private_key_ct` (always omitted).","required":["id","zone_id","key_kind","algorithm","public_key","active","created_at"],"properties":{"active":{"type":"boolean","description":"`true` when this key is the active signer for its kind."},"algorithm":{"type":"string","description":"DNSSEC algorithm — always `ed25519` for now."},"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp."},"id":{"type":"string","description":"UUIDv7 primary key (`dns_zone_dnssec_keys.id`)."},"key_kind":{"type":"string","description":"`ksk` (key-signing) or `zsk` (zone-signing)."},"public_key":{"type":"string","description":"Base64-encoded DNSKEY rdata (public key bytes)."},"rotated_at":{"type":["string","null"],"description":"RFC3339 UTC rotation timestamp; `None` until the key is rotated."},"zone_id":{"type":"string","description":"Owning zone (`dns_zone_dnssec_keys.zone_id`)."}}},"DnsQueryLogEntry":{"type":"object","description":"One query-log row a DNS resolver recorded and is flushing in a\nbatch. Sourced into a `dns_query_logs` row (0013); `ts_bucket`\nis derived server-side from [`Self::ts`] (the handler is the\ntime-source-of-truth for the bucket key), and `server_id` rides\nthe [`DnsQueryLogUploadRequest`] envelope, so neither appears\nhere.\n\n`subscription_id` / `tunnel_id` / `blocked_by_list_id` are\noptional — the resolver answers recursion-only / system queries\nthat map to no subscription or tunnel, and a non-blocked answer\ncarries no blocking list. They map to the matching nullable\n`dns_query_logs` columns.","required":["ts","query_name","query_type","response_code","response_time_ms"],"properties":{"blocked_by_list_id":{"type":["string","null"],"format":"uuid","description":"Filter-list id that caused this query to be\nblocked/sinkholed/rewritten, or `None` for a non-blocked\nanswer (`dns_query_logs.blocked_by_list_id`). Denormalised\nloose pointer (no FK)."},"query_name":{"type":"string","description":"The queried name (`dns_query_logs.query_name`). Part of the\nidempotency tuple."},"query_type":{"type":"string","description":"DNS query type token (`A`, `AAAA`, `MX`, `TXT`, …)\n(`dns_query_logs.query_type`)."},"response_code":{"type":"string","description":"DNS response code token (`NOERROR`, `NXDOMAIN`, `SERVFAIL`,\n…) (`dns_query_logs.response_code`)."},"response_time_ms":{"type":"integer","format":"int64","description":"End-to-end resolve time in milliseconds\n(`dns_query_logs.response_time_ms`). Non-negative."},"subscription_id":{"type":["string","null"],"format":"uuid","description":"Subscription this query was attributed to, or `None` for a\nresolver / system query that maps to no subscription. Part\nof the idempotency tuple (NULL-collapsed via `IFNULL` in the\nUNIQUE index so a retried system-query row still dedups)."},"ts":{"type":"string","format":"date-time","description":"When the resolver answered the query. Stored verbatim in\n`dns_query_logs.ts`; the handler derives\n`dns_query_logs.ts_bucket` as the `YYYY-MM-DD` day key from\nthis value (same bucket convention as `audit` and the\nusage aggregate) so the retention-prune index stays\npopulated. Part of the idempotency tuple."},"tunnel_id":{"type":["string","null"],"format":"uuid","description":"Tunnel the query arrived on, or `None` when not\ntunnel-scoped. Denormalised loose pointer (no FK) — telemetry\nsurvives a tunnel delete."}}},"DnsQueryLogItem":{"type":"object","description":"One entry in `GET /dns/query-logs`. Sourced from `dns_query_logs`,\nscoped strictly to the caller's org. `blocked_by_list_slug` resolves\n`dns_query_logs.blocked_by_list_id` → `dns_filter_lists.slug`.","required":["ts","query_name","query_type","response_code"],"properties":{"blocked_by_list_slug":{"type":["string","null"],"description":"Slug of the filter list that blocked the query. `null` when the\nquery was not blocked."},"query_name":{"type":"string","description":"The queried name (`dns_query_logs.query_name`)."},"query_type":{"type":"string","description":"Record type, e.g. `\"A\"`, `\"AAAA\"`, `\"HTTPS\"`."},"response_code":{"type":"string","description":"DNS response code, e.g. `\"NOERROR\"`, `\"NXDOMAIN\"`."},"response_time_ms":{"type":["integer","null"],"format":"int64","description":"Server-side resolution time in milliseconds. `null` when unrecorded."},"ts":{"type":"string","description":"RFC3339 timestamp the query was answered."}}},"DnsQueryLogListResponse":{"type":"object","description":"Response body for `GET /dns/query-logs`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DnsQueryLogItem"},"description":"Page of query-log rows for the caller's org, ordered by\n`ts DESC, id DESC` (newest first)."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."}}},"DnsQueryLogUploadRequest":{"type":"object","description":"`POST /dns_agent/query-log` request envelope. One batch is from\none resolver, so `server_id` is carried once on the envelope\n(not repeated per entry) and gates the whole batch through the\ncross-agent ownership guard — the same shape as the\nheartbeat request.","required":["server_id","entries"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/DnsQueryLogEntry"},"description":"The batched query-log rows. Bounded `1 ≤ len ≤ 1000` (a\ncall is capped at 1000; the config `max_log_batch`\nadvertises the same number). Each entry is nested-validated\nso a malformed row rejects the whole batch with 422 before\nany DB write."},"server_id":{"type":"string","format":"uuid","description":"`dns_servers.id` for the resolver this agent is the DNS\nserver on. Cross-agent integrity check: the handler\nrefuses `409 server_mismatch` when this id resolves to a\n`dns_servers` row whose `agent_id` does not match the auth'd\n`Principal::FleetAgent`'s `agent_id`. Also the\nleading column of the idempotency tuple."}}},"DnsQueryLogUploadResponse":{"type":"object","description":"Response shape for `POST /dns_agent/query-log`. `accepted` +\n`duplicates` always equals the submitted `entries.len()`.\nA re-sent (retried) batch returns `accepted = 0,\nduplicates = len` — the idempotency index ignored every row, so\nthe retry did not double-count.","required":["accepted","duplicates"],"properties":{"accepted":{"type":"integer","format":"int64","description":"Rows newly stored by this call (the idempotency index had no\nprior row for the `(server_id, ts, subscription_id,\nquery_name)` tuple)."},"duplicates":{"type":"integer","format":"int64","description":"Rows the idempotency index ignored because an identical\ntuple was already stored (a retried / overlapping batch)."}}},"DnsServerListResponse":{"type":"object","description":"Response body for `GET /dns/servers`.","required":["servers"],"properties":{"servers":{"type":"array","items":{"$ref":"#/components/schemas/DnsServerRead"},"description":"Selectable servers ordered by `location ASC, id ASC`."}}},"DnsServerRead":{"type":"object","description":"One row in the anonymous `GET /dns/servers` catalog. The customer UI\nuses this to pick a resolver. Operational secrets (`agent_key_hash`,\n`telemetry_json`) are never exposed; only selection-relevant fields.","required":["id","name","public_ip","status","transports"],"properties":{"id":{"type":"string","description":"`dns_servers.id` primary key."},"location":{"type":["string","null"],"description":"City / data-centre location label. `null` when unset."},"name":{"type":"string","description":"Human-readable server display name."},"public_ip":{"type":"string","description":"The public IPv4 address the resolver answers on (resolved from\n`dns_servers.public_ip_id` → `public_ips.ip_address`)."},"status":{"type":"string","description":"Operational status: `\"active\"`, `\"inactive\"`, or `\"draining\"`."},"transports":{"type":"array","items":{"type":"string"},"description":"Transports advertised in `dns_servers.capabilities` (e.g.\n`[\"do53\", \"dot\", \"doh\", \"doq\"]`). Empty when none advertised."}}},"DnsServerRef":{"type":"object","description":"Minimal reference to the DNS server assigned to a tunnel. Nested\ninside [`TunnelRead::dns_server`] when a `dns_assignments` row\nscopes this tunnel or its parent subscription to a specific server.","required":["id","address"],"properties":{"address":{"type":"string","description":"Public IP address the DNS server listens on. This is the `DNS =`\nline value in the generated WireGuard config."},"id":{"type":"string","description":"UUIDv7 primary key of the `dns_servers` row."}}},"DnsUsageDay":{"type":"object","description":"Query count for a single calendar day in the trailing-30-day window.","required":["date","queries"],"properties":{"date":{"type":"string","description":"Calendar day as `YYYY-MM-DD` (UTC)."},"queries":{"type":"integer","format":"int64","description":"Total queries answered that day."}}},"DnsUsageResponse":{"type":"object","description":"Response body for `GET /dns/usage` — aggregate stats over the\ntrailing 30 days for one subscription, scoped to the caller's org.","required":["queries_per_day","blocked_count","top_blocked_domains"],"properties":{"blocked_count":{"type":"integer","format":"int64","description":"Total queries blocked by any filter list in the window."},"queries_per_day":{"type":"array","items":{"$ref":"#/components/schemas/DnsUsageDay"},"description":"Per-day query counts, ascending by `date`."},"top_blocked_domains":{"type":"array","items":{"$ref":"#/components/schemas/DnsBlockedDomain"},"description":"Most-blocked domains, descending by `blocked`."}}},"DnssecEnableResponse":{"type":"object","description":"Response body for `POST /dns/zones/{zone_id}/dnssec/enable`. Both\nkeys are minted in the same transaction as `dns_zones.dnssec_enabled`\nflipping to 1.","required":["ksk","zsk","ds","dnssec_enabled"],"properties":{"dnssec_enabled":{"type":"boolean","description":"Reflects `dns_zones.dnssec_enabled` after the write (always\n`true` on success)."},"ds":{"$ref":"#/components/schemas/DsRecord","description":"Registrar-facing DS record derived from the new KSK (RFC 4509).\nThe customer publishes this at their registrar to complete the\nchain of trust from the parent zone."},"ksk":{"$ref":"#/components/schemas/DnsKey","description":"Newly-minted KSK (key-signing key)."},"zsk":{"$ref":"#/components/schemas/DnsKey","description":"Newly-minted ZSK (zone-signing key)."}}},"DnssecRotateZskResponse":{"type":"object","description":"Response body for `POST /dns/zones/{zone_id}/dnssec/rotate-zsk`. The\nprevious ZSK is marked inactive in the same transaction as the new\nZSK is inserted.","required":["previous_zsk","new_zsk"],"properties":{"new_zsk":{"$ref":"#/components/schemas/DnsKey","description":"The newly-minted active ZSK."},"previous_zsk":{"$ref":"#/components/schemas/DnsKey","description":"The ZSK that was just demoted to `active = false`."}}},"DsRecord":{"type":"object","description":"Registrar-facing DS record for a zone's KSK (RFC 4509). The\ncustomer pastes [`rdata_presentation`](Self::rdata_presentation)\ninto their registrar's DS form to complete the chain of trust;\nthe split fields exist for registrars whose forms take each value\nseparately.","required":["key_tag","algorithm","digest_type","digest","rdata_presentation"],"properties":{"algorithm":{"type":"integer","format":"int32","description":"DNSSEC algorithm number — always `15` (ed25519, RFC 8080).","minimum":0},"digest":{"type":"string","description":"Lowercase-hex SHA-256 digest over the canonical owner name\nplus the DNSKEY rdata (64 hex chars)."},"digest_type":{"type":"integer","format":"int32","description":"DS digest type — always `2` (SHA-256, RFC 4509).","minimum":0},"key_tag":{"type":"integer","format":"int32","description":"RFC 4034 Appendix B key tag computed over the KSK's DNSKEY\nrdata — the parent-side handle that pairs this DS with the\nchild DNSKEY.","minimum":0},"rdata_presentation":{"type":"string","description":"The full DS rdata in presentation format —\n`\"<key_tag> 15 2 <digest>\"` — exactly what the customer\npastes at their registrar."}}},"EffectiveActionsResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/effective-actions`. The\ncaller's grantable action set for the resolved org, sorted by slug,\nso the API-token builder can present a scope picker without the\nclient re-deriving the catalog. Wildcard grants (`iam:*`, `*`) are\nexpanded to their concrete members here, never echoed verbatim.","required":["actions"],"properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/GrantableAction"},"description":"Concrete grantable actions, sorted by `name`."}}},"ElevationEndResponse":{"type":"object","description":"`DELETE /auth/me/elevation` response.","required":["ended"],"properties":{"ended":{"type":"boolean","description":"Whether the session was elevated until now."}}},"ElevationRequest":{"type":"object","description":"`POST /auth/me/elevation` body.","required":["purpose"],"properties":{"purpose":{"$ref":"#/components/schemas/Purpose","description":"What the re-authentication is for."}}},"ElevationStatus":{"type":"object","description":"`GET /auth/me/elevation`: the requesting session's elevation.","required":["elevated","satisfies","now"],"properties":{"elevated":{"type":"boolean","description":"The session is elevated now."},"elevated_until":{"type":["string","null"],"description":"Until when."},"now":{"type":"string","description":"Server time, so the page counts down against the server's clock."},"reauth_at":{"type":["string","null"],"description":"When the session last re-authenticated."},"reauth_method":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Method","description":"How."}]},"satisfies":{"type":"array","items":{"$ref":"#/components/schemas/Purpose"},"description":"The purposes the elevation satisfies now: `staff`, `account`,\n`delete_account`."}}},"EmailSettingsRead":{"type":"object","description":"Read shape for `GET /settings/email` and the\n`PATCH /settings/email` 200 response. One field per\n`email_settings` column with the wire naming preserved 1:1,\nexcept the `smtp_password_ct` BLOB column projects onto a\n[`SecretPresence`] marker instead of leaking ciphertext or\nplaintext.\n\nLazy-row contract (same as every prior settings slice): the row\nat `id = 1` is created lazily by the first writer (comment\nin 0008). A GET against an empty `email_settings` table\nsurfaces the column DEFAULTs (`enabled = false`, every nullable\ntext column `None`, `smtp_port = None`, `use_tls = true`,\n`smtp_password = SecretPresence::Unset`,\n`updated_at = \"1970-01-01T00:00:00Z\"`) so the wire shape stays\nuniform regardless of whether a write has happened yet. The\nmatching handler is responsible for the lazy-default\nprojection.\n\nThe four free-text columns (`smtp_host` / `smtp_username` /\n`from_address` / `from_name`) and `smtp_port` are `Option<…>`\nbecause the schema columns are nullable; the two non-nullable\nbool columns (`enabled`, `use_tls`) surface as plain `bool`.\n\n`updated_at` is RFC3339 UTC. It is server-stamped on every PATCH\n(via `state.clock.now()`) and read-only — absent from the\nmatching [`EmailSettingsUpdate`] type.","required":["enabled","smtp_password","use_tls","updated_at"],"properties":{"enabled":{"type":"boolean","description":"Master toggle. When `false`, the email-sending code paths\n(password reset, organization invites, billing notifications)\nno-op locally. Backed by the schema's `enabled INTEGER NOT\nNULL DEFAULT 0 CHECK (enabled IN (0, 1))` column; the wire\nform is a plain bool and the handlers do the\nint↔bool conversion."},"from_address":{"type":["string","null"],"description":"Optional `From:` envelope address. Nullable TEXT."},"from_name":{"type":["string","null"],"description":"Optional `From:` display name. Nullable TEXT."},"smtp_host":{"type":["string","null"],"description":"Optional SMTP host (DNS name or IP literal). Nullable TEXT\nin the schema — `None` is wire-equivalent to \"operator has\nnot set one yet\"."},"smtp_password":{"$ref":"#/components/schemas/SecretPresence","description":"Presence marker for the AEAD-encrypted `smtp_password_ct`\nBLOB. Wire form is the literal token `\"<set>\"` / `\"<unset>\"`.\nThe plaintext is never echoed on read."},"smtp_port":{"type":["integer","null"],"format":"int64","description":"Optional SMTP port. Schema CHECK pins\n`smtp_port BETWEEN 1 AND 65535` when non-NULL;\n[`EmailSettingsUpdate`] surfaces the same range on the\nvalidator."},"smtp_username":{"type":["string","null"],"description":"Optional SMTP username (AUTH LOGIN identity). Nullable TEXT."},"updated_at":{"type":"string","description":"RFC3339 UTC timestamp of the last write. Server-stamped on\nevery PATCH; on a fresh deployment with no write yet, the\nhandler surfaces `\"1970-01-01T00:00:00Z\"` so the wire\nshape stays non-optional."},"use_tls":{"type":"boolean","description":"`true` when SMTP submission should use STARTTLS / implicit\nTLS. Backed by the schema's `use_tls INTEGER NOT NULL\nDEFAULT 1 CHECK (use_tls IN (0, 1))` column; the wire form\nis a plain bool and the handlers do the\nint↔bool conversion."}}},"EmailSettingsUpdate":{"type":"object","description":"Request body for `PATCH /settings/email`. Every field is\n`Option<T>` so a JSON object that omits a key leaves the column\nunchanged. An empty-object PATCH (`{}`) is a no-op at the column\nlevel — only `updated_at` advances (the handler mirrors the\nno-op semantics).\n\nThe four nullable text columns (`smtp_host` / `smtp_username` /\n`from_address` / `from_name`) and the secret-input field\n(`smtp_password`) use `Option<String>`. The matching\nhandler treats an explicit empty string as \"clear to NULL\" (i.e.\n`{\"smtp_host\": \"\"}` clears the column); a non-empty string sets\nthe column. For `smtp_password`, the non-empty plaintext is\nAEAD-encrypted by the handler before storage. The response\n([`EmailSettingsRead`]) never echoes the plaintext — only the\n[`SecretPresence`] marker derived from post-write column\nNULL-ness surfaces.\n\n`smtp_port` uses `Option<i64>` with the schema's `1..=65535`\nrange. `None` (omitted key) leaves the column unchanged; the\noperator disables SMTP via `enabled = false`, not by nulling out\nthe port — so there is no explicit-clear mechanism on this\nnumeric field.\n\n`garde` constraints fire only when the field is `Some(_)` —\n`None` is skipped automatically by the `garde` crate's\n`Option` semantics. The `length(max = 200)` cap on the\nfree-text fields is well above any realistic SMTP-config value\n(DNS names cap at 253 chars per RFC 1035 but real hosts are\nfar shorter; usernames / addresses sit well under 100 chars in\npractice) so a multi-line paste lands at the validator rather\nthan the database. The cap also blocks operator typos from\nsilently storing oversized configuration.\n\n`updated_at` is server-stamped on every PATCH and is\nintentionally absent from this type — the wire cannot override\nthe timestamp.","properties":{"enabled":{"type":["boolean","null"],"description":"New `enabled` flag. Plain bool on the wire; the\nhandler converts to the schema's `0` / `1` storage form."},"from_address":{"type":["string","null"],"description":"New `from_address`. Capped at 200 chars. Empty string\nclears the column to NULL (handler convention)."},"from_name":{"type":["string","null"],"description":"New `from_name`. Capped at 200 chars. Empty string clears\nthe column to NULL (handler convention)."},"smtp_host":{"type":["string","null"],"description":"New `smtp_host`. Capped at 200 chars. Empty string clears\nthe column to NULL (handler convention)."},"smtp_password":{"type":["string","null"],"description":"New `smtp_password` plaintext. Capped at 200 chars. Empty\nstring clears the underlying `smtp_password_ct` BLOB to\nNULL; any non-empty value is AEAD-encrypted by the\nhandler before storage. The response ([`EmailSettingsRead`])\nnever echoes the plaintext — only the [`SecretPresence`]\nmarker derived from post-write column NULL-ness surfaces."},"smtp_port":{"type":["integer","null"],"format":"int64","description":"New `smtp_port`. Schema CHECK pins\n`smtp_port BETWEEN 1 AND 65535`; the validator surfaces\nthe same range so a typo lands at the wire boundary."},"smtp_username":{"type":["string","null"],"description":"New `smtp_username`. Capped at 200 chars. Empty string\nclears the column to NULL (handler convention)."},"use_tls":{"type":["boolean","null"],"description":"New `use_tls` flag. Plain bool on the wire; the\nhandler converts to the schema's `0` / `1` storage form."}}},"EmailTestSendRequest":{"type":"object","description":"Request body for `POST /settings/email/test`.\nSends one diagnostic message from the configured\n`email_settings` row to `to_address` over the configured SMTP\nrelay. The endpoint is strictly diagnostic: no row is mutated,\nthe response always has status 200 on a reached-the-handler\npath, and the `ok` flag on [`EmailTestSendResponse`] carries the\nSMTP outcome.\n\n`to_address` is the single required field — every other input\n(host, port, username, password, sender, TLS toggle) is read\nfrom the persisted row. The cap of 200 chars matches the cap\non the four nullable text columns on\n[`EmailSettingsUpdate`]; the `email` validator additionally\nrejects obviously-malformed addresses before any SMTP I/O.","required":["to_address"],"properties":{"to_address":{"type":"string","description":"RFC 5322 envelope address the diagnostic message is sent\nto. The handler builds the message with the persisted row's\n`from_address` / `from_name` as the `From:` and `to_address`\nas the sole `To:`. Bounded `1 ≤ len ≤ 200`; the `email`\nvalidator rejects malformed inputs at the wire boundary."}}},"EmailTestSendResponse":{"type":"object","description":"Wire response for `POST /settings/email/test`.\nDiagnostic endpoints by convention surface a stable structured\noutcome on every reached-the-handler attempt; the HTTP status\nstays 200 even when the SMTP transaction failed (the request\nitself succeeded — only the diagnostic answer changed). The\n401 / 403 / 422 paths still flow through\n[`crate::error::ApiError`] for auth-gate and validator-reject\ncases.\n\n`ok = true` ⇒ the SMTP transaction completed without protocol\nerror; `message` carries a short success summary suitable for\nrendering verbatim in the dashboard's diagnostic widget.\n`ok = false` ⇒ `error_class` is one of the stable codes\n(`smtp_not_configured`, `misconfigured`, `invalid_sender`,\n`invalid_recipient`, `message_build`, `transport`) and\n`message` carries a short human-readable summary.\n\nNo field on this struct carries the plaintext SMTP\npassword or any byte derived from it. The decrypted password\nlives only on the in-flight `SmtpConfig` local inside the\nhandler frame and is dropped at the end of the call.","required":["ok","message"],"properties":{"error_class":{"type":["string","null"],"description":"Stable machine-readable failure category on the\n`ok = false` path; absent on success. One of\n`smtp_not_configured`, `misconfigured`, `invalid_sender`,\n`invalid_recipient`, `message_build`, `transport`."},"message":{"type":"string","description":"Short human-readable summary of the outcome. Always present.\nOn success: a one-line confirmation. On failure: a short\ndescription suitable for the dashboard widget, never\ncarrying the configured SMTP host, the configured sender\naddress, or the SMTP password."},"ok":{"type":"boolean","description":"`true` ⇒ SMTP transaction completed without protocol error;\n`false` ⇒ diagnostic failure (see `error_class` for the\nstable category)."}}},"EndRestRequest":{"type":"object","description":"`POST /platform/public-ips/{id}/end-rest` body.","required":["reason"],"properties":{"reason":{"type":"string","description":"Why the rest ends early (3 to 500 characters, not counting\nsurrounding spaces)."}}},"EnforceSweepResponse":{"type":"object","description":"Response — the counts from one lifecycle pass.","required":["expiring_notices","trial_notices","to_grace","to_suspended","to_cancelled"],"properties":{"expiring_notices":{"type":"integer","description":"`expiring_in_7d` notices enqueued (deduped per period).","minimum":0},"to_cancelled":{"type":"integer","description":"Transitions into `cancelled` (resource release) this pass.","minimum":0},"to_grace":{"type":"integer","description":"`active → grace` transitions applied.","minimum":0},"to_suspended":{"type":"integer","description":"Transitions into `suspended` this pass.","minimum":0},"trial_notices":{"type":"integer","description":"`trial_ending` notices enqueued (deduped per trial).","minimum":0}}},"EnterpriseLeadRequest":{"type":"object","description":"`POST /public/leads/enterprise` request body. A sales prospect from\nthe `/enterprise` form: contact name, a business email (free-email\ndomains rejected at the handler), team size, and an optional message.","required":["name","business_email","headcount"],"properties":{"business_email":{"type":"string","description":"Business email. RFC-shaped; free-email domains rejected."},"headcount":{"type":"string","description":"Team size / headcount (the form's \"Team size\" field). 1–40 chars."},"message":{"type":["string","null"],"description":"Optional free-text message describing what the prospect wants.\n≤5000 chars."},"name":{"type":"string","description":"Contact person's name. 1–200 chars."}}},"ExchangeNonceForCodeRequest":{"type":"object","description":"Request body of `POST /auth/exchange_nonce_for_code`: the two parts of\nthe link's fragment, from a browser that did not ask for the link.","required":["nonce","encoded_email_address"],"properties":{"encoded_email_address":{"type":"string","description":"Base64 of the address the link was mailed to."},"nonce":{"type":"string","description":"The link token."}}},"ExchangeNonceForCodeResponse":{"type":"object","description":"Response of `POST /auth/exchange_nonce_for_code`.","required":["code"],"properties":{"code":{"type":"string","description":"The verification code to type on the device that asked for the link."}}},"ExternalExitAssignment":{"type":"object","description":"One external exit this agent operates (`operator_agent_id` =\ncaller). The agent dispatches a driver per row, keyed on `kind`.","required":["id","slug","kind","status","config","capabilities"],"properties":{"capabilities":{"type":"string","description":"The exit's capability hints JSON (`{ anonymity_level,\njurisdiction, no_logs, max_throughput_mbps, supports_udp,\nsupports_ipv6 }`), passed through verbatim for the driver's\npolicy decisions (e.g. Tor's UDP refusal)."},"config":{"type":"string","description":"Plaintext driver credentials / config, unsealed from\n`config_ct`. Shape is per-kind and parsed by the matching\ndriver; an unparseable config fails that driver closed."},"id":{"type":"string","description":"The `external_exits.id` (UUIDv7) — echoed back in telemetry."},"kind":{"type":"string","description":"Driver class — the `external_exits.kind` CHECK domain (`tor`,\n`wireguard_external`, `openvpn_external`, `socks5`,\n`http_proxy`, `customer_owned`). The agent maps it onto a\ndriver capability via `ExternalExitKind::capability_slug`."},"slug":{"type":"string","description":"Human-readable handle (`external_exits.slug`)."},"status":{"type":"string","description":"Catalog status (`active` / `degraded`); `disabled` rows are\nnever assigned. A `degraded` exit keeps running — the status\nis operator/billing-facing; the driver itself decides nothing\nfrom it."}}},"ExternalExitAssignmentsResponse":{"type":"object","description":"Response for `GET /external_exit/assignments` — every exit row\noperated by the calling agent, in stable `id` order so an\nunchanged catalog re-fetch is byte-identical.","required":["exits"],"properties":{"exits":{"type":"array","items":{"$ref":"#/components/schemas/ExternalExitAssignment"},"description":"The caller's assigned exits. Empty is the well-defined zero\nstate (agent has the capability but no catalog rows yet)."}}},"ExternalExitTelemetryReport":{"type":"object","description":"One driver's 5-minute telemetry window for one assigned exit.","required":["external_exit_id","healthy","bytes_in_5min","bytes_out_5min","errors_5min"],"properties":{"bytes_in_5min":{"type":"integer","format":"int64","description":"Bytes forwarded into the exit over the window."},"bytes_out_5min":{"type":"integer","format":"int64","description":"Bytes returned from the exit over the window."},"current_circuit_count":{"type":["integer","null"],"format":"int64","description":"Open Tor circuits (Tor drivers only; absent elsewhere)."},"errors_5min":{"type":"integer","format":"int64","description":"Forwarding errors over the window."},"external_exit_id":{"type":"string","description":"The `external_exits.id` this report covers. Must be operated\nby the calling agent (`operator_agent_id`) or the report is\nrejected wholesale."},"healthy":{"type":"boolean","description":"Probe outcome: did the driver's health check through the exit\nsucceed this window? Feeds `last_health_check_ok` and the\n3-consecutive-failures degrade rule."}}},"ExternalExitTelemetryRequest":{"type":"object","description":"Request body for `POST /external_exit/telemetry`.","required":["reports"],"properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/ExternalExitTelemetryReport"},"description":"Per-exit reports for this window."}}},"ExternalExitTelemetryResponse":{"type":"object","description":"Response for `POST /external_exit/telemetry`.","required":["updated","degraded","recovered"],"properties":{"degraded":{"type":"array","items":{"type":"string"},"description":"Exits this request flipped `active` -> `degraded` (the\n3-strike rule landed). Audited server-side; echoed so the\ndriver can log the transition it caused."},"recovered":{"type":"array","items":{"type":"string"},"description":"Exits this request recovered `degraded` -> `active`."},"updated":{"type":"integer","format":"int64","description":"Rows whose health columns were updated."}}},"FieldError":{"type":"object","description":"One validation failure on one field. The `field` is the JSON path of the\noffending input (e.g., `\"email\"`, `\"address.zip\"`); `code` is a short stable\nmachine-readable label (`\"too_short\"`, `\"not_email\"`, `\"required\"`, etc.).","required":["field","code","message"],"properties":{"code":{"type":"string","description":"Stable machine-readable validation code (`\"too_short\"`, `\"not_email\"`, …)."},"field":{"type":"string","description":"JSON path of the offending input."},"message":{"type":"string","description":"Human-readable failure message."}}},"ForceResignResponse":{"type":"object","description":"Receipt for `POST /platform/dns/zones/{id}/force-resign`.","required":["zone_id","serial"],"properties":{"serial":{"type":"integer","format":"int64","description":"The SOA serial AFTER the bump — the version the authoritative\nagent re-signs against."},"zone_id":{"type":"string","description":"The zone that was marked for re-signing."}}},"GrantableAction":{"type":"object","description":"One concrete action the caller may delegate into a new API token,\npaired with its catalog description. Expanded from the caller's\neffective grant patterns against the compile-time action catalog,\nso the set is exactly what `POST /iam/orgs/{org_id}/tokens` will\naccept (a token cannot escalate beyond its owner's actions).","required":["name"],"properties":{"description":{"type":["string","null"],"description":"Human-readable catalog description, when the catalog carries one."},"name":{"type":"string","description":"The action slug (e.g. `vpn:tunnel:create`)."}}},"HealthResponse":{"type":"object","description":"Response body for `GET /health`.","required":["status","version"],"properties":{"status":{"type":"string","description":"Liveness flag — `\"ok\"` when the binary is reachable and the DB ping succeeded."},"version":{"type":"string","description":"Compiled `CARGO_PKG_VERSION` of this binary."}}},"HostRouteListResponse":{"type":"object","description":"Response envelope for `GET /platform/host-routes`.","required":["host_routes"],"properties":{"host_routes":{"type":"array","items":{"$ref":"#/components/schemas/HostRouteRead"},"description":"Page contents — newest first, capped at the request's `limit`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or `null` when none remain."}}},"HostRouteRead":{"type":"object","description":"One host_route row on the wire.","required":["id","public_ip_id","public_ip","destination_ip","rule_type","priority","status","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 of row creation."},"description":{"type":["string","null"],"description":"Operator note."},"dest_ports":{"type":["string","null"],"description":"Port-forward subset or `null` for full-IP routing."},"destination_ip":{"type":"string","description":"Internal host the public IP routes to."},"id":{"type":"string","description":"`host_routes.id` (UUIDv7)."},"priority":{"type":"integer","format":"int64","description":"Forwarding priority."},"public_ip":{"type":"string","description":"The public IP address (denormalised from `public_ips`)."},"public_ip_id":{"type":"string","description":"The owning public IP's id."},"routing_server_id":{"type":["string","null"],"description":"The routing server applying the rule, or `null` if detached."},"rule_type":{"type":"string","description":"`dnat` / `snat` / `both`."},"status":{"type":"string","description":"`pending` / `active` / `removing` / `removed` / `failed`."}}},"IamAssumeRequest":{"type":"object","description":"Request body for `POST /iam/assume` (the source-side\nexchange slice). One field — `target_org_id` —\nnames the org the caller wants to act as a member of for\nthe bounded session.\n\nThe handler is unscoped (no `{org_id}` in the path) because\nthe principal does NOT yet have membership in the target\norg — the grant is the entire authority. Lookup against\n`cross_org_assume_grants` is by\n`(source_principal_id = user.id, source_principal_kind = 'user',\ntarget_org_id = req.target_org_id)`. Zero matches ⇒ 404.","required":["target_org_id"],"properties":{"target_org_id":{"type":"string","format":"uuid","description":"UUID of the org the caller wants to assume a role in. The\nhandler resolves this against `cross_org_assume_grants`;\nno membership is required in the target org (the grant\nIS the authorisation channel)."}}},"IamAssumeResponse":{"type":"object","description":"Wire response for `POST /iam/assume`. The caller\nswaps the returned `token` into its Bearer header for\nsubsequent requests; `ResolvePrincipal` reads the\n`assumed_org_id` + `assumed_role_name` claims and switches\n`effective_actions` into the assumed-session branch.\n\n`expires_at` is the exact RFC3339 timestamp the new JWT's\n`exp` claim resolves to — `min(grant.max_session_seconds,\nbase_jwt_remaining)` seconds from now. The assumed session\nnever outlives the underlying grant or the base session\nthat minted it.","required":["token","assumed_org_id","allowed_role_name","max_session_seconds","expires_at"],"properties":{"allowed_role_name":{"type":"string","description":"System-role slug the assumed session acts under (lifted\nfrom the matched `cross_org_assume_grants` row)."},"assumed_org_id":{"type":"string","description":"The target org the assumed session runs against (echo of\nthe request's `target_org_id`)."},"expires_at":{"type":"string","description":"RFC3339 timestamp the assumed JWT's `exp` claim resolves\nto. Useful for clients building \"session expires in N\nminutes\" UX without re-decoding the JWT."},"max_session_seconds":{"type":"integer","format":"int64","description":"Effective lifetime of the new JWT in seconds — the value\nthe handler clamped against the source grant's\n`max_session_seconds` and the base JWT's remaining time."},"token":{"type":"string","description":"HS256-signed compact-JWS string carrying the assumed\nclaims. The caller switches its Bearer header to this\nvalue to operate as the assumed role."}}},"IamReleaseAssumeRequest":{"type":"object","description":"Request body for `POST /iam/release-assume` (the\nclosing slice). Empty struct — the assumed JWT in\nthe `Authorization` header IS the input. The wire shape is a\nJSON object so the OpenAPI surface stays consistent with peer\n`Iam*Request` types and so a future addition (e.g. an opt-in\n\"extend by N seconds\" flag) lands without contract churn.\n\nClients send `{}`; the axum JSON extractor parses an empty\nobject into the unit struct deterministically. Malformed\nbodies surface as 422 from the extractor before the handler\nruns."},"IamReleaseAssumeResponse":{"type":"object","description":"Wire response for `POST /iam/release-assume`. The\ncaller swaps the returned `token` into its Bearer header for\nsubsequent requests; `ResolvePrincipal` decodes a base\nsession (no `assumed_org_id` / `assumed_role_name` claims) so\n`effective_actions` falls back to the membership-based path.\n\n`expires_at` is the exact RFC3339 timestamp the new base\nJWT's `exp` claim resolves to — `min(JWT_TTL_DAYS,\nassumed_remaining_secs)` seconds from now. Exiting the assume\nsession never extends session lifetime past what the\nunderlying base auth originally authorised.","required":["token","expires_at"],"properties":{"expires_at":{"type":"string","description":"RFC3339 timestamp the released base JWT's `exp` claim\nresolves to."},"token":{"type":"string","description":"HS256-signed compact-JWS string carrying base-session\nclaims. The caller switches its Bearer header to this\nvalue to operate as the underlying user."}}},"ImageRolloutCreateRequest":{"type":"object","description":"Request body for `POST /platform/agents/image-rollouts`.","required":["channel","target_version","wave_percent"],"properties":{"channel":{"type":"string","description":"Release ring to roll. Free text (rings are an operator-defined\nvocabulary); must match `agents.image_channel` for an\nagent to participate."},"target_version":{"type":"string","description":"Image version to roll out; the `(channel, target_version)` pair\nmust be catalogued in `release_images`."},"wave_percent":{"type":"integer","format":"int64","description":"Initial wave size in percent (0–100). Start small (a canary\nwave), advance via PATCH as adoption proves out."}}},"ImageRolloutDetailResponse":{"type":"object","description":"Response body for `GET /platform/agents/image-rollouts/{id}`.","required":["rollout","stats"],"properties":{"rollout":{"$ref":"#/components/schemas/ImageRolloutRead","description":"The rollout row."},"stats":{"$ref":"#/components/schemas/ImageRolloutStats","description":"Adoption stats computed against the live fleet."}}},"ImageRolloutListResponse":{"type":"object","description":"Response body for `GET /platform/agents/image-rollouts`.","required":["rollouts"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` when exhausted."},"rollouts":{"type":"array","items":{"$ref":"#/components/schemas/ImageRolloutRead"},"description":"Page of rollouts, ordered `created_at DESC, id DESC`."}}},"ImageRolloutRead":{"type":"object","description":"One rollout row on the wire.","required":["id","channel","target_version","status","wave_percent","created_at","updated_at"],"properties":{"channel":{"type":"string","description":"The release ring the wave drives — only agents whose\n`agents.image_channel` equals this participate."},"created_at":{"type":"string","description":"RFC3339 row-create instant."},"id":{"type":"string","description":"`agent_image_rollouts.id` (UUIDv7) — also the wave-bucket salt."},"status":{"$ref":"#/components/schemas/ImageRolloutStatus","description":"Lifecycle state."},"target_version":{"type":"string","description":"The catalogued image version the wave drives agents toward."},"updated_at":{"type":"string","description":"RFC3339 last-transition instant."},"wave_percent":{"type":"integer","format":"int64","description":"Wave size in percent (0–100) of the un-pinned joined fleet on\nthe channel."}}},"ImageRolloutStats":{"type":"object","description":"Live adoption stats derived at read time (never stored): the\noperator's advance-or-pause signal.","required":["cohort_total","wave_size","adopted","pinned_total"],"properties":{"adopted":{"type":"integer","format":"int64","description":"In-wave agents whose `reported_image_version` already equals the\ntarget — they completed the swap and rebooted into the slot."},"cohort_total":{"type":"integer","format":"int64","description":"Joined, un-pinned agents on the rollout's channel — the\npopulation waves draw from."},"pinned_total":{"type":"integer","format":"int64","description":"Joined agents on the channel excluded from the cohort by a\nmanual `expected_image_version` pin."},"wave_size":{"type":"integer","format":"int64","description":"Cohort agents hashing under the current `wave_percent` — the\nagents currently resolving the target."}}},"ImageRolloutStatus":{"type":"string","description":"Rollout lifecycle state. `active` drives the wave; `paused` stops\noffering the target to not-yet-rolled agents without touching\nagents that already swapped (an image rollout pauses, device-local\nRAUC A/B handles rollback); `completed` / `cancelled` are terminal\nhistory rows.","enum":["active","paused","completed","cancelled"]},"ImageRolloutUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/agents/image-rollouts/{id}`.\nOmitted fields are unchanged; an empty-object PATCH is a no-op.","properties":{"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ImageRolloutStatus","description":"New lifecycle state. Permitted transitions: `active` ⇄ `paused`;\n`active` / `paused` → `completed` / `cancelled`. Terminal rows\nare immutable (409)."}]},"wave_percent":{"type":["integer","null"],"format":"int64","description":"New wave size. Must not decrease — an agent already told its\ntarget cannot be un-told (409 on decrease)."}}},"InfraDnsRecordCreateRequest":{"type":"object","description":"Body for `POST /platform/dns/infra-records`. `name` is lowercased\nserver-side and UNIQUE per `record_type` (collision → 409\n`record_exists`). `value` must parse as an IP of the matching family\n(422 otherwise). `ttl` defaults to 60 when omitted.","required":["name","record_type","value"],"properties":{"name":{"type":"string","description":"Exact FQDN to answer (lowercased server-side)."},"record_type":{"type":"string","description":"`A` or `AAAA` (validated against the family of `value`)."},"ttl":{"type":["integer","null"],"format":"int32","description":"Answer TTL in seconds (1..=86400); omitted ⇒ 60.","minimum":0},"value":{"type":"string","description":"IP address the name resolves to."}}},"InfraDnsRecordDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/dns/infra-records/{id}`.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"Always `true` on a 200 — the record is gone."},"id":{"type":"string","description":"The deleted record's id, echoed back."}}},"InfraDnsRecordListResponse":{"type":"object","description":"Response envelope for `GET /platform/dns/infra-records`. The infra\nrecord set is small and fully synced, so it is returned whole\n(name/type ordered) rather than cursor-paginated.","required":["records"],"properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/InfraDnsRecordRead"},"description":"Every infra record, `(name, record_type)` ordered."}}},"InfraDnsRecordRead":{"type":"object","description":"One `infra_dns_records` row, staff read model.","required":["id","name","record_type","value","ttl","is_active","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 of row creation."},"id":{"type":"string","description":"UUIDv7 primary key."},"is_active":{"type":"boolean","description":"Whether the record is served (`true`) or held inactive."},"name":{"type":"string","description":"Exact FQDN the record answers (lowercased, no trailing dot)."},"record_type":{"type":"string","description":"`A` or `AAAA`."},"ttl":{"type":"integer","format":"int64","description":"Answer TTL in seconds."},"updated_at":{"type":"string","description":"RFC3339 of the last mutation."},"value":{"type":"string","description":"IP address the name resolves to."}}},"InstallChannelListResponse":{"type":"object","description":"Response body for `GET /devices/install-channels`.","required":["channels"],"properties":{"channels":{"type":"array","items":{"$ref":"#/components/schemas/InstallChannelRead"},"description":"Every configured channel, in operator-pinned display order."}}},"InstallChannelRead":{"type":"object","description":"One per-platform install channel, with the `{origin}` placeholder\nalready substituted server-side.","required":["platform","channel_label","command","copyable"],"properties":{"channel_label":{"type":"string","description":"Short channel label rendered above the snippet\n(\"Homebrew\", \"Shell\", \"App Store\", …)."},"command":{"type":"string","description":"The copy-pastable command (when `copyable`) or descriptive\nstore-install copy (when not), origin already substituted."},"copyable":{"type":"boolean","description":"Whether `command` is a real paste-into-terminal command (the\nUI shows a copy button) or descriptive store copy."},"platform":{"type":"string","description":"Platform slug — same allowlist the device-link verify endpoint\naccepts (`linux|macos|windows|ios|android|headless`)."}}},"InterfacePolicyWire":{"type":"object","description":"The compiled ingress policy for one internal interface (a `management`\naddress). Anything not admitted by a rule here is denied.","required":["address","rules"],"properties":{"address":{"type":"string","description":"The address this policy governs."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/InterfaceRuleWire"},"description":"Admitting rules. An empty list means the address is governed and\nadmits nothing, which is a deliberate posture rather than an\nomission."}}},"InterfaceRuleWire":{"type":"object","description":"One ingress rule admitting traffic to an internal interface.","required":["protocol","dst_ports","src","reason"],"properties":{"dst_ports":{"type":"string","description":"`\"any\"`, a single port (`443`), or an inclusive range (`8000-8100`)."},"peer_group":{"type":["string","null"],"description":"The peer group this rule was expanded from, when it was.\n\nExpansion is what a matcher vocabulary of addresses requires, but it is\na snapshot: membership that changes after the compile does not take\neffect until the next one. A renderer whose target resolves group\nmembership itself can collapse these rules back to a single selector\nand recover the continuous behaviour, so the group identity must\nsurvive the expansion rather than being discarded by it."},"protocol":{"type":"string","description":"`\"any\" | \"tcp\" | \"udp\" | \"icmp\"`."},"reason":{"type":"string","description":"Why the rule exists, carried into the rendered comment so a live\nruleset explains itself."},"src":{"type":"string","description":"Source matcher: `\"any\"`, a CIDR, or an exact address. A rule whose\npeer was another security group arrives already expanded to one rule\nper member address."}}},"InvoiceLineRead":{"type":"object","description":"One line of an internal invoice.","required":["kind","description","quantity","amount"],"properties":{"amount":{"type":"integer","format":"int64","description":"Minor units; negative for a discount."},"description":{"type":"string","description":"What the line is for."},"kind":{"type":"string","description":"`plan` or `discount`."},"period_end":{"type":["string","null"],"description":"Service period end (RFC3339)."},"period_start":{"type":["string","null"],"description":"Service period start (RFC3339)."},"quantity":{"type":"integer","format":"int64","description":"Units."}}},"InvoiceListResponse":{"type":"object","description":"A page of invoices, newest first.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceRead"},"description":"The page's invoices, ordered `(created_at DESC, id DESC)`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` on the last page."}}},"InvoiceRead":{"type":"object","description":"One invoice Stripe issued to an org.","required":["id","org_id","status","currency","subtotal","tax","total","amount_due","amount_paid","created_at"],"properties":{"amount_due":{"type":"integer","format":"int64","description":"Amount asked for, minor units."},"amount_paid":{"type":"integer","format":"int64","description":"Amount collected, minor units."},"amount_refunded":{"type":"integer","format":"int64","description":"Refunded on the charge that paid it, minor units."},"buyer":{"description":"The buyer block as frozen when issued (single read only)."},"created_at":{"type":"string","description":"When Stripe created the invoice (RFC3339). Lists sort on it."},"currency":{"type":"string","description":"Lowercase ISO currency code."},"due_date":{"type":["string","null"],"description":"When payment is due, for invoices sent for manual payment."},"finalized_at":{"type":["string","null"],"description":"When Stripe finalized it."},"hosted_invoice_url":{"type":["string","null"],"description":"Stripe-hosted invoice page (view and pay)."},"id":{"type":"string","description":"Our id (UUIDv7)."},"invoice_pdf_url":{"type":["string","null"],"description":"Stripe-hosted PDF."},"lines":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLineRead"},"description":"Line items (internal invoices, single read only)."},"number":{"type":["string","null"],"description":"Stripe's invoice number; `null` until finalized."},"org_id":{"type":"string","description":"Owning org."},"org_name":{"type":["string","null"],"description":"The billed org's name (single read only)."},"paid_at":{"type":["string","null"],"description":"When it was paid."},"payment_details":{"description":"What paid a platform invoice: coin, amount, transaction hash."},"payment_method":{"type":["string","null"],"description":"`card` (Stripe), `complimentary`, `free` or `crypto`."},"period_end":{"type":["string","null"],"description":"End of the billed service period (RFC3339)."},"period_start":{"type":["string","null"],"description":"Start of the billed service period (RFC3339)."},"seller":{"description":"The seller block as frozen when issued (single read only)."},"source":{"type":"string","description":"`stripe` (issued by Stripe, with its hosted page and PDF) or\n`internal` (issued here for a complimentary plan; view it in the\nconsole)."},"status":{"type":"string","description":"`draft` | `open` | `paid` | `uncollectible` | `void`."},"stripe_invoice_id":{"type":["string","null"],"description":"Stripe's invoice id (`in_…`)."},"subscription_id":{"type":["string","null"],"description":"The subscription the invoice bills, when known."},"subtotal":{"type":"integer","format":"int64","description":"Total before tax, minor units."},"tax":{"type":"integer","format":"int64","description":"Tax, minor units."},"total":{"type":"integer","format":"int64","description":"Total, minor units."},"voided_at":{"type":["string","null"],"description":"When it was voided."}}},"InvoiceSeller":{"type":"object","description":"The seller on platform invoices.","required":["legal_name"],"properties":{"address":{"type":["string","null"],"description":"Postal address, lines separated by newlines."},"email":{"type":["string","null"],"description":"Support email printed on invoices."},"legal_name":{"type":"string","description":"Legal name."},"registration_number":{"type":["string","null"],"description":"Company registration number."},"tax_id":{"type":["string","null"],"description":"Tax ID (VAT, EIN, …)."}}},"InvoiceSyncReport":{"type":"object","description":"Per-call counts.","required":["customers","invoices_seen","inserted","updated","kept","paid_effects","unmatched","errors","truncated"],"properties":{"customers":{"type":"integer","description":"Stripe customers swept.","minimum":0},"errors":{"type":"integer","description":"Customers whose listing failed, plus invoices that could not be\nread; see the server log.","minimum":0},"inserted":{"type":"integer","description":"Invoices added to the mirror.","minimum":0},"invoices_seen":{"type":"integer","description":"Invoices Stripe returned.","minimum":0},"kept":{"type":"integer","description":"Mirror rows already newer or final; left as they were.","minimum":0},"paid_effects":{"type":"integer","description":"Paid invoices whose subscription effects had not run (a missed\nwebhook) and ran now, without a customer notice. The subscription\nmoves only when the invoice extends its paid period.","minimum":0},"refunds":{"type":"integer","description":"Invoices whose charge Stripe reports (partly) refunded; the amount\nis recorded on the mirror row.","minimum":0},"truncated":{"type":"boolean","description":"`true` when customers or pages were left for another run."},"unmatched":{"type":"integer","description":"Invoices no org could be resolved for; not written.","minimum":0},"updated":{"type":"integer","description":"Mirror rows refreshed.","minimum":0}}},"KindPref":{"type":"object","description":"One kind's per-channel delivery preference. `email` / `in_app` are\nthe two preference-exposed channels ([`super::Channel::PREF_CHANNELS`]);\nSMS is never wire-exposed (it ships by appended migration and is\nnever preference-routed). On read, each value is the *effective*\nsetting: the stored override when present, else the kind's\n[`super::Kind::default_on`] policy.","required":["kind","email","in_app"],"properties":{"email":{"type":"boolean","description":"Whether transactional email is enabled for this kind."},"in_app":{"type":"boolean","description":"Whether the in-product feed entry is enabled for this kind."},"kind":{"type":"string","description":"The colon slug ([`super::Kind::as_slug`], e.g. `payment:failed`)."}}},"LeadCreateResponse":{"type":"object","description":"Response for both capture endpoints — the new lead's UUIDv7 id.","required":["id"],"properties":{"id":{"type":"string","description":"UUIDv7 primary key of the captured lead."}}},"LeadListResponse":{"type":"object","description":"Response envelope for `GET /platform/leads`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LeadRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"LeadRead":{"type":"object","description":"Staff-tier lead row. Mirrors every column of `leads`.","required":["id","kind","email","status","created_at","updated_at"],"properties":{"company":{"type":["string","null"],"description":"Company name (reserved; the current enterprise form captures a\nperson `name` instead, so this is NULL for form-captured leads)."},"created_at":{"type":"string","description":"RFC3339 row creation timestamp."},"email":{"type":"string","description":"Prospect reply email."},"headcount":{"type":["string","null"],"description":"Headcount band (enterprise leads only; NULL otherwise)."},"id":{"type":"string","description":"UUIDv7 primary key."},"kind":{"type":"string","description":"Originating form — `enterprise` / `support` / `sales` /\n`press` / `security`."},"message":{"type":["string","null"],"description":"Message body (contact leads only; NULL otherwise)."},"name":{"type":["string","null"],"description":"Contact person's name (enterprise leads; NULL otherwise)."},"source_ip":{"type":["string","null"],"description":"First `X-Forwarded-For` hop captured at submit; NULL when the\nrequest carried no proxy header."},"status":{"type":"string","description":"Triage lifecycle — `new` / `contacted` / `closed`."},"updated_at":{"type":"string","description":"RFC3339 last-update timestamp."}}},"Level":{"type":"string","description":"What a challenge asks of the person, beyond the background work.","enum":["invisible","puzzle"]},"LoginResponse":{"type":"object","description":"Response body of a login completed with a second factor\n(`POST /auth/2fa/challenge`, `POST /auth/2fa/recovery`). The session is\nset as the cookie only; it is never in the body.","required":["user_id"],"properties":{"user_id":{"type":"string","description":"UUIDv7 of the authenticated user."}}},"LogoutResponse":{"type":"object","description":"Response body for `POST /auth/logout`. The handler clears the\n`auth_token` cookie via `Set-Cookie`; the JSON body is a stable\nacknowledgement non-browser clients can key off.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on success. Reserved for future structured fields\n(e.g., `revoked_session_id`) without changing the wire contract."}}},"MagicDnsDevice":{"type":"object","description":"One device projected for the magic-DNS view. The resolver\nsynthesises `<device_name>.<zone>` → `tunnel_ip` from this row,\nplus one SRV per `services` entry.","required":["id","device_name","services"],"properties":{"device_name":{"type":"string","description":"Human-readable device name. Unique within an org by the\n`UNIQUE (org_id, device_name)` constraint, so the\n`<device_name>.<zone>` form has no collision within a\nsingle org."},"id":{"type":"string","description":"UUIDv7 identifier of the device row. Stable across the\ndevice's lifetime; the resolver does not key by id (it\nkeys by `device_name` for the human-readable surface) but\nthe id is exposed so dashboard pages can deep-link."},"services":{"type":"array","items":{"$ref":"#/components/schemas/MagicDnsService"},"description":"Services this device has registered through\n`device_services`. Empty when the device has registered\nnone. The resolver synthesises one SRV record per entry."},"tunnel_ip":{"type":["string","null"],"description":"Org-internal IPv4 / IPv6 address the device is reachable\nat over its tunnel. `None` when the device has not yet\njoined a tunnel and so has no allocated address."}}},"MagicDnsService":{"type":"object","description":"Service registration projected from `device_services`. One row\nper `(device, protocol, port)` triple. The resolver synthesises\nSRV records (`_<name>._<protocol>.<device>.<zone>`) from this\nprojection.","required":["service_name","protocol","port"],"properties":{"port":{"type":"integer","format":"int64","description":"L4 port. Bounded `1..=65535` by the schema CHECK."},"protocol":{"type":"string","description":"Transport layer — `tcp` or `udp`. Mirrors\n`device_services.protocol` (schema CHECK)."},"service_name":{"type":"string","description":"Customer-supplied service slug (e.g. `web`, `ssh`).\nMirrors `device_services.service_name`."}}},"MagicDnsView":{"type":"object","description":"Response body for `GET /iam/orgs/{org_id}/magic-dns`.\n\nThe `zone` field carries the org's full magic-DNS zone\nhostname — `<org-slug>.appsynergy.net` — when `orgs.slug` is\nset, and `None` when the org has not been assigned a slug yet\n(the in-house resolver answers NXDOMAIN for an unassigned org;\nthe dashboard surfaces \"Magic DNS not configured\" against the\n`None` shape).\n\n`devices` carries every device in the org, irrespective of\nstatus — the resolver filters by `status = 'joined'` itself\n(a `paused` device still has a `tunnel_ip` and resolving it\nis fine; the device just isn't currently connected to answer\nto traffic on that address). This deliberate over-broad view\nkeeps the wire shape stable as device lifecycle states evolve.","required":["devices"],"properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/MagicDnsDevice"},"description":"Devices in the org, ordered by `device_name ASC` for a\nstable deterministic surface."},"zone":{"type":["string","null"],"description":"Full magic-DNS zone hostname for the org, e.g.\n`acme.appsynergy.net`. `None` when `orgs.slug` is NULL."}}},"MagicLinkCredentials":{"oneOf":[{"type":"object","description":"The link: the two parts of its fragment.","required":["nonce","encoded_email_address","method"],"properties":{"encoded_email_address":{"type":"string","description":"Base64 of the address the link was mailed to."},"method":{"type":"string","enum":["nonce"]},"nonce":{"type":"string","description":"The link token."}}},{"type":"object","description":"The verification code, typed on the device that asked for the link.","required":["email_address","code","method"],"properties":{"code":{"type":"string","description":"The verification code shown on the other device."},"email_address":{"type":"string","description":"The address the link was mailed to."},"method":{"type":"string","enum":["code"]}}}],"description":"What `POST /auth/verify_magic_link` is given, told apart by `method`."},"ManagedConfigBlock":{"type":"object","description":"The org-wide managed device configuration block injected into\n[`ClientConfigBlock`]. Mirrors\n`platform::iam::org_managed_config_types::OrgManagedConfigRead`\nminus the org-identifying / bookkeeping fields (`org_id`,\n`updated_at`) the daemon has no use for — the device already\nknows its own org, and the config's own change is what flips the\ncarrying endpoint's ETag. Distinct from [`DevicePolicyBlock`]: that\nis the org's compliance bar the device is checked against; this is\nthe configuration the org mandates the device apply.","required":["default_kill_switch","default_auto_connect","allowed_networks","blocked_networks","update_channel"],"properties":{"allowed_networks":{"type":"array","items":{"type":"string"},"description":"SSIDs / network identifiers the org allows devices to treat as\ntrusted."},"blocked_networks":{"type":"array","items":{"type":"string"},"description":"SSIDs / network identifiers the org forbids devices from\njoining while the tunnel is required."},"default_auto_connect":{"type":"boolean","description":"Org-wide starting value for a newly joined device's\nalways-on / auto-connect behavior; a device's own PATCHed\nvalue still wins once set."},"default_kill_switch":{"type":"boolean","description":"Org-wide starting value for a newly joined device's kill\nswitch; a device's own PATCHed value still wins once set."},"enforced_dns_filter":{"type":["string","null"],"description":"DNS filter-list slug every joined device in the org must\napply, or `None` when the org mandates no filter."},"update_channel":{"type":"string","description":"`stable` or `beta` — the org's preferred client update track."}}},"Member":{"type":"object","description":"A person who can take a team over.","required":["user_id","email"],"properties":{"email":{"type":"string","description":"Their address."},"name":{"type":["string","null"],"description":"Their name."},"user_id":{"type":"string","description":"Their user id."}}},"MemberRoleAssignRequest":{"type":"object","description":"Request body for `PATCH /iam/orgs/{org_id}/members/{user_id}/role`.\nOne required field — `role_name`. Bounded so the response\nwire shape always carries a non-empty role slug; the\n\"is this role customer-assignable\" check happens in the handler so\nvalidator's `code` stays decoupled from the role catalog.","required":["role_name"],"properties":{"role_name":{"type":"string","description":"Replacement role slug. Required; must be one of\n[`CUSTOMER_ASSIGNABLE_ROLES`]. Length-bounded `1 ≤ len ≤ 64`\nat the wire layer; the role-membership check runs in the\nhandler and surfaces `not_assignable` on the field's\nvalidation envelope."}}},"MeshBridgeCreateRequest":{"type":"object","description":"`POST /devices/mesh/bridges` request body. The handler parses\n`bridge_device_id` as a UUIDv7, validates `role` against\n[`ALLOWED_BRIDGE_ROLES`], parses `expires_at` as RFC3339 if set,\nand serialises `target_match` into `mesh_bridges.target_match`\n(capped at 4096 chars after serialisation to bound the column).","required":["bridge_device_id","role"],"properties":{"bridge_device_id":{"type":"string","description":"Owner-side client device offering the bridge. Caller must be\nthe device owner."},"expires_at":{"type":["string","null"],"description":"Optional RFC3339 expiry. Past `expires_at` rows are revoked by\nthe housekeeping worker (entry)."},"role":{"type":"string","description":"`relay`, `exit`, or `rendezvous`."},"target_match":{"$ref":"#/components/schemas/MeshBridgeTargetMatch","description":"Bridge target match rules. Empty struct = any flow within the\nbridge device's org."}}},"MeshBridgeListResponse":{"type":"object","description":"`GET /devices/mesh/bridges` response.","required":["bridges"],"properties":{"bridges":{"type":"array","items":{"$ref":"#/components/schemas/MeshBridgeRead"},"description":"Page of bridge records, ordered `created_at DESC, id DESC`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` when exhausted."}}},"MeshBridgeRead":{"type":"object","description":"One `mesh_bridges` row as the customer sees it.","required":["id","org_id","bridge_device_id","role","target_match","status","proposed_at","created_at","updated_at"],"properties":{"approved_at":{"type":["string","null"],"description":"RFC3339 instant of approval (None until approval)."},"approved_by_user_id":{"type":["string","null"],"description":"User who approved (None until approval)."},"bridge_device_id":{"type":"string","description":"Owning device of the bridge endpoint."},"created_at":{"type":"string","description":"RFC3339 row-create instant."},"expires_at":{"type":["string","null"],"description":"RFC3339 expiry (None when unbounded)."},"id":{"type":"string","description":"`mesh_bridges.id` (UUIDv7)."},"org_id":{"type":"string","description":"Owning org."},"proposed_at":{"type":"string","description":"RFC3339 instant the bridge was proposed."},"role":{"type":"string","description":"`relay` / `exit` / `rendezvous`."},"status":{"type":"string","description":"`proposed` / `approved` / `active` / `revoked`."},"target_match":{"$ref":"#/components/schemas/MeshBridgeTargetMatch","description":"Target-match JSON the bridge proposer supplied."},"updated_at":{"type":"string","description":"RFC3339 row-update instant."}}},"MeshBridgeTargetMatch":{"type":"object","description":"`mesh_bridges.target_match` JSON shape (`TEXT` column). Every field\nis optional — an empty struct matches \"any flow within this org\"\nfor an exit-role bridge. The `org_id` field exists for the schema's\nfederated-org evolution: when present it MUST equal the bridge\ndevice's `org_id`; otherwise the request is rejected\n(`cross_org_bridges_deferred`).","properties":{"cidrs":{"type":"array","items":{"type":"string"},"description":"CIDR allowlist this bridge will accept forwards to. Empty ⇒ no\nCIDR filter."},"device_ids":{"type":"array","items":{"type":"string"},"description":"Specific peer devices this bridge accepts forwards for. Empty\n⇒ no device-id filter (any peer)."},"org_id":{"type":["string","null"],"description":"When set, the org the bridge serves. Currently must equal the\nbridge device's `org_id`."}}},"MeshProbeAckResponse":{"type":"object","description":"`POST /devices/mesh/probe` ack body. Returned with `202 Accepted`:\nthe probe request was authorized, validated, and recorded as a\n`devices:mesh:probe_requested` audit row. The downstream measurement\narrives via the client-agent WS layer that consumes the audit log;\ncallers poll `GET /devices/mesh/paths/{src}/{dst}` for the row that\nwill carry the updated `rtt_ms` once the agents respond.","required":["src_device_id","dst_device_id","accepted_at"],"properties":{"accepted_at":{"type":"string","description":"RFC3339 instant the request was accepted."},"dst_device_id":{"type":"string","description":"Echoed destination device id."},"src_device_id":{"type":"string","description":"Echoed source device id."}}},"MeshProbeRequest":{"type":"object","description":"`POST /devices/mesh/probe` request body — request an out-of-band RTT\nprobe between the two devices identified by their UUIDv7 ids. Both\ndevices must live in the same org and the caller must be a member\nof that org. Validation is `length(min=1)`; the handler parses each\nfield to `Uuid` and returns `400 invalid_src_device_id` /\n`invalid_dst_device_id` on a malformed value, then `400\nsrc_and_dst_must_differ` when the two ids are equal.","required":["src_device_id","dst_device_id"],"properties":{"dst_device_id":{"type":"string","description":"Destination device."},"src_device_id":{"type":"string","description":"Source device."}}},"Method":{"type":"string","description":"How a sign-in proved who it was.","enum":["passkey","magic_link","totp","sso","recovery"]},"ModerationPreview":{"type":"object","description":"`GET /platform/users/{id}/moderation`: what suspending or suspending the\naccount would touch.","required":["user_id","active_devices","live_tunnels","live_paid_subscription","holds_platform_role","recent_addresses"],"properties":{"active_devices":{"type":"integer","format":"int64","description":"Client devices a suspension revokes (their tunnels drop)."},"holds_platform_role":{"type":"boolean","description":"The account holds a platform role (it cannot be suspended or\nsuspended until the role is removed)."},"live_paid_subscription":{"type":"boolean","description":"An org the user administers holds a live Stripe subscription."},"live_tunnels":{"type":"integer","format":"int64","description":"Active tunnels in orgs the user administers (left running; they\nbelong to the org)."},"recent_addresses":{"type":"array","items":{"$ref":"#/components/schemas/RecentAddress"},"description":"Up to five addresses \"also suspend the addresses it used\" would cover,\nmost recent first."},"suspended_at":{"type":["string","null"],"description":"RFC3339 suspension instant, if suspended."},"user_id":{"type":"string","description":"The user."}}},"ModerationResponse":{"type":"object","description":"Outcome of a suspend / unsuspend / suspension.","required":["user_id","sessions_revoked","api_tokens_revoked","devices_revoked","suspensions","live_paid_subscription"],"properties":{"api_tokens_revoked":{"type":"integer","format":"int64","description":"API tokens revoked by this call."},"devices_revoked":{"type":"integer","format":"int64","description":"Client devices revoked by this call."},"live_paid_subscription":{"type":"boolean","description":"The user's orgs still hold a live paid subscription. Nothing here\ncancels it; staff decide."},"sessions_revoked":{"type":"integer","format":"int64","description":"Sessions revoked by this call."},"suspended_at":{"type":["string","null"],"description":"RFC3339 suspension instant; `None` once lifted."},"suspensions":{"type":"array","items":{"type":"string"},"description":"Email / domain / network suspension ids placed by this call."},"user_id":{"type":"string","description":"The user."}}},"MyOrgMembership":{"type":"object","description":"One org the caller belongs to, as served by `GET /auth/me/orgs`.\nBacks the dashboard workspace switcher: the active row is the one\n`resolve_principal` currently resolves to.","required":["org_id","name","kind","role_name","is_active"],"properties":{"is_active":{"type":"boolean","description":"`true` for the org the principal is currently scoped to (the\nresolved active org); exactly one row carries it."},"kind":{"type":"string","description":"`orgs.kind` — `personal` | `team` | `platform`."},"name":{"type":"string","description":"`orgs.name` — display label."},"org_id":{"type":"string","description":"`orgs.id` — UUIDv7."},"role_name":{"type":"string","description":"The caller's `org_members.role_name` in this org."}}},"MyOrgsResponse":{"type":"object","description":"Response for `GET /auth/me/orgs` — every org the caller is a member\nof, ordered `(invited_at ASC, org_id ASC)` to match the earliest-\nmembership fallback `resolve_principal` uses.","required":["orgs"],"properties":{"orgs":{"type":"array","items":{"$ref":"#/components/schemas/MyOrgMembership"},"description":"The caller's memberships; empty only for a user with no org\n(never happens in production — the personal-org trigger seeds\none on signup)."}}},"NetPolicyForward":{"type":"object","description":"One Gateway port forward in a policy view: a port/protocol mapped to one\nendpoint.","required":["id","protocol","port","endpoint","note"],"properties":{"endpoint":{"type":"string","description":"IPv4 address the port is forwarded to: the binding's tunnel address."},"id":{"type":"string","description":"UUIDv7 of the forward row (`net_policy_forwards.id`)."},"note":{"type":"string","description":"Free-text note describing the forward; empty string when unset."},"port":{"type":"integer","format":"int64","description":"Destination port, `1..=65535`."},"protocol":{"type":"string","description":"`tcp` or `udp`."}}},"NetPolicyForwardInput":{"type":"object","description":"One Gateway forward in a set request.","required":["protocol","port","endpoint"],"properties":{"endpoint":{"type":"string","description":"IPv4 address the port is forwarded to, in dotted-quad form with no\nport. It must be the binding's tunnel address; anything else is\nrejected as 422 `invalid`."},"note":{"type":["string","null"],"description":"Optional free-text note. `len ≤ 255`."},"port":{"type":"integer","format":"int64","description":"Destination port, `1..=65535`."},"protocol":{"type":"string","description":"`tcp` or `udp`. The handler rejects any other value as 422 `invalid`."}}},"NetPolicyPlanWire":{"type":"object","description":"The compiled plan for one binding (the tenant-isolation key).","required":["binding_id","entries"],"properties":{"binding_id":{"type":"string","description":"The binding this plan governs."},"entries":{"type":"array","items":{"$ref":"#/components/schemas/PlanEntryWire"},"description":"Entries in evaluation order."}}},"NetPolicyPlansResponse":{"type":"object","description":"Response body for the plan poll: every active binding's compiled plan,\nscoped to the requesting agent, plus the server clock.","required":["plans","interfaces","customer_space","server_time"],"properties":{"customer_space":{"type":"array","items":{"type":"string"},"description":"Every address range customer traffic occupies: each binding's tunnel\noverlay and its static IP, as CIDR or bare-address tokens.\n\nThe host adapter needs this because the plan entries alone cannot say\nwhich flows the policy *owns*. Its forward chain has to deny customer\ntraffic that matches no entry while letting everything else past to\nwhatever else filters at that hook — and \"everything else\" includes the\nplatform's own services once their traffic is genuinely forwarded. A\nchain that cannot tell those apart must either deny both or admit both."},"interfaces":{"type":"array","items":{"$ref":"#/components/schemas/InterfacePolicyWire"},"description":"Security-group policy for internal interfaces. Separate from `plans`\nbecause it is not tenant-scoped: these are the platform's own\naddresses, governed by groups rather than by a binding's profile."},"plans":{"type":"array","items":{"$ref":"#/components/schemas/NetPolicyPlanWire"},"description":"One plan per active binding owned by the agent's routing servers."},"server_time":{"type":"string","format":"date-time","description":"Server wall-clock at assembly (RFC3339)."}}},"NetPolicyRule":{"type":"object","description":"One custom allow/block rule in a policy view.","required":["id","priority","enabled","effect","src","dst","protocol","dst_port"],"properties":{"dst":{"type":"string","description":"Friendly destination endpoint label."},"dst_port":{"type":"string","description":"Friendly destination-port label (`any` or a literal port)."},"effect":{"type":"string","description":"`allow` or `block`."},"enabled":{"type":"boolean","description":"Whether the rule is in effect. A disabled rule stays on the list."},"id":{"type":"string","description":"UUIDv7 of the rule row (`net_policy_rules.id`)."},"priority":{"type":"integer","format":"int64","description":"Evaluation priority — lower runs first."},"protocol":{"type":"string","description":"`any` / `tcp` / `udp` / `icmp`."},"src":{"type":"string","description":"Friendly source endpoint label the compiler resolves."}}},"NetPolicyRuleInput":{"type":"object","description":"One custom rule in a set request.","required":["priority","enabled","effect","src","dst"],"properties":{"dst":{"type":"string","description":"Friendly destination endpoint label (keyword, CIDR, `domain:…`, or\n`category:…`). `1 ≤ len ≤ 255`."},"dst_port":{"type":["string","null"],"description":"Friendly destination-port label. Absent ⇒ `any`. `len ≤ 32`."},"effect":{"type":"string","description":"`allow` or `block`. Rejected as 422 `invalid` otherwise."},"enabled":{"type":"boolean","description":"Whether the rule is in effect."},"priority":{"type":"integer","format":"int64","description":"Evaluation priority — lower runs first. `0 ≤ value ≤ 100000`."},"protocol":{"type":["string","null"],"description":"`any` / `tcp` / `udp` / `icmp`. Absent ⇒ `any`. Rejected as 422\n`invalid` otherwise."},"src":{"type":"string","description":"Friendly source endpoint label (keyword, CIDR, `domain:…`, or\n`category:…`). `1 ≤ len ≤ 255` so a full FQDN under the `domain:`\nprefix fits."}}},"NetPolicySetRequest":{"type":"object","description":"Request body for `PUT /net-policy/bindings/{binding_id}` — the full policy,\napplied as a transactional replace: the profile is upserted and\nthe forward / rule lists are swapped for the supplied sets. Re-sending the\nsame body is a no-op (natural idempotency).","required":["profile","forwards","rules"],"properties":{"forwards":{"type":"array","items":{"$ref":"#/components/schemas/NetPolicyForwardInput"},"description":"Gateway port forwards. At most 256 entries."},"profile":{"type":"string","description":"Target profile: `private` / `gateway` / `forward` / `passthrough`."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/NetPolicyRuleInput"},"description":"Custom rules. At most 512 entries."},"single_endpoint":{"type":["string","null"],"description":"The single destination for `forward` / `passthrough`. `len ≤ 255`."}}},"NetPolicyView":{"type":"object","description":"The full network policy for one binding (`GET` response). When no policy\nrow exists yet the binding's default — profile `private`, no forwards, no\nrules — is returned, so the \"default just works\" path needs no write.","required":["binding_id","org_id","profile","forwards","rules"],"properties":{"binding_id":{"type":"string","description":"UUIDv7 of the binding this policy governs."},"forwards":{"type":"array","items":{"$ref":"#/components/schemas/NetPolicyForward"},"description":"Gateway port forwards, ordered by creation."},"org_id":{"type":"string","description":"UUIDv7 of the owning org (resolved from the binding's tunnel)."},"profile":{"type":"string","description":"Active profile: `private` (default) / `gateway` / `forward` /\n`passthrough`."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/NetPolicyRule"},"description":"Custom rules, ordered by `(priority ASC, id ASC)`."},"single_endpoint":{"type":["string","null"],"description":"The single destination endpoint for `forward` / `passthrough`; `null`\nfor `private` / `gateway`."}}},"NodeHealth":{"type":"object","description":"The computed verdict: the max level across signals plus the signal\nlist (empty when the node is `Ok`).","required":["level","signals"],"properties":{"level":{"$ref":"#/components/schemas/NodeHealthLevel","description":"Max severity across [`NodeHealth::signals`], `Ok` if empty."},"signals":{"type":"array","items":{"$ref":"#/components/schemas/NodeHealthSignal"},"description":"Every fired signal, in evaluation order (heartbeat, disk,\nmemory, load)."}}},"NodeHealthLevel":{"type":"string","description":"Overall health rollup for one fleet node, ordered by severity so\nthe max across signals is the node's level.","enum":["ok","warn","critical"]},"NodeHealthSignal":{"type":"object","description":"A single fired health signal — one reason the node is not `Ok`.","required":["code","level","detail"],"properties":{"code":{"type":"string","description":"Stable slug for the signal, e.g. `disk_critical`,\n`heartbeat_stale`. Drawn from a fixed set of literals."},"detail":{"type":"string","description":"Human-readable context, e.g. `/ 96% used`."},"level":{"$ref":"#/components/schemas/NodeHealthLevel","description":"This signal's severity."}}},"NotificationListResponse":{"type":"object","description":"`GET /auth/notifications` response — one-array envelope plus the\nopaque next-page cursor (`null` on the last page).","required":["notifications"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque base64url cursor for the next page; `null` when last."},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/NotificationRead"},"description":"The caller's notifications, `(created_at DESC, id DESC)`."}}},"NotificationPreferencesResponse":{"type":"object","description":"`GET /auth/notifications/preferences` response: every one of the 14\nenumerated kinds with its effective `email` / `in_app` setting, in\n[`super::Kind::ALL`] order so the matrix renders deterministically.","required":["preferences"],"properties":{"preferences":{"type":"array","items":{"$ref":"#/components/schemas/KindPref"},"description":"One entry per kind, [`super::Kind::ALL`] order."}}},"NotificationRead":{"type":"object","description":"One row of `GET /auth/notifications` — the caller's own feed,\nnewest first.","required":["id","kind","status","payload","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 UTC enqueue time."},"dispatched_at":{"type":["string","null"],"description":"RFC3339 UTC dispatch time; `null` while still `pending`."},"id":{"type":"string","description":"Row id (UUIDv7)."},"kind":{"type":"string","description":"Kind slug ([`super::Kind::as_slug`])."},"payload":{"$ref":"#/components/schemas/Value","description":"The trigger payload — the canonical free-form column. The\none wire carve-out (class), mirroring audit metadata."},"read_at":{"type":["string","null"],"description":"RFC3339 UTC time the caller marked this row read; `null` while\nunread. Drives the inbox's unread styling + badge."},"status":{"type":"string","description":"`pending` | `sent` | `failed` (the `notifications.status` CHECK\ndomain)."}}},"NotificationTemplateDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/notification-templates` — a bare\nsuccess acknowledgement.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on a 200 — the template row was deleted."}}},"NotificationTemplateListResponse":{"type":"object","description":"Response envelope for `GET /platform/notification-templates`. The\ncatalog is bounded (kinds × channels × locales), so the list is\nreturned in full, ordered by `(kind, channel, locale)`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/NotificationTemplateRead"},"description":"All templates, ordered by `(kind, channel, locale)`."}}},"NotificationTemplateRead":{"type":"object","description":"One notification template row.","required":["kind","channel","locale","subject_template","body_template","created_at","updated_at"],"properties":{"body_template":{"type":"string","description":"Body template (`{{var}}` placeholders)."},"channel":{"type":"string","description":"Delivery channel: `\"email\"` / `\"sms\"` / `\"in_app\"`."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"kind":{"type":"string","description":"Dispatcher event slug (e.g. `\"subscription:expiring_in_7d\"`)."},"locale":{"type":"string","description":"Ish locale tag (e.g. `\"en\"`)."},"subject_template":{"type":"string","description":"Subject line template (`{{var}}` placeholders). Empty for\nin-app / sms channels that have no subject."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"NotificationTemplateUpsertRequest":{"type":"object","description":"Request body for `POST /platform/notification-templates` — upsert one\ntemplate by its composite key. Creates the row if absent, replaces the\n`subject_template` / `body_template` if present. `kind` and `channel`\nare validated handler-side (kind against the dispatcher catalog,\nchannel against the schema CHECK).","required":["kind","channel","subject_template","body_template"],"properties":{"body_template":{"type":"string","description":"Body template. Non-empty."},"channel":{"type":"string","description":"Delivery channel — `email` / `sms` / `in_app`."},"kind":{"type":"string","description":"Dispatcher event slug — must be a known kind."},"locale":{"type":["string","null"],"description":"Locale tag. Absent ⇒ `\"en\"`."},"subject_template":{"type":"string","description":"Subject line template. Empty string is allowed (in-app / sms)."}}},"NotificationUnreadResponse":{"type":"object","description":"Response for the two read-state writes — `POST /auth/notifications/{id}/read`\nand `POST /auth/notifications/read-all`. Carries the caller's\nremaining unread count so the inbox badge updates from the mutation\nresponse without a follow-up list fetch.","required":["unread_count"],"properties":{"unread_count":{"type":"integer","format":"int64","description":"The caller's remaining unread notifications after the write."}}},"OauthDeviceApproveRequest":{"type":"object","description":"Request body for `POST /auth/me/oauth/device/approve` — the\nuser-side approval. The user enters the\n`user_code` they read off the device's stdout into the\ndashboard's verification page; the frontend POSTs that to\nthis endpoint. The server is tolerant of case + dash\nformatting (the user might paste `qwxy-abcd` or `QWXYABCD`).","required":["user_code"],"properties":{"org_id":{"type":["string","null"],"format":"uuid","description":"The org the device joins. Defaults to the user's default org.\nThe user must be a member holding `devices:device:create` there."},"user_code":{"type":"string","description":"The human-typed code from the device. Free-form length\n8..=16 — server normalises (case-fold uppercase, strip\nnon-alnum) before lookup, so any form the user might\npaste resolves to the canonical `XXXX-XXXX` shape."}}},"OauthDeviceApproveResponse":{"type":"object","description":"Response body for `POST /auth/me/oauth/device/approve`. The\ndashboard shows the device's self-description back to the\nuser as a confirmation (\"you approved this Linux laptop\nnamed foo\"); the bearer is delivered to the *device* via\nPR14c's token-poll endpoint, never back to the user.","required":["device_metadata","approved"],"properties":{"approved":{"type":"boolean","description":"Always `true` on the 200 success path. Present for\nforward-compatible envelope shape rather than as a\nstatus flag."},"device_metadata":{"$ref":"#/components/schemas/DeviceMetadataInput","description":"Echo of the device's self-description, as the device\nsent it on `POST /oauth/device/code`. The dashboard\nrenders this verbatim — `\"approved: linux/laptop\nalice-laptop\"` or similar — so the user has a record\nof what they consented to."}}},"OauthDeviceStartRequest":{"type":"object","description":"Request body for `POST /oauth/device/code` — the device-flow\ninitiate. Anonymous. The body is the device's self-description\n(so the dashboard shows what's being approved) plus nothing\nelse — no client_id, no scopes (the flow is single-purpose).","required":["device_metadata"],"properties":{"device_metadata":{"$ref":"#/components/schemas/DeviceMetadataInput","description":"What the device says about itself, surfaced on the\ndashboard verification page so the user knows what they\napprove."}}},"OauthDeviceStartResponse":{"type":"object","description":"Response body for `POST /oauth/device/code` (RFC 8628 §3.2).\nThe `device_code` is the secret the device polls with — it is\nreturned EXACTLY ONCE; the server stores only its hash. The\n`user_code` is the short human-typed string the user enters on\nthe dashboard.","required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"],"properties":{"device_code":{"type":"string","description":"Opaque secret (`dvc_<base64url>`) the device polls\n`POST /oauth/device/token` with. Stored only as\n`oauth_device_codes.device_code_hash`; never recoverable."},"expires_in":{"type":"integer","format":"int64","description":"Seconds until the issued `device_code` expires. After\nthis, polling the token endpoint returns `expired_token`.\nMatches `oauth_device_codes.expires_at - created_at`."},"interval":{"type":"integer","format":"int64","description":"Suggested polling interval (seconds). The device MUST\nwait at least this long between successive\n`POST /oauth/device/token` requests; polling faster\ntriggers a `slow_down` response (RFC 8628 §3.5)."},"user_code":{"type":"string","description":"Short human-typed string the user enters on the\ndashboard. Formatted as `XXXX-XXXX` (8 alnum chars +\nmidpoint hyphen) for readability."},"verification_uri":{"type":"string","description":"Absolute URL of the verification page. Per RFC 8628 §3.2:\n\"The end-user verification URI on the authorization\nserver.\""},"verification_uri_complete":{"type":"string","description":"Convenience: `verification_uri` with `?user_code=…`\nappended (RFC 8628 §3.3.1). Lets the device render a\nsingle QR-code-able link the user can scan instead of\nreading both the URL and the code."}}},"OauthDeviceTokenRequest":{"type":"object","description":"Request body for `POST /auth/oauth/device/token` — the\ndevice-side poll. The device polls this endpoint\nat the cadence the initiate response's `interval` told it,\nholding the `device_code` it received once on initiate.\nAnonymous — the `device_code` is the credential.","required":["device_code"],"properties":{"device_code":{"type":"string","description":"The opaque `dvc_<…>` secret the device received from\n`POST /auth/oauth/device/code`. Length is bounded so a\npathological input can't OOM the hash function before\nthe early-reject path runs."}}},"OauthDeviceTokenResponse":{"type":"object","description":"Response body for `POST /auth/oauth/device/token` on the\nsuccess path. Same shape as `ClientJoinResponse` so the\ndevice-side client handles both join paths (CT-token paste\nand OAuth device-flow) through one deserialiser. The\n`cdv_…` bearer is returned EXACTLY ONCE here; the server\nstores only its hash.","required":["device_id","bearer_token","org_id"],"properties":{"bearer_token":{"type":"string","description":"Bearer plaintext (`cdv_<base64url>`) the daemon\npresents in `Authorization: Bearer …` for every future\nrequest. Stored server-side only as\n`client_devices.agent_key_hash` (SHA-256 + pepper);\nthe plaintext is never recoverable."},"device_id":{"type":"string","description":"UUIDv7 of the `client_devices` row the handler created\nin the same transaction as the consume."},"org_id":{"type":"string","description":"The org the new device joined under (the user's\ndefault org at approve time)."},"org_slug":{"type":["string","null"],"description":"Owning org's slug, when one is configured. Mirrors\n`ClientJoinResponse.org_slug` so the device-side\n`appsynergy login` CLI writes the same on-disk\n`ClientConfig` shape both join paths produce. `None`\nwhen `orgs.slug` is NULL (pre-trigger rows; modern\nsignups always have one via the personal-org trigger)."}}},"Op":{"oneOf":[{"type":"object","description":"`acc = acc + k` (wrapping).","required":["k","op"],"properties":{"k":{"type":"integer","format":"int32","description":"Operand.","minimum":0},"op":{"type":"string","enum":["add"]}}},{"type":"object","description":"`acc = acc * k` (wrapping).","required":["k","op"],"properties":{"k":{"type":"integer","format":"int32","description":"Operand.","minimum":0},"op":{"type":"string","enum":["mul"]}}},{"type":"object","description":"`acc = acc ^ k`.","required":["k","op"],"properties":{"k":{"type":"integer","format":"int32","description":"Operand.","minimum":0},"op":{"type":"string","enum":["xor"]}}},{"type":"object","description":"`acc = acc rotated left by r bits`.","required":["r","op"],"properties":{"op":{"type":"string","enum":["rotl"]},"r":{"type":"integer","format":"int32","description":"Bits, 1-31.","minimum":0}}},{"type":"object","description":"Put `s + String(acc)` in a new element's `textContent` and add the\n`length` it reads back (UTF-16 units).","required":["s","op"],"properties":{"op":{"type":"string","enum":["text"]},"s":{"type":"string","description":"Text."}}},{"type":"object","description":"Add `encodeURIComponent(s + String(acc)).length`.","required":["s","op"],"properties":{"op":{"type":"string","enum":["uri"]},"s":{"type":"string","description":"Text."}}},{"type":"object","description":"`acc = acc ^ first four bytes (big-endian) of SHA-256 of acc's four\nbig-endian bytes`, by `crypto.subtle.digest`.","required":["op"],"properties":{"op":{"type":"string","enum":["digest"]}}}],"description":"One step of a program."},"OrgAclRuleCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/acl-rules`. The\n`name` / `src_match` / `dst_match` / `action` fields are\nrequired; `priority` is optional (schema default 100). The\nhandler additionally rejects any `action` outside\n`{allow, deny}` as 422 `invalid` so a SQLite CHECK violation\nnever surfaces as a 500.","required":["name","src_match","dst_match","action"],"properties":{"action":{"type":"string","description":"`allow` or `deny`. The handler rejects any other value as\n422 `invalid`."},"dst_match":{"type":"string","description":"Destination matcher (opaque to the platform).\n`1 ≤ len ≤ 1024`."},"name":{"type":"string","description":"Display name for the rule. `1 ≤ len ≤ 64` at the wire\nlayer."},"priority":{"type":["integer","null"],"format":"int64","description":"Match priority — lower matches earlier.\n`0 ≤ value ≤ 10000` at the wire layer. Absent ⇒ the schema\ndefault (100) lands in the row."},"src_match":{"type":"string","description":"Source matcher (opaque to the platform). `1 ≤ len ≤ 1024`."}}},"OrgAclRuleDeleteResponse":{"type":"object","description":"Wire response for `DELETE /iam/orgs/{org_id}/acl-rules/{id}`.\nOne-field envelope mirroring\n`OrgAssumeGrantDeleteResponse` / `OrgSsoProviderDeleteResponse`\n/ `OrgPolicyConditionDeleteResponse`. The audit row is the\ncanonical record of removal detail.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgAclRuleListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/acl-rules`. A bare\nenvelope around a single `acl_rules` array — keeps the door\nopen to envelope-level fields (`total`, future cursor) without\nbreaking clients that already parse the array shape. Mirrors\n`CrossOrgAssumeGrantListResponse` / `SsoProviderListResponse` /\nother per-area list responses in `platform::iam`.","required":["acl_rules"],"properties":{"acl_rules":{"type":"array","items":{"$ref":"#/components/schemas/OrgAclRuleSummary"},"description":"ACL rules owned by the resolved org, ordered by\n`(priority ASC, id ASC)` — lowest priority first, with the\n`id ASC` tie-breaker keeping rows ordered when two seeds\nshare a priority value."}}},"OrgAclRuleSummary":{"type":"object","description":"Per-row projection of an `org_acl_rules` entry. Matches the\nschema's columns exactly so create / list / patch responses\nnever drift from the underlying row shape. Used as the response\nbody for the create / patch handlers (read-after-write so the\ncaller gets the canonical row without a second round trip) and\nas each item in [`OrgAclRuleListResponse::acl_rules`].","required":["id","org_id","name","src_match","dst_match","action","priority","created_at","updated_at"],"properties":{"action":{"type":"string","description":"`allow` or `deny` — the schema-level CHECK constraint\nenforces this set. The handler additionally rejects any\nother value as 422 `invalid` so a SQLite CHECK violation\nnever surfaces as a 500."},"created_at":{"type":"string","description":"RFC3339 timestamp the row was created."},"dst_match":{"type":"string","description":"Opaque destination matcher string, symmetric to\n[`OrgAclRuleSummary::src_match`]."},"id":{"type":"string","description":"UUIDv7 identifier of the rule row (matches\n`org_acl_rules.id`). Stable across the row's lifetime."},"name":{"type":"string","description":"Customer-supplied display name for the rule. Surfaces in\nthe dashboard's ACL editor; never used by the WG hub for\nmatching."},"org_id":{"type":"string","description":"UUIDv7 of the owning org (matches `org_acl_rules.org_id`).\nThe list endpoint scopes `WHERE org_id = ?` to the\npath-resolved id so a row's `org_id` always matches the\npath id."},"priority":{"type":"integer","format":"int64","description":"Match priority — lower values match earlier. The\n`idx_org_acl_rules_org_priority` index supports the\nordered scan the WG-hub allowed_ips computer needs."},"src_match":{"type":"string","description":"Opaque source matcher string the WG hub interprets when\ncomputing per-peer `allowed_ips`. The platform does NOT\nparse this — the agent's allowed_ips computer owns the\nmatcher language."},"updated_at":{"type":"string","description":"RFC3339 timestamp of the most recent successful write\n(created or patched)."}}},"OrgAclRuleUpdateRequest":{"type":"object","description":"Request body for `PATCH /iam/orgs/{org_id}/acl-rules/{id}`.\nAny subset of the mutable fields may be supplied; absent\nfields stay unchanged. An empty body is a 200 idempotent\nno-op — same precedent `org_sso_providers_patch` set.","properties":{"action":{"type":["string","null"],"description":"New action verb, when present. Same `{allow, deny}` bound\nas the create surface."},"dst_match":{"type":["string","null"],"description":"New destination matcher, when present."},"name":{"type":["string","null"],"description":"New display name, when present."},"priority":{"type":["integer","null"],"format":"int64","description":"New priority, when present."},"src_match":{"type":["string","null"],"description":"New source matcher, when present."}}},"OrgAssumeGrantCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/assume-grants`\n(the create slice). Five fields:\n`source_org_id` / `source_principal_id` /\n`source_principal_kind` (the polymorphic source-principal\ntriple), `allowed_role_name` (the role the grantee acts as\nin this target org), the optional bounded\n`max_session_seconds` (default 3600), and the optional\n`expires_at` (RFC3339; absent ⇒ open-ended).\n\nTarget org is bound from the path's `{org_id}` capture by\nthe handler — the body deliberately never names a target\norg so a malicious payload cannot steer the row away from\nthe org `Enforce` authorized.\n\n`source_principal_kind` is bounded to `user`,\n`service_account`, or `api_token` — the same set as the\nschema-level `CHECK (source_principal_kind IN (...))`\nconstraint. The handler maps any other value to a 422 with\nfield code `invalid` rather than letting the SQLite CHECK\nviolation surface as a 500.\n\n`allowed_role_name` is restricted to the customer-assignable\nsystem roles (`org_admin`, `billing_admin`, `vpn_operator`,\n`static_ips_operator`, `viewer`). Platform-only\n(`platform_admin`, `platform_support`) and machine-only\n(`router_agent`, `vpn_server`) roles are deliberately\nrejected so a target-org admin cannot escalate a foreign\nprincipal into a role customers cannot assign through the\ndashboard. Same precedent `org_sso_providers_create` set\nfor its `default_role_name` field.\n\n`max_session_seconds` is bounded `1 ≤ value ≤ 86400` at the\nwire layer — strictly positive matches the schema-level\n`CHECK (max_session_seconds > 0)`, and the 24-hour ceiling\ncaps a single assumed session at one day (longer sessions\nre-exchange through the source-side `POST /iam/assume`).\nAbsent ⇒ the schema default (3600) lands in the\nrow; the response surfaces the resolved value.\n\n`expires_at` when present is parsed as RFC3339 in the\nhandler and re-serialised back into a normalised UTC string\nbefore insert — the schema column is plain TEXT, but\nnormalising on the way in keeps the wire ↔ column round-trip\nstable. When absent, the grant is open-ended; the column\nstores NULL and the row projects `null` on subsequent reads.","required":["source_org_id","source_principal_id","source_principal_kind","allowed_role_name"],"properties":{"allowed_role_name":{"type":"string","description":"Role name the grantee acts as inside this target org.\nBounded `1 ≤ len ≤ 64` at the wire layer; the handler\nadditionally rejects any value outside the\ncustomer-assignable system roles\n(`org_admin`, `billing_admin`, `vpn_operator`,\n`static_ips_operator`, `viewer`) as 422."},"expires_at":{"type":["string","null"],"description":"Optional RFC3339 expiry timestamp. When absent, the grant\nis open-ended (column stored as NULL). When present, the\nhandler parses the string and re-serialises it back to a\nnormalised RFC3339 form before insert."},"max_session_seconds":{"type":["integer","null"],"format":"int64","description":"Upper bound on the assumed JWT's lifetime in seconds.\nBounded `1 ≤ value ≤ 86400` at the wire layer; absent\nresolves to the schema default (3600). The exchange\nendpoint applies this when minting the `exp` claim — the\nprincipal cannot request a session longer than the grant\nauthorised."},"source_org_id":{"type":"string","format":"uuid","description":"UUID of the source org — the home org the grantee\nprincipal lives in. The schema-level FK is\n`REFERENCES orgs(id) ON DELETE CASCADE`; an unknown id\nsurfaces as 422 `invalid_reference` rather than a 500."},"source_principal_id":{"type":"string","format":"uuid","description":"UUID of the principal authorised to assume into this\n(target) org. Polymorphic by design — matches `users.id`\nOR `service_accounts.id` OR `api_tokens.id`; the\n[`OrgAssumeGrantCreateRequest::source_principal_kind`]\nfield is the discriminator. Existence is NOT pre-checked\nhere; the exchange endpoint treats a row whose\nprincipal has since been deleted as absent."},"source_principal_kind":{"type":"string","description":"Discriminator for\n[`OrgAssumeGrantCreateRequest::source_principal_id`]. One\nof `user`, `service_account`, `api_token`. Bounded\n`1 ≤ len ≤ 64` at the wire layer; the handler\nadditionally rejects any value outside the allowed set\nas 422."}}},"OrgAssumeGrantDeleteResponse":{"type":"object","description":"Wire response for\n`DELETE /iam/orgs/{org_id}/assume-grants/{grant_id}`\n(the delete slice). One-field envelope mirroring\n`OrgResourceGrantDeleteResponse` /\n`OrgCustomRoleDeleteResponse` /\n`OrgSsoProviderDeleteResponse` /\n`OrgPolicyConditionDeleteResponse`. 200 OK on the success\npath; surfaces failure paths (gate-deny 403,\nmissing-row 404, unauth 401) through `ApiError` only.\nReserved for future structured fields without contract churn —\nthe audit row is the canonical record of removal detail.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgBetaFeaturesRead":{"type":"object","description":"`PATCH /platform/orgs/{id}/beta-features` response — the org's resolved\nbeta-feature flags after the write.","required":["org_id","quic"],"properties":{"org_id":{"type":"string","description":"The org whose beta flags these are."},"quic":{"type":"boolean","description":"QUIC beta-cohort membership (`orgs.beta_features.quic`)."}}},"OrgBetaFeaturesUpdateRequest":{"type":"object","description":"`PATCH /platform/orgs/{id}/beta-features` request body. Every flag is\noptional; `None` leaves the org's stored value for that flag unchanged.","properties":{"quic":{"type":["boolean","null"],"description":"Toggle the org's QUIC beta-cohort membership\n(`orgs.beta_features.quic`, the gate on `POST /quic/tunnels`).\n`Some(true)` ⇒ enrol; `Some(false)` ⇒ remove; `None` ⇒ no change."}},"additionalProperties":false},"OrgBillingDetails":{"type":"object","description":"An org's billing details.","properties":{"address_line1":{"type":["string","null"],"description":"Street address."},"address_line2":{"type":["string","null"],"description":"Second address line."},"billing_email":{"type":["string","null"],"description":"Where copies of invoices issued by appsynergy are also sent, once\nconfirmed. Never sent to Stripe."},"city":{"type":["string","null"],"description":"City."},"country":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code."},"name":{"type":["string","null"],"description":"Company or person name on invoices."},"postal_code":{"type":["string","null"],"description":"Postal code."},"region":{"type":["string","null"],"description":"State, province or region."},"tax_id":{"type":["string","null"],"description":"Tax ID (VAT number, EIN, …)."},"tax_id_type":{"type":["string","null"],"description":"Stripe's kind for the tax ID (`eu_vat`, `us_ein`, …)."}}},"OrgBillingDetailsRead":{"type":"object","description":"`GET`/`PUT` response.","required":["details"],"properties":{"billing_email_confirmation":{"type":["string","null"],"description":"After a save: `sent` (a confirmation link went out), `not_sent`\n(the mail failed), or `throttled` (one went out under 2 minutes ago,\nor 5 today; try later). `None` when no link was due, and on read."},"billing_email_confirmed":{"type":"boolean","description":"The billing email was confirmed through its link (or is the saver's\nown address). Invoice copies go to it only then."},"details":{"$ref":"#/components/schemas/OrgBillingDetails","description":"The details (all empty when never saved)."},"stripe_sync":{"type":["string","null"],"description":"After a save: `updated` (pushed to the org's Stripe customer),\n`no_customer`, `stripe_disabled` or `failed`. `None` on read."}}},"OrgCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs`. `name` and `kind` shape\nthe new `orgs` row; `admin_user_id` (optional) names the user to\ninstall as `org_admin` (defaults to caller). The `id` is server-\nminted as UUIDv7; clients cannot supply it.","required":["name","kind"],"properties":{"admin_user_id":{"type":["string","null"],"format":"uuid","description":"Optional UUIDv7 of the user to install as the new org's\n`org_admin` member. Absent ⇒ caller. Unknown id ⇒ 422\n`unknown_user`."},"kind":{"type":"string","description":"`orgs.kind` discriminant; handler validates against\n[`ORG_KINDS`]."},"name":{"type":"string","description":"Human display name. Bounded `1 ≤ len ≤ 200`."}}},"OrgCustomRoleCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/roles` (the\ncreate slice). Three required fields: `name` (the\norg-visible label), `description` (the longer human\nexplanation surfaced in the dashboard role-picker; defaults\nto `\"\"` at the column level so the client may send the empty\nstring), and `actions` (the action slugs the new role grants).\n\n`name` is bounded `1 ≤ len ≤ 200` to mirror\n`OrgCreateRequest::name` / `ServiceAccountCreateRequest::name`.\nThe lower bound refuses empty-string inserts because\n`org_custom_roles.name` is `NOT NULL`. The handler additionally\nsurfaces the SQLite UNIQUE-constraint violation on\n`(org_id, name)` as 422 with field code `name_taken`.\n\n`description` is bounded `len ≤ 1000`; the column carries\n`NOT NULL DEFAULT ''` so an absent / empty string is a valid\nshape rather than NULL. The 1000-char cap is generous for a\nhuman-readable label and keeps the row size bounded.\n\n`actions` is bounded `len ≤ 128` items, each entry\n`1 ≤ len ≤ 128` chars. Per-entry catalog-membership\n(`appsynergy_iam_types::is_known_action`) runs in the handler\nso validator's `code` stays decoupled from the action catalog.\nNo wildcards are accepted on this customer-facing surface —\nthe dashboard role-picker is checkbox-shaped\n(\"checkbox builder, never JSON\"); each checkbox maps\nto one exact catalog slug.","required":["name"],"properties":{"actions":{"type":"array","items":{"type":"string"},"description":"Action slugs the new role grants. Bounded `len ≤ 128`\nitems at the wire layer; each entry is `1 ≤ len ≤ 128`\nchars and must validate against\n`appsynergy_iam_types::is_known_action` in the handler.\nOrder is preserved on insert; duplicate slugs within the\nsame request collide on the `UNIQUE (custom_role_id,\naction_slug)` index and surface as 422."},"description":{"type":"string","description":"Free-text description surfaced in the dashboard\nrole-picker. Bounded `len ≤ 1000`; absent / empty is\na valid shape and persists as `''` in\n`org_custom_roles.description`."},"name":{"type":"string","description":"Human display label for the new role. Bounded\n`1 ≤ len ≤ 200`; the lower bound refuses empty-string\ninserts because `org_custom_roles.name` is `NOT NULL`.\nUNIQUE within the org — the handler returns 422 with\nfield code `name_taken` on duplicate."}}},"OrgCustomRoleDeleteResponse":{"type":"object","description":"Wire response for `DELETE /iam/orgs/{org_id}/roles/{role_id}`\n(the remove slice). One-field envelope mirroring\n`OrgDeleteResponse` / `ServiceAccountDeleteResponse` /\n`TokenRevokeResponse`. 200 OK on the success path;\nsurfaces failure paths (gate-deny 403, missing-row 404,\nrole-in-use 409) through `ApiError` only. Reserved for future\nstructured fields (e.g. `cascaded_action_count`) without contract\nchurn — the audit row is the canonical record of cascade detail\ntoday.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgCustomRoleListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/roles`. A\nbare object with a single `custom_roles` array — keeps the\ndoor open to add envelope-level fields (`total`, `has_more`,\nfuture cursor) without breaking clients that already parse\nthe array shape, mirroring `OrgMemberListResponse` /\n`ApiTokenListResponse` / `ServiceAccountListResponse`. Each\nitem reuses [`OrgCustomRoleSummary`] so a future schema\naddition cannot drift the list shape away from the per-row\nprojection.","required":["custom_roles"],"properties":{"custom_roles":{"type":"array","items":{"$ref":"#/components/schemas/OrgCustomRoleSummary"},"description":"Custom roles defined within the resolved org, ordered\nby `(created_at DESC, id DESC)` — newest first, with\nthe `id DESC` tie-breaker keeping rows ordered when two\nseeds land in the same RFC3339 second."}}},"OrgCustomRoleRead":{"type":"object","description":"Read-projection of an `org_custom_roles` row plus its\n`org_custom_role_actions` set, returned by\n`POST /iam/orgs/{org_id}/roles` and (next slice)\n`GET /iam/orgs/{org_id}/roles/{role_id}`.\n\nStrict superset of [`OrgCustomRoleSummary`] — every Summary\nfield appears here in the same shape, plus the per-row\n`actions` vector that the list endpoint omits. Establishing\nthis superset on the create slice fixes the singular GET's\nshape ahead; the singular endpoint reuses this struct\nfield-for-field rather than projecting a divergent shape.","required":["id","org_id","name","description","created_at","updated_at","action_count","actions"],"properties":{"action_count":{"type":"integer","format":"int64","description":"Number of `org_custom_role_actions` rows linked to this\ncustom role. Always equals `actions.len()` on this\nprojection; carried alongside the array so consumers that\nalready read [`OrgCustomRoleSummary::action_count`] off\nthe list endpoint observe a stable shape on the singular\nread."},"actions":{"type":"array","items":{"type":"string"},"description":"Action slugs this role grants, in insert order. Each\nentry is a known catalog slug — the create handler\nvalidates membership against\n`appsynergy_iam_types::is_known_action` before insert."},"created_at":{"type":"string","description":"RFC3339 timestamp the row was created (matches\n`org_custom_roles.created_at`)."},"description":{"type":"string","description":"Free-text description (matches\n`org_custom_roles.description`). Defaults to `\"\"` at the\ncolumn level; never `null` on the wire."},"id":{"type":"string","description":"UUIDv7 identifier of the custom role row (matches\n`org_custom_roles.id`). Stable across the row's\nlifetime even if `name` is renamed via PATCH."},"name":{"type":"string","description":"Org-visible label for the role (matches\n`org_custom_roles.name`). UNIQUE within the org."},"org_id":{"type":"string","description":"UUIDv7 identifier of the owning org (matches\n`org_custom_roles.org_id`). Constant across the row's\nlifetime — custom roles cannot be moved between orgs."},"updated_at":{"type":"string","description":"RFC3339 timestamp the row was last modified by a PATCH\n(matches `org_custom_roles.updated_at`). At create time\nequals `created_at`."}}},"OrgCustomRoleSummary":{"type":"object","description":"Per-row summary projected by `GET /iam/orgs/{org_id}/roles`\n(the foundation slice). One row per\n`org_custom_roles` table entry, scoped to the path-resolved\norg. The list endpoint omits the granted action set on\npurpose — the per-role action vector is loaded by the\nmatching singular endpoint\n`GET /iam/orgs/{org_id}/roles/{role_id}` (next slice). Until\nthe singular endpoint ships, the dashboard role-picker\nrenders this summary plus a deep-link to the singular URL\nfor the action checkboxes.\n\n`action_count` is included so the role-picker can show\n\"N permissions\" without having to round-trip every row.","required":["id","org_id","name","description","created_at","updated_at","action_count"],"properties":{"action_count":{"type":"integer","format":"int64","description":"Number of `org_custom_role_actions` rows linked to this\ncustom role — i.e., how many action slugs the role\ncurrently grants. Lets the role-picker render\n\"N permissions\" without round-tripping the singular\nendpoint for every row."},"created_at":{"type":"string","description":"RFC3339 timestamp the row was created (matches\n`org_custom_roles.created_at`)."},"description":{"type":"string","description":"Free-text description surfaced in the dashboard role\npicker (matches `org_custom_roles.description`).\nDefaults to `\"\"` at the column level; never `null` on\nthe wire."},"id":{"type":"string","description":"UUIDv7 identifier of the custom role row (matches\n`org_custom_roles.id`). Stable across the row's\nlifetime even if `name` is renamed via PATCH."},"name":{"type":"string","description":"Org-visible label for the role (matches\n`org_custom_roles.name`). UNIQUE within the org."},"org_id":{"type":"string","description":"UUIDv7 identifier of the owning org (matches\n`org_custom_roles.org_id`). Constant across the row's\nlifetime — custom roles cannot be moved between orgs."},"updated_at":{"type":"string","description":"RFC3339 timestamp the row was last modified by a PATCH\n(matches `org_custom_roles.updated_at`). At create time\nequals `created_at`."}}},"OrgCustomRoleUpdateRequest":{"type":"object","description":"Request body for `PATCH /iam/orgs/{org_id}/roles/{role_id}`\n(the mutate slice). Three independently\noptional fields: `name`, `description`, and `actions`. Absent\nfields leave the corresponding column / set unchanged; sending\n`{}` is a 200 no-op (the row's `updated_at` still advances so\nthe audit + readback pair always reflect \"this row was\nconfirmed at this timestamp\"). Same precedent as\n`service_account_patch.rs` / `org_patch.rs`.\n\n`name` when present is bounded `1 ≤ len ≤ 200` to mirror\n[`OrgCustomRoleCreateRequest::name`]. The handler additionally\nsurfaces the SQLite UNIQUE-constraint violation on\n`(org_id, name)` as 422 with field code `name_taken`.\n\n`description` when present is bounded `len ≤ 1000`; the column\ncarries `NOT NULL DEFAULT ''` so the empty string is valid.\n\n`actions` when present is a full-set replace (not a diff). The\ndashboard role-picker always submits the complete checkbox set\n— the handler DELETEs every existing\n`org_custom_role_actions` row for the role inside one\ntransaction and reinserts the new vector in order. Bounded\n`len ≤ 128` items, each entry `1 ≤ len ≤ 128` chars; per-entry\ncatalog membership runs in the handler (decoupled from\nvalidator's `code`).","properties":{"actions":{"type":["array","null"],"items":{"type":"string"},"description":"Replacement action set. When absent, the existing action\nvector stays unchanged; when present, the role's full\naction set is rewritten to the supplied vector inside one\ntransaction. `Some(vec![])` is a valid shape and clears\nthe role's actions entirely. Bounded `len ≤ 128` items;\neach entry is `1 ≤ len ≤ 128` chars and must validate\nagainst `appsynergy_iam_types::is_known_action` in the\nhandler."},"description":{"type":["string","null"],"description":"New free-text description. When absent, `description`\nstays unchanged; when present, bounded `len ≤ 1000`.\n`Some(\"\")` is a valid shape and persists as `''` in\n`org_custom_roles.description`."},"name":{"type":["string","null"],"description":"New display label for the role. When absent, `name` stays\nunchanged; when present, bounded `1 ≤ len ≤ 200` and must\nnot collide with another `(org_id, name)` pair (handler\nsurfaces UNIQUE violation as 422 `name_taken`)."}}},"OrgDeleteResponse":{"type":"object","description":"Wire response for `DELETE /iam/orgs/{org_id}`. One-field\nenvelope mirroring `OrgMemberRemoveResponse` /\n`PasskeyCredentialDeleteResponse`. 200 OK on the success path;\nsurfaces failure paths (resource-present 409, gate-deny\n403, missing-row 404) through `ApiError` only. Reserved for\nfuture structured fields (e.g., `cascaded_member_count`) without\ncontract churn.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgDevicePolicyRead":{"type":"object","description":"GET response and the PATCH 200 response — the org's resolved\ndevice-compliance policy (the handler returns the post-update row\nso callers see the new state without a follow-up GET, matching\nthe `crypto_patch` / `system_patch` precedent).","required":["org_id","require_disk_encryption","require_screen_lock","require_firewall","enforcement_mode","updated_at"],"properties":{"enforcement_mode":{"type":"string","description":"`report` (the daemon surfaces non-compliance locally, never\nblocks) or `block` (the daemon refuses to bring the tunnel\nup while any required attribute is unmet). Schema DEFAULT is\n`'report'`."},"min_agent_version":{"type":["string","null"],"description":"Minimum daemon/agent version string devices must report, or\n`None` when the org sets no floor. Nullable TEXT in the\nschema; compared against `client_devices.reported_version`\n(the daemon binary's own version) using the same\ndotted-numeric ordering as `min_os_version`."},"min_os_version":{"type":["string","null"],"description":"Minimum OS version string devices must report, or `None` when\nthe org sets no floor. Nullable TEXT in the schema; free-form,\ncompared against `client_devices.os_version` using\ndotted-numeric ordering ([`super::device_posture::version_at_least`])."},"org_id":{"type":"string","description":"The org this policy belongs to (matches\n`org_device_policies.org_id`)."},"require_disk_encryption":{"type":"boolean","description":"Every joined device in the org must attest full-disk\nencryption. Backed by the schema's integer-bool\n`require_disk_encryption` column; the wire form is a plain\nbool."},"require_firewall":{"type":"boolean","description":"Every joined device in the org must attest an active\nfirewall. Same integer-bool contract as\n`require_disk_encryption`."},"require_screen_lock":{"type":"boolean","description":"Every joined device in the org must attest an active\nscreen-lock policy. Same integer-bool contract as\n`require_disk_encryption`."},"updated_at":{"type":"string","description":"RFC3339 timestamp of the most recent successful write (or\nthe lazy-default epoch-zero stamp when no row exists yet)."}}},"OrgDevicePolicyUpdateRequest":{"type":"object","description":"`PATCH /iam/orgs/{org_id}/device-policy` request body. Every\nfield is optional; `None` leaves the org's stored value for that\nfield unchanged (delta-only, same convention as\n`OrgBetaFeaturesUpdateRequest` / `CryptoSettingsUpdate`).\n`min_os_version: Some(\"\")` clears the floor back to `NULL` — the\n`crypto_patch` trim-to-empty convention for nullable\nTEXT columns.","properties":{"enforcement_mode":{"type":["string","null"],"description":"New `enforcement_mode`, when present. The handler rejects\nany value outside `{report, block}` as 422 `invalid`."},"min_agent_version":{"type":["string","null"],"description":"New minimum agent-version floor, when present. Same\ntrim-to-empty-clears convention as `min_os_version`."},"min_os_version":{"type":["string","null"],"description":"New minimum OS-version floor, when present. `Some(\"\")` clears\nthe floor to `NULL`; `Some(non_empty)` sets it;\n`None` ⇒ unchanged. `1 ≤ len ≤ 32` at the wire layer (the\nempty string is exempt from the lower bound — it is the\nclear signal, not a value)."},"require_disk_encryption":{"type":["boolean","null"],"description":"`Some(true)` ⇒ require disk encryption org-wide;\n`Some(false)` ⇒ drop the requirement; `None` ⇒ unchanged."},"require_firewall":{"type":["boolean","null"],"description":"`Some(true)` ⇒ require an active firewall org-wide;\n`Some(false)` ⇒ drop the requirement; `None` ⇒ unchanged."},"require_screen_lock":{"type":["boolean","null"],"description":"`Some(true)` ⇒ require an active screen lock org-wide;\n`Some(false)` ⇒ drop the requirement; `None` ⇒ unchanged."}},"additionalProperties":false},"OrgDevicePostureComplianceResponse":{"type":"object","description":"Response body for `GET /iam/orgs/{org_id}/device-policy/compliance`.","required":["policy","devices","compliant_count","non_compliant_count"],"properties":{"compliant_count":{"type":"integer","format":"int64","description":"Count of `devices` entries with `compliant = true`. Precomputed\nso the dashboard summary tile does not re-scan the array."},"devices":{"type":"array","items":{"$ref":"#/components/schemas/DevicePostureCompliance"},"description":"One entry per joined/paused device in the org, ordered by\n`device_name ASC` for a stable dashboard listing."},"non_compliant_count":{"type":"integer","format":"int64","description":"Count of `devices` entries with `compliant = false`."},"policy":{"$ref":"#/components/schemas/OrgDevicePolicyRead","description":"The org's resolved device-compliance policy — the same\nprojection `GET /iam/orgs/{org_id}/device-policy` returns, so\nthe dashboard renders one policy source alongside its verdicts."}}},"OrgManagedConfigRead":{"type":"object","description":"GET response and the PATCH 200 response — the org's resolved\nmanaged device configuration (the handler returns the post-update\nrow so callers see the new state without a follow-up GET, matching\nthe `org_device_policy_patch` precedent).","required":["org_id","default_kill_switch","default_auto_connect","allowed_networks","blocked_networks","update_channel","updated_at"],"properties":{"allowed_networks":{"type":"array","items":{"type":"string"},"description":"SSIDs / network identifiers the org allows devices to treat as\ntrusted (kill switch off, tunnel optional)."},"blocked_networks":{"type":"array","items":{"type":"string"},"description":"SSIDs / network identifiers the org forbids devices from\njoining while the tunnel is required."},"default_auto_connect":{"type":"boolean","description":"Org-wide starting value for a newly joined device's\nalways-on / auto-connect behavior. A device's own PATCHed\nvalue still wins once set."},"default_kill_switch":{"type":"boolean","description":"Org-wide starting value for a newly joined device's kill\nswitch. A device's own PATCHed value still wins once set."},"enforced_dns_filter":{"type":["string","null"],"description":"DNS filter-list slug every joined device in the org must apply,\nor `None` when the org mandates no filter. Free-form, applied\nby the daemon directly rather than validated against the live\nfilter catalog."},"org_id":{"type":"string","description":"The org this config belongs to (matches\n`org_managed_configs.org_id`)."},"update_channel":{"type":"string","description":"`stable` or `beta` — the org's preferred client update track.\nSchema DEFAULT is `'stable'`."},"updated_at":{"type":"string","description":"RFC3339 timestamp of the most recent successful write (or the\nlazy-default epoch-zero stamp when no row exists yet)."}}},"OrgManagedConfigUpdateRequest":{"type":"object","description":"`PATCH /iam/orgs/{org_id}/managed-config` request body. Every field\nis optional; `None` leaves the org's stored value for that field\nunchanged (delta-only, same convention as `OrgDevicePolicyUpdateRequest`).\n`enforced_dns_filter: Some(\"\")` clears it back to `NULL` — the\n`org_device_policy_patch` trim-to-empty convention for nullable\nTEXT columns.","properties":{"allowed_networks":{"type":["array","null"],"items":{"type":"string"},"description":"Replace `allowed_networks`, when present. The handler rejects\nmore than [`MANAGED_CONFIG_NETWORKS_MAX`] entries as 400\n`allowed_networks_too_many` (same shape as `devices_patch`'s\n`trusted_networks` bound)."},"blocked_networks":{"type":["array","null"],"items":{"type":"string"},"description":"Replace `blocked_networks`, when present. Same\n[`MANAGED_CONFIG_NETWORKS_MAX`] bound, checked independently of\n`allowed_networks`."},"default_auto_connect":{"type":["boolean","null"],"description":"`Some(true)` ⇒ new devices default to auto-connect-on;\n`Some(false)` ⇒ default off; `None` ⇒ unchanged."},"default_kill_switch":{"type":["boolean","null"],"description":"`Some(true)` ⇒ new devices default to kill-switch-on;\n`Some(false)` ⇒ default off; `None` ⇒ unchanged."},"enforced_dns_filter":{"type":["string","null"],"description":"New enforced DNS filter slug, when present. `Some(\"\")` clears\nit to `NULL`; `Some(non_empty)` sets it; `None` ⇒ unchanged.\n`1 ≤ len ≤ 64` (the empty string is exempt — it is the clear\nsignal, not a value)."},"update_channel":{"type":["string","null"],"description":"New `update_channel`, when present. The handler rejects any\nvalue outside `{stable, beta}` as 422 `invalid`."}},"additionalProperties":false},"OrgMember":{"type":"object","description":"One row of `GET /iam/orgs/{org_id}/members`. Joins `org_members`\nagainst `users` to surface the human-recognisable `email` alongside\nthe membership row's metadata.\n\n`accepted_at` is `Option<String>` because `org_members.accepted_at`\nis nullable for pending-invite rows; the personal-org trigger\nshipped sets `accepted_at = invited_at` for the\nauto-membership row, so post-signup users always project both\ntimestamps populated and only outstanding invites surface JSON\n`null`.","required":["user_id","email","role_name","invited_at"],"properties":{"accepted_at":{"type":["string","null"],"description":"RFC3339 timestamp the invite was accepted; `null` for pending\ninvites that the recipient has not yet confirmed."},"avatar":{"type":["string","null"],"description":"The member's library avatar key (`users.avatar`); `None` means\ninitials on a colour derived from `user_id`."},"email":{"type":"string","description":"The member's email address (matches `users.email`)."},"invited_at":{"type":"string","description":"RFC3339 timestamp the invite was issued."},"role_name":{"type":"string","description":"System role slug the member holds within the org (matches\n`org_members.role_name` ⊆ `appsynergy_iam_types::SYSTEM_ROLES`)."},"user_id":{"type":"string","description":"UUIDv7 identifier of the member's user row (matches `users.id`)."}}},"OrgMemberInviteRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/invite` — the direct-add\nmember-invite surface. Two required fields. The owning org is\nbound from the URL path's `{org_id}` capture, never from the body —\npreventing a malicious payload from steering the new `org_members`\nrow into a different org than the path's `Enforce` gate authorized.\n\n`user_id` references the existing platform user to install as a\nmember; the handler validates the id against the `users` table\ninside the same transaction and surfaces 422 `unknown_user` on\nmiss (same shape as `OrgCreateRequest::admin_user_id`).\n\n`role_name` is bounded `min = 1, max = 64` — the same wire-layer\nshape as `MemberRoleAssignRequest::role_name` and\n`ServiceAccountCreateRequest::role_name`. The role-catalog\nmembership check (must be in `CUSTOMER_ASSIGNABLE_ROLES`) runs in\nthe handler so platform-only and service-only roles cannot be\nslipped through this customer-facing surface even by a\n`platform_admin` caller.","required":["user_id","role_name"],"properties":{"role_name":{"type":"string","description":"System role slug the new member holds within the org.\nRequired; must be one of `CUSTOMER_ASSIGNABLE_ROLES` (the\nrole-catalog membership check runs in the handler).\nLength-bounded `1 ≤ len ≤ 64` at the wire layer."},"user_id":{"type":"string","format":"uuid","description":"UUIDv7 of the existing platform user to add as a member.\nValidated against the `users` table inside the handler's\ntransaction; an unknown id surfaces 422 `unknown_user`."}}},"OrgMemberListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/members`. A bare object\nwith a single `members` array — keeps the door open to add\nenvelope-level fields (`total`, `has_more`, future cursor) without\nbreaking clients that already parse the array shape.","required":["members"],"properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/OrgMember"},"description":"Members of the resolved org, ordered by `(invited_at, user_id)`."}}},"OrgMemberRemoveResponse":{"type":"object","description":"Wire response for `DELETE /iam/orgs/{org_id}/members/{user_id}`.\nOne-field envelope — mirrors the existing\n`PasskeyCredentialDeleteResponse` / `DeleteAccountResponse`\nprecedent. 200 OK on the success path; surfaces failure\npaths through `ApiError` only. Reserved for future structured\nfields (e.g., `last_admin_in_other_orgs`) without contract\nchurn.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgPolicyConditionCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/policy-conditions`\n(the create slice). Four fields: the polymorphic\n`(attached_to_kind, attached_to_id)` parent pointer, the bounded\n`condition_kind` discriminator, and the per-kind opaque\n`condition_json` payload.\n\n`attached_to_kind` is bounded to `custom_role`, `resource_grant`,\nor `api_token` — the same set as the schema-level\n`CHECK (attached_to_kind IN (...))` constraint. The handler maps\nany other value to a 422 with field code `invalid` rather than\nletting the SQLite CHECK violation surface as a 500. The\nmatching `attached_to_id` is validated as a parseable UUID by\nthe request's `Uuid` field type; the create handler does the\nper-kind existence + cross-org isolation lookup at request time\n(org A cannot attach a condition onto org B's parent row).\n\n`condition_kind` is bounded to `ip_cidr_allowlist`,\n`time_of_day`, `mfa_required`, `user_agent_match`, `device_posture`\n— the same set as the schema-level CHECK. The handler validates\n`condition_json`\nagainst the per-kind contract before insert (the per-kind shape\ndocs live on the matching evaluator module, which the create\nhandler imports for the validate-only entry point).","required":["attached_to_kind","attached_to_id","condition_kind","condition_json"],"properties":{"attached_to_id":{"type":"string","format":"uuid","description":"UUID of the parent the condition is attached to. Polymorphic by\ndesign — matches `org_custom_roles.id` OR `resource_grants.id`\nOR `api_tokens.id`; the\n[`OrgPolicyConditionCreateRequest::attached_to_kind`] field is\nthe discriminator. The schema carries no FK because the\n`attached_to_kind` decides which IAM table this id points at;\nthe create handler does the per-kind existence lookup at\nrequest time."},"attached_to_kind":{"type":"string","description":"Discriminator for [`OrgPolicyConditionCreateRequest::attached_to_id`].\nOne of `custom_role`, `resource_grant`, `api_token`. Bounded\n`1 ≤ len ≤ 64` at the wire layer; the handler additionally\nrejects any value outside the allowed set as 422."},"condition_json":{"type":"object","description":"Per-kind opaque condition payload. The shape is validated in\nthe create handler against the per-kind evaluator's contract\n— for example `ip_cidr_allowlist` requires\n`{ \"cidrs\": [\"10.0.0.0/8\", ...] }`, `time_of_day` requires\n`{ \"start\": \"09:00\", \"end\": \"18:00\", \"timezone\": \"UTC\" }`,\n`mfa_required` requires `{ \"max_age_minutes\": 30 }`,\n`user_agent_match` requires `{ \"regex\": \"...\" }`, and\n`device_posture` requires\n`{ \"require\": [\"disk_encryption\", ...] }`.\nJSON-encoded into `policy_conditions.condition_json` at\ninsert."},"condition_kind":{"type":"string","description":"Bounded condition kind. One of `ip_cidr_allowlist`,\n`time_of_day`, `mfa_required`, `user_agent_match`,\n`device_posture`. Bounded `1 ≤ len ≤ 64` at the wire layer; the\nhandler additionally rejects any value outside the allowed set\nas 422."}}},"OrgPolicyConditionDeleteResponse":{"type":"object","description":"Wire response for `DELETE /iam/orgs/{org_id}/policy-conditions/{condition_id}`\n(the delete slice). One-field envelope mirroring\n`OrgResourceGrantDeleteResponse` / `OrgCustomRoleDeleteResponse` /\n`OrgDeleteResponse`. 200 OK on the success path; surfaces\nfailure paths (gate-deny 403, missing-row 404, unauth 401)\nthrough `ApiError` only. Reserved for future structured fields\nwithout contract churn — the audit row is the canonical record of\nremoval detail.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgRead":{"type":"object","description":"Read-projection of an `orgs` row returned by `GET /iam/orgs/{org_id}`.\n\nMirrors the column shape of `0001_iam_init.sql`'s `orgs` table. The\n`kind` discriminant is constrained at the schema layer (CHECK\n`kind IN ('personal', 'team', 'platform')`) so the wire field is a\nplain `String` rather than a Rust enum — adding a new kind ships in\none schema migration without a breaking-wire-type change downstream.","required":["id","name","kind","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 timestamp the row was created."},"id":{"type":"string","description":"UUIDv7 identifier of the org (matches `orgs.id`)."},"kind":{"type":"string","description":"Org kind — one of `personal`, `team`, `platform`."},"name":{"type":"string","description":"Human display name (matches `orgs.name`)."},"updated_at":{"type":"string","description":"RFC3339 timestamp the row was last updated."}}},"OrgResourceGrantCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/grants` (the\ncreate slice). Six fields: `principal_id` /\n`principal_kind` (the polymorphic principal pair), `resource_kind`\n/ `resource_id` (the polymorphic resource pair), `granted_actions`\n(the bounded action set the grant carries), and the optional\n`expires_at` (RFC3339; absent ⇒ open-ended).\n\n`principal_kind` is bounded to `user`, `service_account`, or\n`api_token` — the same set as the schema-level\n`CHECK (principal_kind IN (...))` constraint. The handler maps\nany other value to a 422 with field code `invalid` rather than\nletting the SQLite CHECK violation surface as a 500. The\nmatching `principal_id` is validated as a parseable UUID by\nthe request's `Uuid` field type; the resolver extension\nshipping in a later B-* slice does the per-kind existence\nlookup at request time, so this slice stores the polymorphic\npair as-is rather than pre-validating the principal's\nexistence here.\n\n`resource_kind` is bounded to `subscription`, `tunnel`,\n`public_ip`, `binding`, `dns_zone` — the same set as the\nschema-level `CHECK (resource_kind IN (...))` constraint. The\nhandler maps any other value to a 422 with field code\n`invalid`. `resource_id` is a parseable UUID; the same per-kind\nexistence lookup at the resolver extension boundary applies.\n\n`granted_actions` is bounded `len ≤ 128` items, each entry\n`1 ≤ len ≤ 128` chars. Per-entry catalog-membership\n(`appsynergy_iam_types::is_known_action`) runs in the handler\nso validator's `code` stays decoupled from the action catalog.\nNo wildcards are accepted on this customer-facing surface —\nthe dashboard grant-builder is checkbox-shaped;\neach checkbox maps to one exact catalog slug.\n`granted_actions` may be empty (a no-op grant); the value is\nJSON-encoded into `resource_grants.granted_actions` at insert.\n\n`expires_at` when present is parsed as RFC3339 in the handler\nand re-serialised back into a normalised string before insert\n— the schema column is plain TEXT, but normalising on the way\nin keeps the wire <-> column round-trip stable. When absent,\nthe grant is open-ended; the column stores NULL and the row\nprojects `null` on subsequent reads.","required":["principal_id","principal_kind","resource_kind","resource_id"],"properties":{"expires_at":{"type":["string","null"],"description":"Optional RFC3339 expiry timestamp. When absent, the grant is\nopen-ended (column stored as NULL). When present, the handler\nparses the string and re-serialises it back to a normalised\nRFC3339 form before insert."},"granted_actions":{"type":"array","items":{"type":"string"},"description":"Action slugs this grant carries. Bounded `len ≤ 128` items\nat the wire layer; each entry is `1 ≤ len ≤ 128` chars and\nmust validate against `appsynergy_iam_types::is_known_action`\nin the handler. JSON-encoded into the column on insert."},"principal_id":{"type":"string","format":"uuid","description":"UUID of the principal the grant is bound to. Polymorphic by\ndesign — matches `users.id` OR `service_accounts.id` OR\n`api_tokens.id`; the [`OrgResourceGrantCreateRequest::principal_kind`]\nfield is the discriminator. The wire field is the UUID\nstring; the handler uses `Uuid::parse_str` indirectly via\nserde's UUID deserializer to refuse malformed inputs as\n422 at the wire layer."},"principal_kind":{"type":"string","description":"Discriminator for [`OrgResourceGrantCreateRequest::principal_id`].\nOne of `user`, `service_account`, `api_token`. Bounded\n`1 ≤ len ≤ 64` at the wire layer; the handler additionally\nrejects any value outside the allowed set as 422."},"resource_id":{"type":"string","format":"uuid","description":"UUID of the resource the grant covers. The schema carries\nno FK on this column because `resource_kind` decides which\nproduct schema this id points at; the resolver extension\ndoes the per-kind lookup at request time."},"resource_kind":{"type":"string","description":"Discriminator for [`OrgResourceGrantCreateRequest::resource_id`].\nOne of `subscription`, `tunnel`, `public_ip`, `binding`,\n`dns_zone`. Bounded `1 ≤ len ≤ 64` at the wire layer; the\nhandler additionally rejects any value outside the allowed\nset as 422."}}},"OrgResourceGrantDeleteResponse":{"type":"object","description":"Wire response for `DELETE /iam/orgs/{org_id}/grants/{grant_id}`\n(the delete slice). One-field envelope mirroring\n`OrgCustomRoleDeleteResponse` / `OrgDeleteResponse` /\n`ServiceAccountDeleteResponse` / `TokenRevokeResponse`. 200 OK on\nthe success path; surfaces failure paths (gate-deny 403,\nmissing-row 404, unauth 401) through `ApiError` only. Reserved\nfor future structured fields without contract churn — the audit\nrow is the canonical record of removal detail.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgRole":{"type":"object","description":"One organisation membership.","required":["org_id","name","role"],"properties":{"name":{"type":"string","description":"Org name."},"org_id":{"type":"string","description":"Org id."},"role":{"type":"string","description":"Role in it."}}},"OrgSsoCallbackResponse":{"type":"object","description":"Response body. Same shape as\n[`crate::platform::auth::types::LoginResponse`] so a\nnon-browser SSO client consumes the JWT identically.","required":["user_id"],"properties":{"user_id":{"type":"string","description":"UUIDv7 of the authenticated user."}}},"OrgSsoProviderCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/sso-providers`\n(the create slice). Six required fields plus three\noptional with schema-default fallbacks.\n\n`provider_kind` is bounded to `oidc` or `saml2` — the same set\nas the schema-level `CHECK (provider_kind IN (...))`\nconstraint. The handler maps any other value to a 422 with\nfield code `invalid` rather than letting the SQLite CHECK\nviolation surface as a 500.\n\n`client_secret` is the IdP-issued plaintext OAuth2/OIDC client\nsecret (or SAML2 IdP-issued private credential). The\nhandler wraps the value with `aead_encrypt(settings_enc_key,\n...)` before insert and stores the resulting ciphertext in\n`client_secret_ct`. The plaintext NEVER appears on any read\nsurface, in any audit row, or in any log line — the column\nat rest is the AEAD ciphertext (`_ct` suffix mandatory) and\nthe read-side projection structurally OMITS it.\n\n`default_role_name`, when supplied, must be one of the\ncustomer-assignable system roles (`org_admin`,\n`billing_admin`, `vpn_operator`, `static_ips_operator`,\n`viewer`). The platform-only roles (`platform_admin`,\n`platform_support`) and the machine-only roles (`router_agent`,\n`vpn_server`) are rejected with field code `invalid` so a\nsuccessful SSO callback that auto-provisions an unknown user\ncannot escalate them into a platform-tier role. When omitted,\nthe schema-level DEFAULT (`viewer`) takes effect.","required":["provider_kind","display_name","issuer_url","client_id","client_secret","discovery_url"],"properties":{"auto_provision":{"type":["boolean","null"],"description":"Optional flag — when `true`, a successful callback\nresolving to an unknown user auto-creates the member;\nwhen `false` (or absent), the schema-level DEFAULT (`0`)\ntakes effect and unknown users are rejected."},"client_id":{"type":"string","description":"OAuth2 / OIDC `client_id` (or SAML2 entity id). Bounded\n`1 ≤ len ≤ 256`. Public by definition — echoed verbatim on\nthe read surface and in the audit metadata."},"client_secret":{"type":"string","description":"OAuth2 / OIDC `client_secret` plaintext. Bounded\n`1 ≤ len ≤ 2048`. **NEVER echoed on any read surface, in\nany audit row, or in any log line.** The handler wraps\nthe value with `aead_encrypt(settings_enc_key, ..., nonce)`\nbefore insert; the column at rest is the AEAD\nciphertext (`client_secret_ct`)."},"default_role_name":{"type":["string","null"],"description":"Optional role name applied to an auto-provisioned member.\nBounded `1 ≤ len ≤ 64` when present. Must be one of the\ncustomer-assignable system roles — the handler rejects\nany other value with field code `invalid`. Absent ⇒ the\nschema-level DEFAULT (`viewer`) takes effect."},"discovery_url":{"type":"string","description":"OIDC discovery document URL or SAML2 metadata URL. Bounded\n`1 ≤ len ≤ 512`."},"display_name":{"type":"string","description":"Human-readable label rendered in the dashboard's IdP\npicker and on the corporate-login button. Bounded\n`1 ≤ len ≤ 128`."},"issuer_url":{"type":"string","description":"IdP issuer URL. Bounded `1 ≤ len ≤ 512`. The\n`(org_id, provider_kind, issuer_url)` UNIQUE tuple keeps\nduplicates out within an org — a second create against\nthe same tuple surfaces as 409 Conflict."},"provider_kind":{"type":"string","description":"Bounded protocol kind. Must be `oidc` or `saml2`. Bounded\n`1 ≤ len ≤ 16` at the wire layer; the handler additionally\nrejects any value outside the allowed set as 422."},"scopes":{"type":["string","null"],"description":"Optional space-separated OAuth2 scope list. Bounded\n`len ≤ 256` when present. Absent ⇒ the schema-level\nDEFAULT (`openid email profile`) takes effect."}}},"OrgSsoProviderDeleteResponse":{"type":"object","description":"Wire response for `DELETE /iam/orgs/{org_id}/sso-providers/{provider_id}`\n(the remove slice). One-field envelope mirroring\n`OrgCustomRoleDeleteResponse` / `OrgResourceGrantDeleteResponse` /\n`OrgDeleteResponse` / `ServiceAccountDeleteResponse` /\n`TokenRevokeResponse`. 200 OK on the success path; surfaces\nfailure paths (gate-deny 403, missing-row 404) through `ApiError`\nonly. Reserved for future structured fields without contract churn\n— the audit row is the canonical record of removal detail today.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for forward-\ncompatible envelope shape rather than as a status flag."}}},"OrgSsoProviderTestResponse":{"type":"object","description":"Wire response for\n`POST /iam/orgs/{org_id}/sso-providers/{provider_id}/test`\n(the diagnostic slice). Diagnostic endpoints by\nconvention surface a stable structured outcome on every reached-\nthe-handler attempt; the HTTP status stays 200 even when the\nupstream IdP fails to validate (the HTTP request itself\nsucceeded; only the diagnostic answer changed). The 401 / 403 /\n404 paths still flow through [`crate::error::ApiError`] for\nauth-gate and row-miss cases.\n\n`ok = true` ⇒ every populated optional field carries the\nupstream-resolved value; `reason` and `message` are absent.\n`ok = false` ⇒ `reason` is one of the stable diagnostic codes\n(`unsupported_kind`, `discovery_unreachable`,\n`discovery_non_2xx`, `discovery_unparseable`, `issuer_mismatch`,\n`jwks_unreachable`, `jwks_non_2xx`, `jwks_unparseable`,\n`jwks_empty`) and `message` is a short human-readable summary;\nthe upstream-resolved fields are absent.\n\nEvery field on this struct is structurally non-secret —\nthe `client_secret_ct` AEAD ciphertext at rest is NOT projected\nhere, and the diagnostic flow does not need the secret to fetch\nthe discovery doc / JWKS (those upstream calls are unauthenticated\nper RFC 8414 / RFC 7517).","required":["ok","tested_at"],"properties":{"authorization_endpoint":{"type":["string","null"],"description":"`authorization_endpoint` advertised by the discovery doc on\nthe success path. Absent on every failure path."},"issuer":{"type":["string","null"],"description":"Issuer URL parsed from the discovery doc on the success\npath — equal to the configured `issuer_url`. Absent on\nevery failure path (the discovery doc may not have parsed\nor may have advertised a different issuer)."},"jwks_keys_count":{"type":["integer","null"],"format":"int32","description":"Number of signing keys parsed from the JWKS document on\nthe success path. Strictly positive (a JWKS with `keys: []`\nis the `jwks_empty` failure outcome). Absent on every\nfailure path.","minimum":0},"jwks_uri":{"type":["string","null"],"description":"`jwks_uri` advertised by the discovery doc on the success\npath. Absent on every failure path."},"message":{"type":["string","null"],"description":"Short human-readable summary of the failure on the\n`ok = false` path; absent on success. Suitable for\nrendering verbatim in the dashboard's diagnostic widget."},"ok":{"type":"boolean","description":"`true` on the success path; `false` on every diagnostic\nfailure path. Maps directly onto the audit row's\n`result` field (`succeeded` / `failed`)."},"reason":{"type":["string","null"],"description":"Stable machine-readable failure code on the `ok = false`\npath; absent on success. One of `unsupported_kind`,\n`discovery_unreachable`, `discovery_non_2xx`,\n`discovery_unparseable`, `issuer_mismatch`,\n`jwks_unreachable`, `jwks_non_2xx`, `jwks_unparseable`,\n`jwks_empty`."},"tested_at":{"type":"string","description":"RFC3339 timestamp the test was attempted at — equal to\nthe audit row's `ts`."},"token_endpoint":{"type":["string","null"],"description":"`token_endpoint` advertised by the discovery doc on the\nsuccess path. Absent on every failure path."}}},"OrgSsoProviderUpdateRequest":{"type":"object","description":"Request body for `PATCH /iam/orgs/{org_id}/sso-providers/{provider_id}`\n(the update slice). Every field independently\noptional — absent fields leave the corresponding column\nunchanged. Sending `{}` is a 200 idempotent no-op.\n\n`provider_kind` is **deliberately absent** from this request type:\nswitching protocols across the same row would break the meaning of\nevery prior audit event referencing the row, and the schema's\nUNIQUE `(org_id, provider_kind, issuer_url)` tuple would still\nallow a coexisting row of the original kind anyway. A customer who\nneeds to switch protocols deletes and re-creates.\n\n`client_secret`, when present, is the IdP-issued plaintext OAuth2\n/OIDC client secret. The handler re-wraps the value with\n`aead_encrypt(settings_enc_key, ..., nonce)` using a fresh 12-byte\nCSPRNG nonce and writes the resulting ciphertext into\n`client_secret_ct`. The plaintext NEVER appears on any read\nsurface, in any audit row, or in any log line; the audit row\ncarries only a `client_secret_rotated: true` flag (no plaintext,\nno ciphertext bytes).\n\n`default_role_name`, when present, must be one of the\ncustomer-assignable system roles (`org_admin`, `billing_admin`,\n`vpn_operator`, `static_ips_operator`, `viewer`). The\nplatform-only roles (`platform_admin`, `platform_support`) and\nthe machine-only roles (`router_agent`, `vpn_server`) are\nrejected with field code `invalid` so a successful SSO callback\nthat auto-provisions an unknown user cannot escalate them into a\nplatform-tier role.","properties":{"auto_provision":{"type":["boolean","null"],"description":"Optional new value for the `auto_provision` flag — when\n`true`, a successful callback resolving to an unknown user\nauto-creates the member; when `false`, unknown users are\nrejected. Absent ⇒ unchanged."},"client_id":{"type":["string","null"],"description":"Optional new OAuth2 / OIDC `client_id`. Bounded\n`1 ≤ len ≤ 256` when present."},"client_secret":{"type":["string","null"],"description":"Optional new OAuth2 / OIDC `client_secret` plaintext.\nBounded `1 ≤ len ≤ 2048` when present. **NEVER echoed on\nany read surface, in any audit row, or in any log line.**\nThe handler re-wraps the value with\n`aead_encrypt(settings_enc_key, ..., nonce)` using a fresh\n12-byte CSPRNG nonce before update; the column at rest\ncarries the new AEAD ciphertext (`client_secret_ct`)."},"default_role_name":{"type":["string","null"],"description":"Optional new role name applied to an auto-provisioned\nmember. Bounded `1 ≤ len ≤ 64` when present. Must be one\nof the customer-assignable system roles — the handler\nrejects any other value with field code `invalid`.\nAbsent ⇒ unchanged."},"discovery_url":{"type":["string","null"],"description":"Optional new OIDC discovery document URL or SAML2 metadata\nURL. Bounded `1 ≤ len ≤ 512` when present."},"display_name":{"type":["string","null"],"description":"Optional human-readable label. Bounded `1 ≤ len ≤ 128` when\npresent. Absent ⇒ unchanged."},"issuer_url":{"type":["string","null"],"description":"Optional new IdP issuer URL. Bounded `1 ≤ len ≤ 512` when\npresent. The schema-level UNIQUE\n`(org_id, provider_kind, issuer_url)` tuple catches a rename\nthat collides with another provider in the same org — the\nhandler maps the SQLite `is_unique_violation` to 409 Conflict\nwith stable wire message `duplicate_provider`."},"scopes":{"type":["string","null"],"description":"Optional new space-separated OAuth2 scope list. Bounded\n`1 ≤ len ≤ 256` when present (cannot be empty — empty\nscopes would break OIDC). Absent ⇒ unchanged."}}},"OrgSsoRedirectResponse":{"type":"object","description":"Empty marker response for the anonymous OIDC redirect endpoint.\nThe runtime wire shape is a `302 Found` with a\n`Location` header pointing at the IdP's authorization endpoint\nand no body; this struct exists purely to satisfy the\n[`appsynergy_macros::endpoint`] macro's `response = ...` argument\nand to give the OpenAPI document a typed entry under the Auth tag\nthat documents readers can find. Future fields will not land here\n— a redirect-shaped surface stays bodyless by definition."},"OrgSsoSamlCallbackResponse":{"type":"object","description":"Response body — same shape as `LoginResponse`.","required":["user_id"],"properties":{"user_id":{"type":"string","description":"UUIDv7 of the authenticated user."}}},"OrgSsoSamlRedirectResponse":{"type":"object","description":"Empty marker response for the anonymous SAML2 redirect endpoint.\nThe runtime wire shape is a `302 Found` with a\n`Location` header pointing at the IdP's HTTP-Redirect\nSingleSignOnService URL and no body; this struct exists purely\nto satisfy the [`appsynergy_macros::endpoint`] macro's\n`response = ...` argument and to give the OpenAPI document a\ntyped entry under the Auth tag that documents readers can find.\nFuture fields will not land here — a redirect-shaped surface\nstays bodyless by definition."},"OrgUpdateRequest":{"type":"object","description":"Request body for `PATCH /iam/orgs/{org_id}`. Currently\nscopes to one mutable field — `name`. The struct is shaped as an\nenvelope of optional fields so adding future PATCH-able columns\n(`description`, …) extends the wire contract without\nbreaking already-shipped clients: an absent field leaves the column\nunchanged.\n\n`name` is bounded `min = 1, max = 200`. The lower bound refuses an\nempty-string clear because the schema declares\n`orgs.name TEXT NOT NULL` — a NULL would violate the constraint and\nemerge as a 500 from sqlx; the validator-derived 422 is the\nboundary check that keeps that shape from reaching the column. The\nupper bound mirrors `SignupRequest::name` (200 chars) for symmetry.","properties":{"name":{"type":["string","null"],"description":"Replacement display name. Absent (`None`) ⇒ no-op for this\nfield; present ⇒ overwrites `orgs.name`. Bounded\n`1 ≤ len ≤ 200`; the lower bound refuses empty-string clears\nbecause `orgs.name` is `NOT NULL`."}}},"PasskeyCredentialDeleteResponse":{"type":"object","description":"Response body for `DELETE /auth/passkey/credentials/{id}`.\n`was_last` signals whether the deleted row was the user's last\nremaining credential — when true, the same transaction also flipped\n`users.passkey_enabled` from 1 → 0 so the flag stays consistent\nwith row presence. The UI uses `was_last` to refresh the\npasskey-enabled badge without a follow-up GET.","required":["ok","was_last"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Reserved for future\nstructured fields without changing the contract."},"was_last":{"type":"boolean","description":"`true` when the deleted credential was the user's last\nremaining row (and thus `users.passkey_enabled` was flipped to\n0 in the same transaction). `false` when other credentials\nremain."}}},"PasskeyCredentialListResponse":{"type":"object","description":"Response body for `GET /auth/passkey/credentials`. Plain\nwrapper around the projected `PasskeyCredentialSummary` rows\nordered `created_at DESC`.","required":["credentials"],"properties":{"credentials":{"type":"array","items":{"$ref":"#/components/schemas/PasskeyCredentialSummary"},"description":"The principal's registered passkey credentials, newest first."}}},"PasskeyCredentialRenameRequest":{"type":"object","description":"Request body for `PATCH /auth/passkey/credentials/{id}`: the new\nname, trimmed server-side to 1..=80 characters.","required":["name"],"properties":{"name":{"type":"string"}}},"PasskeyCredentialSummary":{"type":"object","description":"One row of the caller's passkey credential list (`GET\n/auth/passkey/credentials`). Wire-projection drops `public_key`\n(server-state only) and the operational columns `sign_count`,\n`attestation_type`, `aaguid` — only customer-facing lifecycle\nmetadata is surfaced.","required":["id","name","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 timestamp the credential was registered."},"id":{"type":"string","description":"`passkey_credentials.id` — UUIDv7 of the credential row. The\npath parameter for `DELETE /auth/passkey/credentials/{id}`."},"last_used_at":{"type":["string","null"],"description":"RFC3339 timestamp of the most recent successful authentication\nusing this credential. `None` until the credential has been\nused (update this on success)."},"name":{"type":"string","description":"Human-readable name the user gave the credential at\nregistration."},"transports":{"type":["string","null"],"description":"Comma-separated list of transports advertised by the\nauthenticator at registration (e.g. `usb,nfc`). `None` when\nthe authenticator did not advertise."}}},"PasskeyLoginBeginRequest":{"type":"object","description":"Request body for `POST /auth/passkey/login/begin`. The email\nresolves the principal whose registered credentials feed\n`Webauthn::start_passkey_authentication`. Unknown emails return the\nsame wire shape as a valid one to prevent enumeration\n(OWASP A07); the audit row distinguishes the two outcomes\nout-of-band.","required":["email"],"properties":{"email":{"type":"string","description":"User's email address. Unknown emails surface the same response\nshape as a valid one (no enumeration signal on the wire)."}}},"PasskeyLoginBeginResponse":{"type":"object","description":"Response body for `POST /auth/passkey/login/begin`. Mirrors\n[`PasskeyRegisterBeginResponse`] — the browser passes `options` to\n`navigator.credentials.get` and echoes `challenge_id` in the\nmatching complete call. The `options` field carries the\n`RequestChallengeResponse` shape from `webauthn-rs` verbatim\n(foreign-type carve-out scoped to the WebAuthn surface).","required":["challenge_id","options"],"properties":{"challenge_id":{"type":"string","description":"UUIDv7 of the freshly-issued `passkey_challenges` row. The\ncaller passes this back in the matching `complete` call to\npin the per-attempt challenge state\n(per-attempt-key concurrency contract)."},"options":{"description":"Verbatim `RequestChallengeResponse` JSON the browser hands to\n`navigator.credentials.get`. Foreign-type carve-out scoped to\nthe WebAuthn surface."}}},"PasskeyLoginCompleteRequest":{"type":"object","description":"Request body for `POST /auth/passkey/login/complete`.\nCarries the `challenge_id` returned by `begin` and the verbatim\n`PublicKeyCredential` JSON produced by\n`navigator.credentials.get`. The `authentication_response` field\nis a foreign-type carve-out — the\nhandler reconstructs the typed shape via `serde_json::from_value`\nbefore handing it to `Webauthn::finish_passkey_authentication`.","required":["challenge_id","authentication_response"],"properties":{"authentication_response":{"description":"Verbatim `PublicKeyCredential` JSON from the browser.\nwebauthn-rs foreign type carve-out (see the\nmatching note on\n[`PasskeyLoginBeginResponse::options`])."},"challenge_id":{"type":"string","description":"UUIDv7 of the `passkey_challenges` row issued by the matching\n`begin` call. The handler refuses any value that is not a\nwell-formed UUID inside the handler body."}}},"PasskeyLoginCompleteResponse":{"type":"object","description":"Response body for `POST /auth/passkey/login/complete`.\nMirrors [`crate::platform::auth::types::LoginResponse`] verbatim\n— the JWT is also set on a `Set-Cookie: auth_token` header by the\nhandler; the body copy lets non-browser clients pick it up directly.","required":["user_id"],"properties":{"user_id":{"type":"string","description":"UUIDv7 of the authenticated user."}}},"PasskeyPasswordlessBeginResponse":{"type":"object","description":"Response body for `POST /auth/passkey/passwordless/begin`.\nDistinct from [`PasskeyLoginBeginResponse`] because the passwordless\nflow takes no email — the browser drives\n`navigator.credentials.get` against any registered discoverable\npasskey and the matching `complete` resolves the user via the\nasserting credential's `userHandle`. The `options` field carries\nthe `RequestChallengeResponse` shape from `webauthn-rs` verbatim\n(foreign-type carve-out scoped to the WebAuthn surface).","required":["challenge_id","options"],"properties":{"challenge_id":{"type":"string","description":"UUIDv7 of the freshly-issued `passkey_challenges` row. The\ncaller passes this back in the matching `complete` call to\npin the per-attempt challenge state\n(per-attempt-key concurrency contract). The row carries\n`user_id IS NULL` and `flow = 'passwordless'`; the user is\nresolved on `complete` from the asserting credential's\n`userHandle`, not from this row."},"options":{"description":"Verbatim `RequestChallengeResponse` JSON the browser hands to\n`navigator.credentials.get`. Foreign-type carve-out scoped to\nthe WebAuthn surface. Conditional-ui mediation is set by\n`Webauthn::start_discoverable_authentication`."}}},"PasskeyPasswordlessCompleteRequest":{"type":"object","description":"Request body for `POST /auth/passkey/passwordless/complete`.\nCarries the `challenge_id` returned by `begin` and the\nverbatim `PublicKeyCredential` JSON produced by\n`navigator.credentials.get` in conditional-ui mediation. The\n`authentication_response` field is a foreign-type carve-out —\nthe handler reconstructs the typed shape via\n`serde_json::from_value` before handing it to the WebAuthn\n`identify_discoverable_authentication` / `finish_discoverable_authentication`\npair.","required":["challenge_id","authentication_response"],"properties":{"authentication_response":{"description":"Verbatim `PublicKeyCredential` JSON from the browser.\nwebauthn-rs foreign type carve-out (see the\nmatching note on\n[`PasskeyPasswordlessBeginResponse::options`])."},"challenge_id":{"type":"string","description":"UUIDv7 of the `passkey_challenges` row issued by the matching\n`begin` call. The handler refuses any value that is not a\nwell-formed UUID inside the handler body."}}},"PasskeyPasswordlessCompleteResponse":{"type":"object","description":"Response body for `POST /auth/passkey/passwordless/complete`.\nMirrors [`PasskeyLoginCompleteResponse`] verbatim — the\nJWT is also set on a `Set-Cookie: auth_token` header by the\nhandler; the body copy lets non-browser clients pick it up\ndirectly.","required":["user_id"],"properties":{"user_id":{"type":"string","description":"UUIDv7 of the authenticated user, resolved on this request via\nthe asserting credential's `userHandle`."}}},"PasskeyRegisterBeginResponse":{"type":"object","description":"Response body for `POST /auth/passkey/register/begin`. The\nbrowser passes `options` to `navigator.credentials.create` and\nechoes `challenge_id` in the matching complete call. The `options`\nfield carries the `CreationChallengeResponse` shape from\n`webauthn-rs` verbatim; ToSchema is not derived on that foreign\ntype, so the spec exposes it as a free-form JSON object scoped to\nthe WebAuthn surface.","required":["challenge_id","options"],"properties":{"challenge_id":{"type":"string","description":"UUIDv7 of the freshly-issued `passkey_challenges` row. The\ncaller passes this back in the matching `complete` call to\npin the per-attempt challenge state\n(per-attempt-key concurrency contract)."},"options":{"description":"Verbatim `CreationChallengeResponse` JSON the browser hands to\n`navigator.credentials.create`. Foreign-type carve-out scoped\nto the WebAuthn surface."}}},"PasskeyRegisterCompleteRequest":{"type":"object","description":"Request body for `POST /auth/passkey/register/complete`.\nCarries the `challenge_id` returned by `begin`, the user-supplied\nhuman-readable `name` for the credential row, and the verbatim\n`RegisterPublicKeyCredential` JSON the browser produced from\n`navigator.credentials.create`. The `registration_response` field\nis a foreign-type carve-out — the\nhandler reconstructs the typed shape via `serde_json::from_value`\nbefore handing it to `Webauthn::finish_passkey_registration`.","required":["challenge_id","name","registration_response"],"properties":{"challenge_id":{"type":"string","description":"UUIDv7 of the `passkey_challenges` row issued by the matching\n`begin` call. The handler refuses any value that is not a\nwell-formed UUID at the deserialiser via the `Uuid` type\ninside the handler body."},"name":{"type":"string","description":"Human-readable label the user gave the credential at the\nconfirmation step. Persisted into `passkey_credentials.name`\nand surfaced verbatim by the credentials list endpoint."},"registration_response":{"description":"Verbatim `RegisterPublicKeyCredential` JSON from the browser.\nwebauthn-rs foreign type carve-out (see the\nmatching note on\n[`PasskeyRegisterBeginResponse::options`])."}}},"PasskeyRegisterCompleteResponse":{"type":"object","description":"Response body for `POST /auth/passkey/register/complete`.\n`first_credential` signals whether this credential was the user's\nfirst registered passkey — when true, the same transaction also\nflipped `users.passkey_enabled` from 0 → 1 so the flag stays\nconsistent with row presence. The UI uses `first_credential` to\nsurface the \"passkey enabled\" badge without a follow-up GET.","required":["ok","credential_id","first_credential"],"properties":{"credential_id":{"type":"string","description":"UUIDv7 of the freshly-inserted `passkey_credentials` row. The\npath parameter for `DELETE /auth/passkey/credentials/{id}`\nand the wire identifier the dashboard renders against."},"first_credential":{"type":"boolean","description":"`true` when this credential is the user's first registered\npasskey (and thus `users.passkey_enabled` was flipped to 1 in\nthe same transaction). `false` when the user already had at\nleast one credential before this call."},"ok":{"type":"boolean","description":"Always `true` on the success path. Reserved for future\nstructured fields without changing the contract."}}},"PasskeySettings":{"type":"object","description":"Response body for `GET /auth/passkey/settings`. Mirrors the\n`users.passkey_enabled` + `users.enforce_passkey` columns. The\nmatching write surface (`PATCH /auth/passkey/settings`)\nrewrites `enforce_passkey`; `passkey_enabled` flips automatically\nwhen the registration / delete handlers land.","required":["passkey_enabled","enforce_passkey"],"properties":{"enforce_passkey":{"type":"boolean","description":"`true` when the user has elected to require a passkey for\nlogin (password-flow attempts then return 403). Default is\n`false`. Toggled via `PATCH /auth/passkey/settings`."},"passkey_enabled":{"type":"boolean","description":"`true` when the user has at least one registered passkey\ncredential (set by the registration handler; cleared\nby the delete handler when the row was the last one)."}}},"PasskeySettingsUpdate":{"type":"object","description":"Request body for `PATCH /auth/passkey/settings`. Carries a\nsingle `enforce_passkey` boolean that rewrites the caller's own\n`users.enforce_passkey` column. `users.passkey_enabled` is NOT\nwritable from this surface — it flips automatically when the\nregistration handler inserts the user's first credential\nand when the delete handler removes the user's last.\n\nA plain bool is structurally bounded so no `garde` field\nconstraint is required; the derive on the type itself stays for\nuniformity with every other request type in this module.","required":["enforce_passkey"],"properties":{"enforce_passkey":{"type":"boolean","description":"New value for `users.enforce_passkey`. When the request flips\nthe value from `false` to `true` AND the caller has zero\n`passkey_credentials` rows, the handler refuses with\n`ApiError::Conflict` and stable code\n`enforce_passkey_requires_credential` to avoid self-lockout."}}},"PathTierAdminEntry":{"type":"object","description":"One row of `GET /platform/path-tiers` — the **admin** view of a\ntradeable network-path SKU (`platform_admin`-only).\nEvery field maps off the `network_path_tiers` table\n(`0017_path_tiers_qos_init.sql`); unlike the customer\ncatalog this is the full row including hidden / inactive tiers\nand the operational columns the admin manages.\n\nResponse-only (no `Validate`): the admin catalog is a GET with\nno client body. The create / patch request bodies are\nseparate shapes that land with their handlers.","required":["id","slug","name","monthly_fixed_cost_cents","overage_cost_cents_per_gb","server_pool_match","capabilities","visible","active","display_order","created_at","updated_at"],"properties":{"active":{"type":"boolean","description":"`network_path_tiers.active` — whether the tier is sellable.\nThe admin view lists inactive tiers so the operator can\nreactivate or delete them."},"capabilities":{"$ref":"#/components/schemas/PathTierCapabilities","description":"`network_path_tiers.capabilities` decoded — the typed\noptional-superset (see [`PathTierCapabilities`]). A `{}`\ncolumn deserialises to [`PathTierCapabilities::default`]\n(all-`None`)."},"created_at":{"type":"string","description":"`network_path_tiers.created_at` — RFC3339 (UTC). When the\noperator first created the tier."},"description":{"type":["string","null"],"description":"`network_path_tiers.description` — free-form copy, or `None`\nwhen the operator left the column NULL."},"display_order":{"type":"integer","format":"int64","description":"`network_path_tiers.display_order` — the operator-curated\nordering key (`>= 0`; lower renders first in the customer\npicker). Surfaced so the admin UI shows the curated order."},"id":{"type":"string","description":"`network_path_tiers.id` (UUIDv7). The stable handle\nthe single-tier paths and the `plan_path_tiers`\n/ `bindings.path_tier_id` references key off."},"included_gb_per_month":{"type":["integer","null"],"format":"int64","description":"`network_path_tiers.included_gb_per_month` — the bundled\nmonthly GB before overage pricing applies, or `None` for an\nunmetered tier (the column is nullable; `>= 0` when set)."},"monthly_fixed_cost_cents":{"type":"integer","format":"int64","description":"`network_path_tiers.monthly_fixed_cost_cents` — the flat\nmonthly add-on price, in cents (`>= 0`, schema CHECK)."},"name":{"type":"string","description":"`network_path_tiers.name` — the operator-facing display\nlabel."},"overage_cost_cents_per_gb":{"type":"integer","format":"int64","description":"`network_path_tiers.overage_cost_cents_per_gb` — the metered\nprice per GB past `included_gb_per_month`, in cents (`>= 0`,\nschema CHECK)."},"server_pool_match":{"type":"array","items":{"type":"string"},"description":"`network_path_tiers.server_pool_match` decoded — the list of\nserver-pool handles this tier may egress through. The column\nis `TEXT NOT NULL DEFAULT '[]'` (a JSON array,\nschema-shape-only); on the wire it is a typed\n`Vec<String>` (no ad-hoc JSON `Value`). `[]` when the\ntier has no pool restriction."},"slug":{"type":"string","description":"`network_path_tiers.slug` — the human-readable handle the\nrouting agent and QoS policies key off (e.g. `standard`,\n`premium`, `p2p`, `privacy`). `UNIQUE` in the schema."},"updated_at":{"type":"string","description":"`network_path_tiers.updated_at` — RFC3339 (UTC). Last CC\nmutation of the row (create sets it equal to `created_at`)."},"visible":{"type":"boolean","description":"`network_path_tiers.visible` — whether the tier appears in\nthe customer-facing picker. The admin view lists it\nregardless so the operator can manage hidden tiers."}}},"PathTierAdminListResponse":{"type":"object","description":"Response envelope for `GET /platform/path-tiers`. A plain\nlist of [`PathTierAdminEntry`] ordered by\n`network_path_tiers.display_order` ASC, `id` ASC (the\noperator-curated picker order, deterministic tiebreak). No\n`next_cursor`: the catalog is bounded and admin-curated, so it\nis unpaginated exactly like the `PathTierCatalogResponse` /\n`PlanListResponse` catalogs (cursor pagination, is\nfor unbounded-growth lists).","required":["path_tiers"],"properties":{"path_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PathTierAdminEntry"},"description":"One entry per tier (every row, including hidden / inactive),\nordered `display_order ASC, id ASC`. `[]` when no tier\nexists yet."}}},"PathTierCapabilities":{"type":"object","description":"Typed view of the `network_path_tiers.capabilities` JSON-object\ncolumn. The column is `TEXT NOT NULL DEFAULT '{}'`,\nschema-shape-only; this struct is the on-the-wire form\n(no ad-hoc JSON `Value`), an optional-superset.\n\nDeliberate **platform-local copy** of the product-side\n`products::path_tiers::path_tier_types::PathTierCapabilities`\n(identical field shape): `src/platform/*` must not import from\n`src/products/*` (one-way platform→product boundary;\nthe `PathTierGrantRow` local-copy precedent). The two\nstay shape-compatible because both decode the same\n`network_path_tiers.capabilities` column; the OpenAPI emit names\nthem under their own module paths so there is no schema clash.\n\nEvery field is `#[serde(default)]` `Option`: a `{}` column\ndeserialises to all-`None`, and an operator who later sets only\n`cacheable` leaves the other two `None` rather than forcing the\nadmin UI to special-case absent keys. The three fields are the\nEdge-caching reservation — present so the\n`cache_proxy` capability can be wired without a follow-up\nmigration; nothing in CC acts on them (only surfaces the\ncatalog; round-trip them unchanged).","properties":{"cacheable":{"type":["boolean","null"],"description":"Whether flows on this tier are eligible for per-flow edge\ncaching at the agent (edge-caching\nreservation). `None` when the column omits the key."},"follow_best_path":{"type":["boolean","null"],"description":"Whether bindings on this tier opt into follow-the-best-path\nsemantics — the anycast PoP optimizer may move their\n`exit_server_id` onto the lowest-RTT active PoP. Omitted /\n`false` = exits stay where they were placed."},"max_cached_object_bytes":{"type":["integer","null"],"format":"int64","description":"Upper bound (bytes) on a single cached object on this tier,\nor `None` when unset. Reservation field only."},"ttl_default_s":{"type":["integer","null"],"format":"int64","description":"Default cache TTL (seconds) for objects on this tier, or\n`None` when unset. Reservation field only."}}},"PathTierCatalogEntry":{"type":"object","description":"One row of `GET /billing/path-tiers` — the anonymous public\nview of a tradeable network-path SKU. Every field maps off the\n`network_path_tiers` table (`0017_path_tiers_qos_init.sql`);\nthe handler surfaces only `active=1 AND visible=1` rows so\nnothing internal-only or retired reaches this shape.\n\nResponse-only (no `Validate`): the catalog is an anonymous GET\nwith no client body.","required":["id","slug","name","monthly_fixed_cost_cents","overage_cost_cents_per_gb","capabilities"],"properties":{"capabilities":{"$ref":"#/components/schemas/PathTierCapabilities","description":"`network_path_tiers.capabilities` decoded — the typed\noptional-superset (see [`PathTierCapabilities`]). A `{}`\ncolumn deserialises to [`PathTierCapabilities::default`]\n(all-`None`)."},"description":{"type":["string","null"],"description":"`network_path_tiers.description` — free-form marketing\ncopy, or `None` when the operator left the column NULL."},"id":{"type":"string","description":"`network_path_tiers.id` (UUIDv7). The stable handle\nthe per-binding `path_tier_id` selection and the\nper-subscription tier view key off."},"included_gb_per_month":{"type":["integer","null"],"format":"int64","description":"`network_path_tiers.included_gb_per_month` — the bundled\nmonthly GB before overage pricing applies, or `None` for an\nunmetered tier (the column is nullable; `>= 0` when set)."},"monthly_fixed_cost_cents":{"type":"integer","format":"int64","description":"`network_path_tiers.monthly_fixed_cost_cents` — the flat\nmonthly add-on price for the tier, in cents (`>= 0`,\nschema CHECK). `0` for a tier included at no extra charge."},"name":{"type":"string","description":"`network_path_tiers.name` — the customer-facing display\nlabel for the tier picker."},"overage_cost_cents_per_gb":{"type":"integer","format":"int64","description":"`network_path_tiers.overage_cost_cents_per_gb` — the\nmetered price per GB past `included_gb_per_month`, in cents\n(`>= 0`, schema CHECK). `0` when the tier has no metered\noverage."},"slug":{"type":"string","description":"`network_path_tiers.slug` — the human-readable handle the\nrouting agent and QoS policies key off (e.g. `standard`,\n`premium`, `p2p`, `privacy`). `UNIQUE` in the schema."}}},"PathTierCatalogResponse":{"type":"object","description":"Response envelope for `GET /billing/path-tiers`. A plain\nlist of [`PathTierCatalogEntry`] ordered by\n`network_path_tiers.display_order` ASC (the operator-curated\npicker order). No `next_cursor`: the catalog is bounded and\nadmin-curated, so it is unpaginated exactly like the\n`PlanListResponse` / `DnsServerListResponse` catalogs\n(cursor pagination, is for unbounded-growth lists).","required":["path_tiers"],"properties":{"path_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PathTierCatalogEntry"},"description":"One entry per visible, active tier, ordered\n`display_order ASC`. `[]` when no tier is currently\n`active=1 AND visible=1`."}}},"PathTierCreateRequest":{"type":"object","description":"Request body for `POST /platform/path-tiers` — operator\ncreation of a new tradeable network-path SKU. Every field maps\nonto a `network_path_tiers` column; the response is the freshly\ninserted row as a [`PathTierAdminEntry`] (the same shape the\ncatalog and single-read surface).\n\n`Validate` enforces the boundary: `name` / `slug` are\nnon-empty and length-capped, the three cost columns and\n`display_order` are `>= 0` (mirroring the schema CHECKs so a\nrejected request never reaches the INSERT). The `slug`\n**character set** is checked in the handler (lowercase\nalphanumeric + single internal hyphens) — the validator crate's\nlength/range derives cannot express the grammar, so the handler\nemits a `FieldError` exactly as `join_tokens_mint`'s capability\nallowlist does. Slug **uniqueness** is the schema's\n`UNIQUE` constraint: the handler maps the SQLite unique violation\non INSERT to a 422 `slug_taken` `FieldError` (the\n`org_custom_role_create` precedent) — no TOCTOU pre-check.\n\n`server_pool_match` / `capabilities` round-trip through the same\ntyped shapes the catalog read decodes (never an\nad-hoc JSON `Value`); the handler re-encodes them to the JSON-text\ncolumns. `visible` / `active` default to `true` (the schema\ndefault `1` — a tier is born sellable + customer-visible unless\nthe operator opts it out); `display_order` / `server_pool_match` /\n`capabilities` default to the column defaults (`0` / `[]` / `{}`).","required":["name","slug","monthly_fixed_cost_cents","overage_cost_cents_per_gb"],"properties":{"active":{"type":"boolean","description":"`network_path_tiers.active` — whether the tier is sellable.\nAbsent ⇒ `true` (schema default `1`)."},"capabilities":{"$ref":"#/components/schemas/PathTierCapabilities","description":"`network_path_tiers.capabilities` — the typed\noptional-superset. Absent ⇒ `{}` (all-`None`)."},"description":{"type":["string","null"],"description":"`network_path_tiers.description` — optional free-form copy.\n`None` (or absent) ⇒ the column is `NULL`."},"display_order":{"type":"integer","format":"int64","description":"`network_path_tiers.display_order` — operator-curated picker\norder (lower renders first). Absent ⇒ `0`. `>= 0`."},"included_gb_per_month":{"type":["integer","null"],"format":"int64","description":"`network_path_tiers.included_gb_per_month` — bundled monthly\nGB before overage pricing. `None` ⇒ unmetered tier (column\n`NULL`); `>= 0` when set."},"monthly_fixed_cost_cents":{"type":"integer","format":"int64","description":"`network_path_tiers.monthly_fixed_cost_cents` — flat monthly\nadd-on price in cents. `>= 0` (schema CHECK)."},"name":{"type":"string","description":"`network_path_tiers.name` — the operator-facing display\nlabel. Non-empty, `<= PATH_TIER_NAME_MAX_LEN`."},"overage_cost_cents_per_gb":{"type":"integer","format":"int64","description":"`network_path_tiers.overage_cost_cents_per_gb` — metered price\nper GB past `included_gb_per_month`, in cents. `>= 0`."},"server_pool_match":{"type":"array","items":{"type":"string"},"description":"`network_path_tiers.server_pool_match` — the server-pool\nhandles this tier may egress through. Absent ⇒ `[]` (no pool\nrestriction)."},"slug":{"type":"string","description":"`network_path_tiers.slug` — the stable handle agents / QoS\npolicies key off. Non-empty, `<= PATH_TIER_SLUG_MAX_LEN`,\nand (handler-checked) lowercase alphanumeric with single\ninternal hyphens. `UNIQUE` in the schema."},"visible":{"type":"boolean","description":"`network_path_tiers.visible` — whether the tier appears in the\ncustomer picker. Absent ⇒ `true` (schema default `1`)."}}},"PathTierDeleteResponse":{"type":"object","description":"Response envelope for `DELETE /platform/path-tiers/{id}`:\n`{ ok: true }` on the single 200 path (the hard-delete of one\ntradeable network-path SKU), mirroring\n[`crate::platform::agents::agent_types::AgentRetireResponse`]. The\naudit row is the canonical record (`prev_slug` / `prev_name` so\nthe SKU stays identifiable after the row is gone); the 404 / 409\npaths return an [`crate::error::ApiError`], never this shape.\nResponse-only, no `Validate`; `ToSchema`.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for a\nforward-compatible envelope shape rather than as a status\nflag (the `AgentRetireResponse` precedent)."}}},"PathTierPresetCatalogEntry":{"type":"object","description":"One row of `GET /billing/path-tier-presets` — the anonymous\npublic view of a path-tier preset, the \"5-button picker\"\nsurface. Every field maps off the\n`network_path_tier_presets` table (`0018_pops_topology_init.sql`);\nthe handler surfaces only `active=1` rows.\n\nThe preset catalog exposes \"`name`,\n`description`, `display_order`\". The wire additionally carries\n`id` (the stable UUIDv7 handle) and `slug` — the customer-facing\n`preset_slug` the binding flows accept as an alternative to a\nraw `path_tier_id`. The underlying `path_tier_id` and\n`qos_overrides` are deliberately **not** on the wire: the preset\nsurface lets the dashboard show \"you picked Privacy\" without\nleaking the tier mechanics.\n\nResponse-only (no `Validate`): the catalog is an anonymous GET\nwith no client body, mirroring [`PathTierCatalogEntry`].","required":["id","slug","name","display_order"],"properties":{"description":{"type":["string","null"],"description":"`network_path_tier_presets.description` — free-form picker\ncopy, or `None` when the operator left the column NULL."},"display_order":{"type":"integer","format":"int64","description":"`network_path_tier_presets.display_order` — the\noperator-curated left-to-right button order (`>= 0`; lower\nrenders first). Surfaced so the dashboard renders the picker\nin the operator's intended sequence."},"id":{"type":"string","description":"`network_path_tier_presets.id` (UUIDv7). The stable\nhandle for the preset; the customer-facing selection keys off\n[`slug`](Self::slug), not this."},"name":{"type":"string","description":"`network_path_tier_presets.name` — the customer-facing\ndisplay label for the picker button."},"slug":{"type":"string","description":"`network_path_tier_presets.slug` — the customer-facing\n`preset_slug` the binding flows accept (`UNIQUE` in the\nschema; e.g. `simple`, `privacy`, `speed`). Default binding\nflow uses slug `simple` when the customer specifies none."}}},"PathTierPresetCatalogResponse":{"type":"object","description":"Response envelope for `GET /billing/path-tier-presets`. A\nplain list of [`PathTierPresetCatalogEntry`] ordered by\n`network_path_tier_presets.display_order` ASC (the operator-curated\npicker order). No `next_cursor`: the preset set is the bounded\n5-button picker, admin-curated, so it is unpaginated exactly like\nthe [`PathTierCatalogResponse`] / `PlanListResponse` catalogs\n(cursor pagination, is for unbounded-growth lists).","required":["path_tier_presets"],"properties":{"path_tier_presets":{"type":"array","items":{"$ref":"#/components/schemas/PathTierPresetCatalogEntry"},"description":"One entry per active preset, ordered `display_order ASC`.\n`[]` when no preset is currently `active=1`."}}},"PathTierUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/path-tiers/{id}` —\noperator partial-edit of one tradeable network-path SKU. Every\nfield is `Option<T>` so a JSON object that omits a key leaves the\n`network_path_tiers` column unchanged; an empty-object PATCH\n(`{}`) is a column-level no-op (the matching handler does NOT bump\n`updated_at` on the no-op path — touch-only idempotence, the\n`agents_patch` / `org_patch` precedent). The response is the\nrefreshed row as a [`PathTierAdminEntry`] (the same shape the\ncatalog and single-read surface), so the caller\nreads-after-write in one round trip.\n\nNull-handling conventions (the `agents_patch` / `billing_types`\nprecedents):\n\n- `name` maps to a `NOT NULL` column and is `length(min = 1)`\n  validated — an explicit empty string is a 422 reject, never a\n  clear.\n- `slug` maps to a `NOT NULL UNIQUE` column; when present it is\n  re-validated for **grammar** (handler-side `valid_slug` ⇒ 422\n  `invalid_slug_format`, exactly create) and\n  **uniqueness** (the SQLite `UNIQUE` violation on UPDATE ⇒ 422\n  `slug_taken`, no TOCTOU pre-check — the `path_tiers_create`\n  precedent).\n- `description` is the nullable **text** column: an explicit\n  empty string clears it to `NULL`; a non-empty string sets it\n  (empty-string-clears, strictly simpler than double-option for\n  text).\n- `included_gb_per_month` is the nullable **numeric** column: it\n  uses the `double_option` `Option<Option<i64>>` adapter so an\n  explicit JSON `null` clears it to `NULL` (re-pricing a metered\n  tier to unmetered) while an omitted key keeps it — the\n  principled alternative the `billing_types` doc names when\n  empty-string-clears cannot apply to a numeric. Its `>= 0`\n  floor is enforced handler-side (the `garde` derive does not\n  traverse the nested option).\n- `server_pool_match` / `capabilities` are whole-value\n  replacements: present ⇒ the handler re-encodes the typed shape\n  to the JSON-text column (never an ad-hoc JSON\n  `Value`); omitted ⇒ the stored value is kept.\n- `visible` / `active` / `display_order` are plain scalars:\n  present ⇒ set, omitted ⇒ keep.\n\n`garde` constraints fire only when the field is `Some(_)` —\n`None` is skipped automatically by the crate's `Option`\nsemantics. `updated_at` / `created_at` are server-managed and\nintentionally absent — the wire cannot override the timestamps.","properties":{"active":{"type":["boolean","null"],"description":"New `network_path_tiers.active` flag. Omit ⇒ keep."},"capabilities":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PathTierCapabilities","description":"New `network_path_tiers.capabilities` — whole-value\nreplacement of the typed optional-superset. Omit ⇒ keep;\npresent (including `{}`) ⇒ replace."}]},"description":{"type":["string","null"],"description":"New `network_path_tiers.description` (nullable free-form\ncopy). Empty string clears the column to `NULL`; a non-empty\nstring sets it; omit ⇒ keep (empty-string-clears\nconvention)."},"display_order":{"type":["integer","null"],"format":"int64","description":"New `network_path_tiers.display_order` (operator-curated\npicker order; lower renders first). `>= 0`. Omit ⇒ keep."},"included_gb_per_month":{"type":["integer","null"],"format":"int64","description":"New `network_path_tiers.included_gb_per_month` (bundled\nmonthly GB before overage). The `double_option` adapter:\nomitted ⇒ keep, explicit JSON `null` ⇒ clear to `NULL`\n(unmetered tier), a number ⇒ set. `>= 0` enforced\nhandler-side. `#[schema(value_type = Option<i64>)]` keeps the\nOpenAPI shape a clean nullable integer (the spec is\ncode-generated, the nested option is a serde-only detail)."},"monthly_fixed_cost_cents":{"type":["integer","null"],"format":"int64","description":"New `network_path_tiers.monthly_fixed_cost_cents` (flat\nmonthly add-on price, cents). `>= 0` (schema CHECK). Omit ⇒\nkeep."},"name":{"type":["string","null"],"description":"New `network_path_tiers.name` (the operator-facing display\nlabel). `NOT NULL` column — `length(min = 1, max = 128)`, so\nan empty string is a 422 reject, never a clear. Omit ⇒ keep."},"overage_cost_cents_per_gb":{"type":["integer","null"],"format":"int64","description":"New `network_path_tiers.overage_cost_cents_per_gb` (metered\nprice per GB, cents). `>= 0` (schema CHECK). Omit ⇒ keep."},"server_pool_match":{"type":["array","null"],"items":{"type":"string"},"description":"New `network_path_tiers.server_pool_match` — whole-value\nreplacement of the egress server-pool handle list. Omit ⇒\nkeep the stored array; present (including `[]`) ⇒ replace."},"slug":{"type":["string","null"],"description":"New `network_path_tiers.slug`. `length(min = 1, max = 64)`\nhere; the handler additionally re-checks the lowercase\nalphanumeric / single-internal-hyphen grammar and the\n`UNIQUE` constraint (422 `invalid_slug_format` /\n`slug_taken`). Omit ⇒ keep. `NOT NULL` column — no clear."},"visible":{"type":["boolean","null"],"description":"New `network_path_tiers.visible` flag. Omit ⇒ keep."}}},"PathUsageBucket":{"type":"object","description":"One per-tier per-day bucket of\n`GET /billing/subscriptions/{id}/path-usage`.\nThe handler rolls `tunnel_traffic_samples` up per\n`(tunnel, UTC-day)`, attributes each tunnel-day to the tunnel's\nmost-recently-created live binding tier\n(`bindings.path_tier_id`), and sums per `(tier, day)`. The\n`(period_start, period_end, bytes_in, bytes_out)` quartet is the\n`BandwidthHistoryItem` shape (\"same shape pattern as\n`/bandwidth/history`\"); this adds the `(path_tier_id, slug)`\nseries key so the chart can split one line per tier without a\nsecond request.\n\n`bytes_in` / `bytes_out` are raw bytes (no GB floor — the\n`/bandwidth/history` precedent keeps bytes; the chart converts).\nThe schema CHECK (`bytes_in >= 0`, `bytes_out >= 0`) on\n`tunnel_traffic_samples` keeps the sums non-negative.\n\nResponse-only (no `Validate`): an org-scoped GET with no client\nbody.","required":["period_start","period_end","path_tier_id","slug","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Sum of `tunnel_traffic_samples.bytes_in` over every tunnel\nof the subscription whose live binding selected this tier,\nrestricted to samples whose UTC day equals this bucket."},"bytes_out":{"type":"integer","format":"int64","description":"Sum of `tunnel_traffic_samples.bytes_out`, same scope as\n[`bytes_in`](Self::bytes_in)."},"path_tier_id":{"type":"string","description":"`network_path_tiers.id` (UUIDv7) of the tier this\nbucket's traffic was attributed to — the chart's per-line\nseries key."},"period_end":{"type":"string","description":"RFC3339 UTC timestamp one day after `period_start`\n(exclusive upper bound of the bucket)."},"period_start":{"type":"string","description":"RFC3339 UTC timestamp at the start of the day-bucket (UTC\nmidnight of the rollup day). The bucket covers\n`[period_start, period_end)`."},"slug":{"type":"string","description":"`network_path_tiers.slug` — the stable human-readable tier\nhandle (e.g. `standard`, `premium`); the chart's series\nlabel, so the dashboard need not cross-reference the\nroster to name a line."}}},"PathUsageListResponse":{"type":"object","description":"Wire response for `GET /billing/subscriptions/{id}/path-usage`.\nOne-array envelope plus an opaque `next_cursor`,\nmirroring the `BandwidthHistoryListResponse`. `next_cursor`\nis `null` on the last page (fewer than `limit` rows returned);\na non-null cursor MUST be passed back verbatim on the follow-up\ncall.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PathUsageBucket"},"description":"Per-tier per-day buckets for the resolved subscription,\nordered `period_start DESC, path_tier_id DESC`. Frontends\nMUST render in vector order (the type carries no ordering\nguarantee on its own) and group by `path_tier_id` to draw\none chart line per tier."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad-encoded cursor for the next page;\n`null` when the current page is the last."}}},"PaymentCurrencyTotal":{"type":"object","description":"Totals for one currency.","required":["currency","received_minor","refunded_minor","received_count","failed_minor"],"properties":{"currency":{"type":"string","description":"ISO currency, lower case."},"failed_minor":{"type":"integer","format":"int64","description":"Failed attempts, minor units."},"received_count":{"type":"integer","format":"int64","description":"Payments received."},"received_minor":{"type":"integer","format":"int64","description":"Received (succeeded, refunded or partly refunded), minor units."},"refunded_minor":{"type":"integer","format":"int64","description":"Refunded out of that, minor units."}}},"PaymentListResponse":{"type":"object","description":"Wire response for `GET /billing/payments`. One-array envelope\nplus an opaque `next_cursor` token. Mirrors the\n`CryptoPaymentListResponse` and `AddonListResponse` precedents\nin the sibling type modules.\n\n`next_cursor` is `None` on the last page (the page returned\nfewer than `limit` rows); a non-null cursor MUST be passed back\nverbatim on the follow-up call. The cursor codec ships with this\ntype (below); the matching list handler consumes it.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentRead"},"description":"Payments scoped to the caller's resolved org, ordered\n`(created_at DESC, source ASC, id DESC)` (newest first;\n`Stripe` ahead of `Crypto` on identical-timestamp ties for\nstability). The handler PR pins the ordering; the type\ncarries no ordering guarantee on its own — frontends MUST\nrender in vector order."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad-encoded cursor for the next page;\n`null` when the current page is the last."},"summary":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaymentSummary","description":"Headline figures over every row the filter matches (staff list,\nfirst page only)."}]}}},"PaymentRead":{"type":"object","description":"One row of `GET /billing/payments`.\nFlat normalised projection across `stripe_checkout_sessions` and\n`crypto_payments` so the listing surface is uniform regardless\nof the underlying source table. Per-source detail (crypto tx\nhashes, Stripe checkout URL, confirmations) is intentionally\nexcluded — frontends drill into the per-source single-get\nsurface for that.\n\n`org_id` is `String` (UUIDv7 RFC4122 string form) to match every\nother customer-facing read shape in this area. `user_id` and\n`plan_id` are `Option<String>` because both source tables apply\n`ON DELETE SET NULL` on those FKs (rows survive their referent's\nremoval for billing-history retention).\n\n`amount_minor` is the unified USD-cent amount: for `Stripe` rows\nit is `stripe_checkout_sessions.amount` (already cents); for\n`Crypto` rows it is `(crypto_payments.total_usd * 100).round()`.\nRendering the original native crypto amount (string-typed for\narbitrary precision) is a per-source detail-surface concern and\nstays on [`crate::platform::billing::crypto_payment_types::CryptoPaymentRead`].\n\n`currency` is the original currency the customer was billed in\n(`'usd'` / `'eur'` for `Stripe` rows, `'btc'` / `'eth'` / etc.\nfor `Crypto` rows) so a frontend can render the currency badge\neven though the unified amount is normalised to USD cents.\n\n`status` is the normalised value across the two source families:\none of `pending` / `succeeded` / `cancelled` / `expired` /\n`failed`. The handler does the per-source mapping; this\ntype carries no validator on the column because the wire is a\nprojection of server-emitted state, not customer-supplied input.","required":["id","source","org_id","currency","amount_minor","status","created_at"],"properties":{"amount_minor":{"type":"integer","format":"int64","description":"Unified USD-cent amount. For `Stripe` rows this is the source\n`amount` column directly (already cents). For `Crypto` rows\nthis is `(total_usd * 100).round() as i64` so the unified\nlisting can be summed and ordered without per-source\nbranching. Native crypto amounts (string-typed for arbitrary\nprecision) stay on the crypto detail surface."},"amount_refunded":{"type":"integer","format":"int64","description":"Refunded out of `amount_minor` (invoice payments), minor units."},"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp. The canonical ordering field\nfor the listing surface — the handler orders the merged\nstream by `(created_at DESC, source ASC, id DESC)` so two\nrows at the same instant from different sources order\nstably."},"crypto_amount":{"type":["string","null"],"description":"The coin amount of a crypto payment."},"crypto_currency":{"type":["string","null"],"description":"The coin a crypto payment was quoted in (`BTC`, …); `currency` is\nthen `usd` and `amount_minor` the USD value."},"currency":{"type":"string","description":"Original currency the customer was billed in. Lowercase ASCII\n— `'usd'` / `'eur'` / etc. for `Stripe` rows; `'btc'` /\n`'eth'` / `'usdt'` / `'xmr'` for `Crypto` rows. Free-form on\nboth source schemas; the wire mirrors the source value."},"failure_reason":{"type":["string","null"],"description":"Why a crypto payment needs a person: `received_unapplied_live_subscription`\n(received, not applied to a plan) or `amount_missing` (confirmed\nwithout a readable amount); `underpaid` for a refused one."},"hosted_url":{"type":["string","null"],"description":"Stripe-hosted invoice page, for invoice rows."},"id":{"type":"string","description":"Source row's primary key (`stripe_checkout_sessions.id` for\n`Stripe` rows — Stripe's session id; `crypto_payments.id`\nfor `Crypto` rows — UUIDv7). Distinct id spaces across the\ntwo sources is why the cursor carries `source` as part of\nthe tie-breaker (see [`PaymentListCursor`])."},"org_id":{"type":"string","description":"Owning org. The caller's principal must hold\n`billing:payment:read` against this org for the row to\nsurface (the handler scopes the SELECT to the resolved\norg)."},"plan_id":{"type":["string","null"],"description":"Plan the payment is purchasing. NULL on `Stripe` rows whose\nreferenced plan has been removed (`stripe_checkout_sessions\n.plan_id` is `ON DELETE SET NULL`); always populated on\n`Crypto` rows by schema (`crypto_payments.plan_id` is\n`ON DELETE RESTRICT` — a plan with active crypto payments\ncannot be removed) but the wire keeps the optional shape so\nthe unified contract does not vary per source."},"plan_name":{"type":["string","null"],"description":"Human-readable plan name. For `Stripe` rows the column\n(`stripe_checkout_sessions.plan_name`) is denormalised on the\nrow at create time; for `Crypto` rows the handler\nresolves it via a `plans.name` join. NULL when the join\nfinds no row (legacy data) or when the source column is NULL\n— frontends render the missing case as a placeholder."},"reference":{"type":["string","null"],"description":"Invoice number, for invoice rows."},"resolution":{"type":["string","null"],"description":"How staff settled it: `refunded` or `applied_manually`."},"resolution_note":{"type":["string","null"],"description":"Staff's note on the settlement."},"source":{"$ref":"#/components/schemas/PaymentSource","description":"Discriminator the wire dispatches on; matches the source\ntable family. See [`PaymentSource`]."},"status":{"type":"string","description":"Normalised lifecycle status across the two source families:\n`pending` / `succeeded` / `cancelled` / `expired` / `failed`.\nThe handler maps Stripe `'open'` → `pending`,\nStripe `'paid'` → `succeeded`, Stripe `'cancelled'` /\n`'expired'` / `'failed'` to themselves; crypto `'pending'`\n/ `'confirming'` → `pending`, crypto `'completed'` →\n`succeeded`, crypto `'expired'` / `'failed'` to themselves.\nSource-specific lifecycle nuance (`confirming` on the way to\n`completed`) lives on the per-source detail surfaces."},"user_id":{"type":["string","null"],"description":"User who initiated the checkout. NULL when the user has been\nremoved (`ON DELETE SET NULL` on both source tables); the\nrow stays attached to the org for audit/billing purposes."}}},"PaymentSource":{"type":"string","description":"Source-table family the row was projected from. The\nhandler maps `stripe_checkout_sessions` rows to\n[`PaymentSource::Stripe`] and `crypto_payments` rows to\n[`PaymentSource::Crypto`]. The wire form is `snake_case` so a\nJSON consumer reads `\"source\": \"stripe\"` / `\"source\": \"crypto\"`.\n\n`Copy` is derived so the value can pass through the cursor codec\nand per-row projection without `Clone` ceremony — the variant\ncarries no data and a discriminant byte is the entirety of the\nruntime representation.","enum":["stripe","crypto","invoice"]},"PaymentSummary":{"type":"object","description":"Headline figures over every row the filter matches, not one page.","required":["currencies","total_count","failed_count","pending_count"],"properties":{"currencies":{"type":"array","items":{"$ref":"#/components/schemas/PaymentCurrencyTotal"},"description":"Per-currency totals (crypto counts in USD)."},"failed_count":{"type":"integer","format":"int64","description":"Failed attempts."},"pending_count":{"type":"integer","format":"int64","description":"Attempts still pending."},"total_count":{"type":"integer","format":"int64","description":"Rows in the list."}}},"PeerPathDetail":{"allOf":[{"$ref":"#/components/schemas/PeerPathRead","description":"The path row itself."},{"type":"object","required":["rationale"],"properties":{"rationale":{"type":"string","description":"Human-readable rationale derived from `via`."}}}],"description":"`GET /devices/mesh/paths/{src}/{dst}` response — the row plus a\nderived rationale for the path decision the optimizer made. The\nrationale is computed from `via`, not stored, so this projection is\nalways in sync with the chosen route."},"PeerPathListResponse":{"type":"object","description":"`GET /devices/mesh/paths` response.","required":["paths"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` when exhausted."},"paths":{"type":"array","items":{"$ref":"#/components/schemas/PeerPathRead"},"description":"Page of peer_path records, ordered `created_at DESC, id DESC`."}}},"PeerPathRead":{"type":"object","description":"One `peer_paths` row as the customer sees it.","required":["id","org_id","src_device_id","dst_device_id","via","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 instant the row was created."},"dst_device_id":{"type":"string","description":"Destination device."},"id":{"type":"string","description":"`peer_paths.id` (UUIDv7)."},"last_probed_at":{"type":["string","null"],"description":"RFC3339 instant of the last probe."},"org_id":{"type":"string","description":"Owning org."},"rtt_ms":{"type":["integer","null"],"format":"int64","description":"Round-trip latency from the last probe; absent until the first\n`POST /devices/mesh/probe` (or worker-driven probe) succeeds."},"src_device_id":{"type":"string","description":"Source device."},"updated_at":{"type":"string","description":"RFC3339 instant of the most recent update."},"via":{"type":"string","description":"Chosen route: `direct:lan`, `hub:<server_id>`, `bridge:<id>`, or\nany future opaque format the optimizer emits."}}},"PendingBindingRead":{"type":"object","description":"One pending binding row the agent must materialise on its local\nnft `appsynergy` table. The handler joins\n`bindings`–`public_ips` so the agent receives the resolved\n`public_ip` address rather than just the foreign-key id (the\nagent has no way to dereference a `public_ips.id` on its own).\n\nField set is the minimum the agent's apply path consumes — the\nid (for the PATCH-back), the two IPs (the DNAT / SNAT\ntuple), the rule kind, the nft priority, the optional\n`dest_ports` subset (grammar), the\n`routing_server_id` (so the agent can sanity-check its own\nidentity against the row), and `created_at` (so the agent's\nmetrics can compute apply latency). The schema's `last_error`,\n`applied_at`, and `removed_at` are intentionally NOT surfaced\nhere — they apply to bindings already past the pending state.","required":["id","public_ip","destination_ip","rule_type","priority","routing_server_id","created_at"],"properties":{"created_at":{"type":"string","format":"date-time","description":"Timestamp the binding entered the `pending` state. Used by\nthe agent's apply-latency metric. RFC3339 wire form."},"dest_ports":{"type":["string","null"],"description":"Optional port-forward subset for the binding. `None` means\nfull-IP routing (the legacy default); `Some` carries a\ncomma-separated proto/port list like\n`\"tcp/443,udp/53,tcp/8080-8090\"` exactly as stored on\n`bindings.dest_ports`. Surfaced on the wire because the\nagent's apply path consumes this value to construct the\ncorrect nft expression — a pending row that omitted it\nwould land as full-IP DNAT even when the schema scoped the\nrule to a port subset."},"destination_ip":{"type":"string","description":"Internal target the binding forwards to. Stored directly on\n`bindings.destination_ip`. The tuple validator\n(`(public_ip, destination_ip)` must match the DB row) reads\nthis same column on the PATCH-back path."},"id":{"type":"string","description":"Binding row id. The agent feeds this back through the\n`PATCH /router/bindings/{id}/status` when reporting apply\nsuccess / failure."},"priority":{"type":"integer","format":"int64","description":"nft rule priority for tie-breaking when multiple bindings\nmatch the same flow. Stored on `bindings.priority`."},"public_ip":{"type":"string","description":"Public-facing IP the binding routes. Resolved from the\n`public_ips.ip_address` column via JOIN; the agent never\nhas to dereference `public_ip_id` on its own."},"routing_server_id":{"type":"string","description":"The `routing_servers.id` row this binding is scoped to. The\nAPI already filters by this column against the auth'd\nagent's ownership; surfacing the value lets the agent's\napply path sanity-check its own identity without a second\nround-trip to `/router/config`."},"rule_type":{"$ref":"#/components/schemas/RouterRuleType","description":"Rule kind. Mirrors the `bindings.rule_type` CHECK\nconstraint via the shared [`RouterRuleType`] enum."},"tunnel_server_endpoint":{"type":["string","null"],"description":"Host part of the tunnel's WG server `servers.endpoint`\n(e.g. `64.112.14.13`), when this row is a tunnel binding.\n`None` for `host_routes` rows (no tunnel). The router agent\nmaps the last octet onto the host↔WG veth nexthop\n(`ops/compose/wg-veth.sh`: `.11`/`.12`/`.13`) so it can\ninstall a per-peer overlay `/32`."}}},"PendingBindingsResponse":{"type":"object","description":"Response shape for `GET /router/bindings/pending`. The\n`bindings` array is `[]` when no pending bindings exist for\nthe auth'd agent (the long-poll path returns `[]` after its\ndeadline expires without a hit).\n\n`server_time` is a server-derived \"now\" so the agent's drift\nmetrics can use a clock that is consistent with the API's view\nof time (mirrors the heartbeat contract where the\nhandler's `now` is the canonical sample timestamp, not the\nagent-supplied `started_at`).","required":["bindings","server_time"],"properties":{"bindings":{"type":"array","items":{"$ref":"#/components/schemas/PendingBindingRead"},"description":"Zero or more pending binding rows scoped to the auth'd\nagent's `routing_servers` ownership. Order is stable —\n`(created_at ASC, id ASC)` — so the agent's apply path\nprocesses older bindings first and ties break\ndeterministically."},"server_time":{"type":"string","format":"date-time","description":"Server-derived \"now\" for the agent's drift / latency\nmetrics. RFC3339 wire form."}}},"PlanChangePreviewRead":{"type":"object","description":"What a plan change does, before or after it is made.","required":["kind","timing","amount_due_now","currency","effective_at","new_price"],"properties":{"amount_due_now":{"type":"integer","format":"int64","description":"What Stripe charges now, in the currency's minor unit (0 for a change\nat period end)."},"currency":{"type":"string","description":"ISO currency of `amount_due_now`."},"effective_at":{"type":"string","description":"RFC3339 UTC time the new plan applies."},"kind":{"type":"string","description":"`upgrade`, `downgrade` or `cycle_change`."},"new_price":{"type":"number","format":"double","description":"The new plan's list price per cycle, in major units."},"timing":{"type":"string","description":"`now` (upgrade) or `period_end` (downgrade, cycle change)."}}},"PlanChangeRead":{"type":"object","description":"Result of `POST …/plan-change`.","required":["change","subscription"],"properties":{"change":{"$ref":"#/components/schemas/PlanChangePreviewRead","description":"What was done."},"subscription":{"$ref":"#/components/schemas/SubscriptionRead","description":"The subscription afterwards (its plan has changed for an upgrade; a\nscheduled change shows in `scheduled_change`)."}}},"PlanChangeRequest":{"type":"object","description":"Request body: the plan and cycle to move to.","required":["plan_id","billing_cycle"],"properties":{"billing_cycle":{"type":"string","description":"Target cycle: `monthly` / `biweekly` / `annual`."},"plan_id":{"type":"string","format":"uuid","description":"Target plan."}}},"PlanEntryWire":{"type":"object","description":"One flattened, agent-renderable rule. Field order is evaluation order\nwithin the parent plan (floor → custom → profile → baseline); the host\nadapter renders nft rules top-to-bottom, first match wins.","required":["direction","src","dst","protocol","dst_ports","verdict","origin"],"properties":{"direction":{"type":"string","description":"`\"any\" | \"inbound\" | \"outbound\" | \"intra\"`."},"dst":{"type":"string","description":"Destination matcher: `\"any\"`, a CIDR, an exact address,\n`domain:<hostname>`, or `category:<slug>`."},"dst_ports":{"type":"string","description":"`\"any\"`, a single port (`443`), or an inclusive range (`8000-8100`)."},"forward_endpoint":{"type":["string","null"],"description":"The DNAT target when `verdict == \"forward\"`, else `null`."},"origin":{"type":"string","description":"Provenance: `\"floor\" | \"custom\" | \"profile\" | \"baseline\"`."},"protocol":{"type":"string","description":"`\"any\" | \"tcp\" | \"udp\" | \"icmp\"`."},"src":{"type":"string","description":"Source matcher: `\"any\"`, a CIDR (`10.0.0.0/8`), an exact address,\n`domain:<hostname>`, or `category:<slug>`. Domain/category are L7 —\nthe host nft adapter skips them (cannot enforce)."},"verdict":{"type":"string","description":"`\"allow\" | \"deny\" | \"forward\"`."}}},"PlanImportStripeRequest":{"type":"object","description":"Body for `POST /platform/plans/{id}/import-stripe`.","properties":{"dry_run":{"type":["boolean","null"],"description":"`true` = count what would be imported without writing."}}},"PlanImportStripeResponse":{"type":"object","description":"Response for `POST /platform/plans/{id}/import-stripe`.","required":["imported","skipped_existing","skipped_unmatched","skipped_org_live","truncated","dry_run"],"properties":{"dry_run":{"type":"boolean","description":"Echo of the effective dry-run flag."},"imported":{"type":"integer","format":"int64","description":"Local subscription rows created (or that would be, when\n`dry_run`)."},"skipped_existing":{"type":"integer","format":"int64","description":"Stripe subscriptions already present locally."},"skipped_org_live":{"type":"integer","format":"int64","description":"Live Stripe subscriptions not imported because their org already\nhas a live subscription (one per org)."},"skipped_unmatched":{"type":"integer","format":"int64","description":"Stripe subscriptions whose customer matched no local org."},"truncated":{"type":"boolean","description":"`true` when any price page reported more rows past the first\npage — re-run to drain the tail."}}},"PlanListResponse":{"type":"object","description":"Response body for `GET /billing/plans`.","required":["items","offered_cycles","crypto_enabled"],"properties":{"crypto_enabled":{"type":"boolean","description":"Whether crypto checkout is offered on this deployment\n(`crypto_settings.enabled`). When false the frontend hides every crypto\npayment surface."},"free_tier_enabled":{"type":"boolean","description":"Whether a free plan can be started (`POST /billing/subscriptions`)."},"items":{"type":"array","items":{"$ref":"#/components/schemas/PlanRead"},"description":"Active, visible plans ordered by `display_order ASC, id ASC`."},"offered_cycles":{"type":"array","items":{"type":"string"},"description":"Billing cycles a new subscription may be started on, in catalog order.\nThe pricing page and checkout flow render only these; deprecated cycles\n(e.g. biweekly) are omitted so customers cannot start one, while existing\nsubscribers keep renewing on whatever cycle they hold. Sourced from\n`billing_settings` (migration 0202), not hard-coded."},"stripe_enabled":{"type":"boolean","description":"Whether card checkout (Stripe) is configured on this deployment."},"trial_days":{"type":"integer","format":"int64","description":"Length of the one-time free trial (`POST /billing/checkout/stripe` with `trial: true`)\nin days, so the console's copy matches what is granted."}}},"PlanPathTierAdminEntry":{"type":"object","description":"One row of `GET /platform/plan-path-tiers` — the **admin**\nview of one `plan_path_tiers` join row: the grant that makes a\nnetwork-path tier either \"included in plan X\" (`included = true`)\nor \"available as a metered overage on plan X\" (`included =\nfalse`). Every field maps straight off the `plan_path_tiers`\ntable (`0017_path_tiers_qos_init.sql`); this is the admin-side\nread of the same join the\n[`crate::products::path_tiers::path_tier_types::SubscriptionPathTierEntry`]\nsurfaces per-subscription. Create / patch / delete\nthese rows; this is the read.\n\nResponse-only (no `Validate`): the admin list is a GET with no\nclient body. `id` / `plan_id` / `path_tier_id` are the UUIDv7\n`TEXT` FK columns; `included` is the column's `0/1`\nINTEGER mapped to `bool` (non-zero ⇒ `true`, matching the\n`CHECK (included IN (0,1))`); `overage_limit_gb_per_month` is the\nnullable per-grant overage cap (`>= 0` when set, schema CHECK),\n`None` when the column is `NULL` (no per-grant cap).","required":["id","plan_id","path_tier_id","included"],"properties":{"id":{"type":"string","description":"`plan_path_tiers.id` (UUIDv7). The stable handle the\nsingle-grant paths key off."},"included":{"type":"boolean","description":"`plan_path_tiers.included` — `true` ⇒ the tier ships in the\nplan at no extra fixed cost; `false` ⇒ it is available only\nas an opt-in metered overage. The `0/1` INTEGER mapped to\n`bool`."},"overage_limit_gb_per_month":{"type":["integer","null"],"format":"int64","description":"`plan_path_tiers.overage_limit_gb_per_month` — the optional\nper-grant hard cap on metered overage GB for this plan↔tier\npair. `None` when the column is `NULL` (no per-grant cap;\nthe subscription-level `allow_overages` toggle still\ngoverns). `>= 0` when set (schema CHECK)."},"path_tier_id":{"type":"string","description":"`plan_path_tiers.path_tier_id` — the `network_path_tiers` row\nthis grant exposes (FK, `ON DELETE RESTRICT`: a tier cannot\nbe deleted while a plan still grants it — the 409\nprecedent at the plan-grant layer)."},"plan_id":{"type":"string","description":"`plan_path_tiers.plan_id` — the `plans` row this grant\nbelongs to (FK, `ON DELETE CASCADE`: the join vanishes with\nthe plan)."}}},"PlanPathTierAdminListResponse":{"type":"object","description":"Response envelope for `GET /platform/plan-path-tiers`. A\nplain list of [`PlanPathTierAdminEntry`] ordered by\n`plan_path_tiers.id` ASC — the UUIDv7 PK is time-ordered, so this\nis the deterministic creation order with no extra ordering\ncolumn. No `next_cursor`: `plan_path_tiers` is a bounded\nadmin-curated join (one row per plan↔tier grant, both sides\nadmin-curated catalogs), so it is unpaginated exactly like the\n`PathTierAdminListResponse` / `PathTierCatalogResponse`\n/ `PlanListResponse` catalogs — cursor pagination\nis for unbounded-growth lists, not a curated join. The list is\nfilterable by `plan_id` and / or `path_tier_id` (query\nparams); both absent ⇒ the full join.","required":["plan_path_tiers"],"properties":{"plan_path_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PlanPathTierAdminEntry"},"description":"One entry per matching `plan_path_tiers` row, ordered\n`id ASC`. `[]` when no grant matches the filter (or none\nexists yet)."}}},"PlanPathTierCreateRequest":{"type":"object","description":"Request body for `POST /platform/plan-path-tiers` — the\nstaff-tier create of one `plan_path_tiers` join row: the grant\nthat makes a network-path tier either \"included in plan X\"\n(`included = true`) or \"available as a metered overage on plan X\"\n(`included = false`). The created row is echoed back as a\n[`PlanPathTierAdminEntry`] — the same shape lists,\npatches, deletes.\n\n`plan_id` / `path_tier_id` are typed `Uuid` so a malformed value\nis rejected at deserialization (the `org_assume_grants_create`\n`source_org_id: Uuid` precedent); the handler additionally\nverifies both reference an existing row (per-field 422\n`not_found`) before the INSERT, and the schema\n`UNIQUE (plan_id, path_tier_id)` makes a duplicate grant a 409\n(the `org_assume_grants_create` duplicate-grant precedent).\n`included` defaults to the schema default `1` (true);\n`overage_limit_gb_per_month` is the optional per-grant cap,\n`>= 0` when set (schema CHECK), absent ⇒ `NULL` (no per-grant\ncap).","required":["plan_id","path_tier_id"],"properties":{"included":{"type":"boolean","description":"`plan_path_tiers.included` — `true` ⇒ the tier ships in the\nplan at no extra fixed cost; `false` ⇒ the tier is available\nonly as an opt-in metered overage. Absent ⇒ `true` (schema\ndefault `1`)."},"overage_limit_gb_per_month":{"type":["integer","null"],"format":"int64","description":"`plan_path_tiers.overage_limit_gb_per_month` — the optional\nper-grant hard cap on metered overage GB for this plan↔tier\npair. Absent ⇒ `NULL` (no per-grant cap; the\nsubscription-level `allow_overages` toggle still governs).\n`>= 0` when set (schema CHECK)."},"path_tier_id":{"type":"string","format":"uuid","description":"`plan_path_tiers.path_tier_id` — the `network_path_tiers` row\nthis grant exposes. Must reference an existing tier\n(handler-checked, 422 `not_found`); the schema FK\n`ON DELETE RESTRICT` blocks deleting a tier a plan still\ngrants (the 409 precedent at the plan-grant layer)."},"plan_id":{"type":"string","format":"uuid","description":"`plan_path_tiers.plan_id` — the `plans` row this grant\nbelongs to. Must reference an existing plan (handler-checked,\n422 `not_found`); the schema FK `ON DELETE CASCADE` removes\nthe grant if the plan is later deleted."}}},"PlanPathTierDeleteResponse":{"type":"object","description":"Response envelope for `DELETE /platform/plan-path-tiers/{id}`:\n`{ ok: true }` on the single 200 path (the hard-delete\nof one `plan_path_tiers` join row), mirroring the\n[`super::path_tier_admin_types::PathTierDeleteResponse`] /\n[`crate::platform::agents::agent_types::AgentRetireResponse`]\nshape. A deliberate plan-grant-local copy (not a reuse of the\ntier-catalog `PathTierDeleteResponse`) so the plan-grant wire\nvocabulary stays self-contained on its own resource path — the\nper-concern file discipline this module follows. The audit row is\nthe canonical record (`prev_plan_id` / `prev_path_tier_id` /\n`prev_included` / `prev_overage_limit_gb_per_month` so the removed\ngrant stays reconstructable after the row is gone); the 404 path\nreturns an [`crate::error::ApiError`], never this shape.\nResponse-only, no `Validate`; `ToSchema`.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for a\nforward-compatible envelope shape rather than as a status\nflag (the `PathTierDeleteResponse` / `AgentRetireResponse`\nprecedent)."}}},"PlanPathTierUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/plan-path-tiers/{id}` —\nstaff-tier partial-edit of one `plan_path_tiers` join row. The\nresponse is the refreshed row as a [`PlanPathTierAdminEntry`] (the\nsame shape lists / creates), so the caller\nreads-after-write in one round trip.\n\n**Only `included` and `overage_limit_gb_per_month` are\npatchable.** `plan_id` / `path_tier_id` are the grant identity\n(the schema `UNIQUE (plan_id, path_tier_id)`): retargeting either\nis a *new* grant, not an edit, so they are deliberately absent\nfrom this body — a wire key for them is ignored, never honoured.\n`plan_path_tiers` has no `created_at` / `updated_at` columns\n(`0017_path_tiers_qos_init.sql`), so an empty-object PATCH (`{}`)\nis a pure no-op that returns the unchanged row (no timestamp\ntouch).\n\nNull-handling (the `PathTierUpdateRequest` precedent):\n\n- `included` is a plain `Option<bool>`: present ⇒ set, omitted ⇒\n  keep. The column is `NOT NULL` so there is no clear.\n- `overage_limit_gb_per_month` is the nullable **numeric**\n  column: it uses the `double_option` `Option<Option<i64>>`\n  adapter so an explicit JSON `null` clears the per-grant cap to\n  `NULL` (re-pricing the grant to \"no per-grant cap\") while an\n  omitted key keeps it. Its `>= 0` floor is enforced\n  handler-side (the `garde` derive does not traverse the\n  nested option). `#[schema(value_type = Option<i64>)]` keeps the\n  OpenAPI shape a clean nullable integer (the spec is\n  code-generated, the nested option is a serde-only detail).\n\n`updated_at` / `created_at` are intentionally absent (the table\nhas neither column and the wire cannot manage timestamps anyway).","properties":{"included":{"type":["boolean","null"],"description":"New `plan_path_tiers.included` — `true` ⇒ the tier ships in\nthe plan at no extra fixed cost; `false` ⇒ it is available\nonly as an opt-in metered overage. `NOT NULL` column —\npresent ⇒ set, omitted ⇒ keep (no clear)."},"overage_limit_gb_per_month":{"type":["integer","null"],"format":"int64","description":"New `plan_path_tiers.overage_limit_gb_per_month` (the optional\nper-grant hard cap on metered overage GB). The\n`double_option` adapter: omitted ⇒ keep, explicit JSON\n`null` ⇒ clear to `NULL` (no per-grant cap), a number ⇒ set.\n`>= 0` enforced handler-side (schema CHECK mirrored at the\nboundary; the `garde` derive does not traverse the nested\noption)."}}},"PlanRead":{"type":"object","description":"A single billing plan as returned by the anonymous public catalog.\n\nExcludes internal fields (`stripe_product_id`, `stripe_price_id_*`,\n`active`, `visible`) — those are admin-only. Every listed plan is\nalready guaranteed active and visible by the query filter.","required":["id","name","slug","plan_type","price_monthly","price_biweekly","price_annual","profile_count","static_ip_count","allow_tunnel_addons","allow_ip_addons","allow_port_forward","free_trial_eligible","display_order"],"properties":{"allow_ip_addons":{"type":"boolean","description":"Whether static-IP addons are sold for this plan."},"allow_port_forward":{"type":"boolean","description":"Whether port-forward subsets are permitted on this plan (SKU gate)."},"allow_tunnel_addons":{"type":"boolean","description":"Whether tunnel-count addons are sold for this plan."},"description":{"type":["string","null"],"description":"Optional marketing description for the pricing page."},"display_order":{"type":"integer","format":"int64","description":"Admin-assigned sort order used by the pricing page (ascending)."},"free_trial_eligible":{"type":"boolean","description":"Whether this plan qualifies for a free trial."},"id":{"type":"string","description":"UUIDv7 primary key."},"ip_addon_price_monthly":{"type":["number","null"],"format":"double","description":"Per-IP monthly addon price in USD. `null` when\n`allow_ip_addons = false`."},"name":{"type":"string","description":"Human-readable plan name shown in the pricing UI."},"plan_type":{"type":"string","description":"Plan category (`\"personal\"`, `\"team\"`, `\"business\"`, etc.). Maps\nto `plans.type` in the schema."},"price_annual":{"type":"number","format":"double","description":"Annual price in USD."},"price_biweekly":{"type":"number","format":"double","description":"Bi-weekly price in USD."},"price_monthly":{"type":"number","format":"double","description":"Monthly price in USD."},"profile_count":{"type":"integer","format":"int64","description":"Number of WireGuard tunnel profiles included in the base plan."},"slug":{"type":"string","description":"URL-safe slug used in deep links and the pricing manifest."},"static_ip_count":{"type":"integer","format":"int64","description":"Number of static IPs included in the base plan."},"traffic_limit":{"type":["integer","null"],"format":"int64","description":"Monthly traffic cap in bytes. `null` = unlimited."},"tunnel_addon_price_monthly":{"type":["number","null"],"format":"double","description":"Per-tunnel monthly addon price in USD. `null` when\n`allow_tunnel_addons = false`."}}},"PlanServerListResponse":{"type":"object","description":"Response body for `GET /billing/plans/{id}/servers`.","required":["servers"],"properties":{"servers":{"type":"array","items":{"$ref":"#/components/schemas/PlanServerRead"},"description":"Active plan–server associations ordered by\n`priority ASC, server_id ASC`."}}},"PlanServerRead":{"type":"object","description":"One server row as returned by `GET /billing/plans/{id}/servers`.\n\nExcludes sensitive infrastructure columns (`private_key`,\n`available_ips`, `ipv6_subnet`, `nat_network`, `specs`,\n`current_users`, `max_users`) that are admin-only.","required":["id","name","location","endpoint","public_key","server_type","status","allow_static_ips","priority"],"properties":{"allow_static_ips":{"type":"boolean","description":"Whether static IPs can be bound to tunnels on this server."},"endpoint":{"type":"string","description":"WireGuard endpoint address in `host:port` form."},"id":{"type":"string","description":"Server primary key."},"location":{"type":"string","description":"City / data-centre location label (e.g. `\"Amsterdam, NL\"`)."},"name":{"type":"string","description":"Human-readable server display name."},"priority":{"type":"integer","format":"int64","description":"Admin-assigned priority used to order the server list within a\nplan (ascending = higher priority)."},"public_key":{"type":"string","description":"Base64-encoded WireGuard public key for this server."},"region":{"type":["string","null"],"description":"Optional continent / region label (e.g. `\"Europe\"`)."},"server_type":{"type":"string","description":"Server type slug (e.g. `\"wireguard\"`)."},"status":{"type":"string","description":"Operational status: `\"online\"`, `\"offline\"`, `\"error\"`,\nor `\"maintenance\"`."}}},"PlatformAddonCreateRequest":{"type":"object","description":"Body for `POST /platform/addons`.","required":["subscription_id","addon_type"],"properties":{"addon_type":{"type":"string","description":"`tunnel` / `static_ip`."},"billing_cycle":{"type":["string","null"],"description":"`monthly` / `biweekly` / `annual`. Default `monthly`."},"expires_at":{"type":["string","null"],"description":"Optional RFC3339 expiry — a time-boxed comp; NULL grants run\nuntil cancelled."},"quantity":{"type":["integer","null"],"format":"int64","description":"Units granted. Default 1."},"subscription_id":{"type":"string","description":"The subscription (any org) receiving the grant."},"tunnel_type":{"type":["string","null"],"description":"`nat` / `static`; only legal when `addon_type = tunnel`."}}},"PlatformAddonListResponse":{"type":"object","description":"Response envelope for `GET /platform/addons`.","required":["addons"],"properties":{"addons":{"type":"array","items":{"$ref":"#/components/schemas/PlatformAddonRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformAddonRead":{"type":"object","description":"Staff-tier addon row. Mirrors the `subscription_addons` schema.","required":["id","subscription_id","org_id","addon_type","quantity","price_per_unit","total_price","billing_cycle","status","created_at"],"properties":{"addon_type":{"type":"string","description":"`tunnel` / `static_ip`."},"billing_cycle":{"type":"string","description":"`monthly` / `biweekly` / `annual`."},"cancelled_at":{"type":["string","null"],"description":"RFC3339 of cancellation (when `status = cancelled`)."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"expires_at":{"type":["string","null"],"description":"RFC3339 of expiry (active addons may have a future expiry\nwhen the customer requested cancel-at-period-end)."},"id":{"type":"string","description":"`subscription_addons.id` (UUIDv7)."},"org_id":{"type":"string","description":"Owning org."},"price_per_unit":{"type":"number","format":"double","description":"Per-unit price at addon creation."},"quantity":{"type":"integer","format":"int64","description":"Quantity (> 0)."},"status":{"type":"string","description":"`active` / `cancelled`."},"stripe_price_id":{"type":["string","null"],"description":"Stripe price id for this addon line item."},"stripe_product_id":{"type":["string","null"],"description":"Stripe product id for this addon line item."},"subscription_id":{"type":"string","description":"Subscription this addon belongs to."},"total_price":{"type":"number","format":"double","description":"`quantity * price_per_unit` snapshot."},"tunnel_type":{"type":["string","null"],"description":"`nat` / `static` (only meaningful for `addon_type=tunnel`)."}}},"PlatformApiTokenListResponse":{"type":"object","description":"Response envelope for `GET /platform/api-tokens`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformApiTokenRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformApiTokenRead":{"type":"object","description":"Staff-tier api-token row. Mirrors `api_tokens` minus\n`token_hash`.","required":["id","name","org_id","granted_actions","created_at","revoked"],"properties":{"created_at":{"type":"string","description":"RFC3339 of row creation."},"expires_at":{"type":["string","null"],"description":"RFC3339 expiry, if bound."},"granted_actions":{"type":"string","description":"JSON array of action patterns (subset of the owner's\neffective actions). Echoed as-is from the row."},"id":{"type":"string","description":"UUIDv7 primary key."},"last_used_at":{"type":["string","null"],"description":"RFC3339 of the most recent authenticated request, if any."},"name":{"type":"string","description":"Operator-supplied display name."},"org_id":{"type":"string","description":"FK to `orgs.id` — the org the token's grants are scoped to."},"owner_service_account_id":{"type":["string","null"],"description":"FK to `service_accounts.id` — set iff token belongs to a SA."},"owner_user_id":{"type":["string","null"],"description":"FK to `users.id` — set iff token belongs to a human owner."},"revoked":{"type":"boolean","description":"`true` iff the token has been administratively revoked."}}},"PlatformBindingListResponse":{"type":"object","description":"Response envelope for `GET /platform/bindings`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformBindingRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformBindingPatchRequest":{"type":"object","description":"`PATCH /platform/bindings/{id}` request — both fields optional,\nat least one required (an empty patch is operator error, 422).","properties":{"priority":{"type":["integer","null"],"format":"int64","description":"New forwarding priority (higher first). Schema default 100."},"status":{"type":["string","null"],"description":"New status override — one of the schema's\n`pending` / `active` / `removing` / `removed` / `failed`.\nValidated against the enum in the handler; a flip into a\nlive state checks the one-live-binding-per-IP invariant."}}},"PlatformBindingRead":{"type":"object","description":"Staff-tier binding row. Mirrors the post-0019 `bindings` schema.","required":["id","tunnel_id","status","rule_type","destination_ip","priority","created_at","address_family"],"properties":{"address_family":{"type":"string","description":"`v4` / `v6` / `dual`."},"applied_at":{"type":["string","null"],"description":"RFC3339 when the agent acked the rule applied."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"dest_ports":{"type":["string","null"],"description":"Optional port-range spec (`tcp/80,udp/443/...`)."},"dest_protocol":{"type":["string","null"],"description":"`tcp` / `udp` / `both` / NULL (all)."},"destination_ip":{"type":"string","description":"Tunnel-side destination IP (the agent's nft rule rewrites to)."},"exit_server_id":{"type":["string","null"],"description":"FK to `servers.id` — admin-set inter-hub egress relay."},"external_exit_id":{"type":["string","null"],"description":"FK to `external_exits.id` — third-party egress driver."},"id":{"type":"string","description":"UUIDv7 primary key."},"ingress_server_id":{"type":["string","null"],"description":"FK to `servers.id` — actual ingress hub the agent reports."},"last_error":{"type":["string","null"],"description":"Most recent error reported by the agent."},"path_tier_id":{"type":["string","null"],"description":"FK to `network_path_tiers.id`."},"preset_slug":{"type":["string","null"],"description":"5-button preset (`balanced` / `low_latency` / …)."},"priority":{"type":"integer","format":"int64","description":"Forwarding priority (higher first)."},"public_ip6_id":{"type":["string","null"],"description":"Optional FK to `public_ip6s.id` (dual or v6 family)."},"public_ip_id":{"type":["string","null"],"description":"Optional FK to `public_ips.id` (NULL for v6-only bindings)."},"removed_at":{"type":["string","null"],"description":"RFC3339 when the agent removed the rule."},"routing_server_id":{"type":["string","null"],"description":"FK to `routing_servers.id` (NULL while pending bootstrap)."},"rule_type":{"type":"string","description":"`dnat` / `snat` / `both`."},"status":{"type":"string","description":"`pending` / `active` / `removing` / `removed` / `failed`."},"tunnel_id":{"type":"string","description":"FK to `tunnels.id`."}}},"PlatformCryptoPaymentListResponse":{"type":"object","description":"Response envelope for `GET /platform/crypto/payments`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformCryptoPaymentRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformCryptoPaymentRead":{"type":"object","description":"Staff-tier crypto-payment row. Mirrors `crypto_payments` except\n`qr_code_data` (which is a large base64 blob — not useful in\nlist view; the customer-facing GET-by-id endpoint returns it).","required":["id","org_id","plan_id","billing_cycle","currency","wallet_address","amount_crypto","amount_usd","exchange_rate","months","discount","total_usd","confirmations","status","expires_at","created_at","updated_at"],"properties":{"amount_crypto":{"type":"string","description":"Crypto amount as displayed (string for precision)."},"amount_received":{"type":["string","null"],"description":"Crypto amount actually received (string for precision)."},"amount_usd":{"type":"number","format":"double","description":"USD amount (informational, decimal float)."},"billing_cycle":{"type":"string","description":"`monthly` / `biweekly` / `annual`."},"confirmations":{"type":"integer","format":"int64","description":"Block confirmations observed."},"confirmed_at":{"type":["string","null"],"description":"RFC3339 when the payment was confirmed, if any."},"created_at":{"type":"string","description":"RFC3339 row creation."},"currency":{"type":"string","description":"Crypto currency code (e.g. `BTC`, `ETH`, `USDC`)."},"discount":{"type":"number","format":"double","description":"Applied multi-period discount (0..1)."},"exchange_rate":{"type":"number","format":"double","description":"Quoted exchange rate at the time of payment."},"expires_at":{"type":"string","description":"RFC3339 wallet-watch expiry."},"id":{"type":"string","description":"UUIDv7 primary key."},"months":{"type":"integer","format":"int64","description":"Number of months purchased (multi-period prepay)."},"org_id":{"type":"string","description":"FK to `orgs.id`."},"plan_id":{"type":"string","description":"FK to `plans.id`."},"sender_address":{"type":["string","null"],"description":"Sender wallet address, if observed."},"status":{"type":"string","description":"`pending` / `confirming` / `completed` / `expired` / `failed`."},"subscription_id":{"type":["string","null"],"description":"FK to `subscriptions.id`. NULL until the payment completes."},"total_usd":{"type":"number","format":"double","description":"Total USD billed for the purchase."},"tx_hash":{"type":["string","null"],"description":"On-chain transaction hash, if observed."},"updated_at":{"type":"string","description":"RFC3339 last write."},"user_id":{"type":["string","null"],"description":"FK to `users.id`. NULL after user delete."},"wallet_address":{"type":"string","description":"Deposit wallet address shown to the customer."}}},"PlatformDeviceConnectionHealth":{"type":"object","description":"The most-recent `client_connections` row for a device — live or\npast, whichever is newer by `started_at`. `ended_at` is `None`\nwhile the session is still open, which is what makes this a\n\"live health\" signal rather than plain history.","required":["id","started_at","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Cumulative inbound bytes for this session."},"bytes_out":{"type":"integer","format":"int64","description":"Cumulative outbound bytes for this session."},"ended_at":{"type":["string","null"],"description":"RFC3339 instant the session closed; `None` while still open."},"id":{"type":"string","description":"`client_connections.id`."},"last_handshake_at":{"type":["string","null"],"description":"RFC3339 instant of the most recent handshake reported."},"last_telemetry_at":{"type":["string","null"],"description":"RFC3339 instant of the most recent telemetry tick."},"packet_loss_pct":{"type":["number","null"],"format":"double","description":"Last reported packet loss percentage `0..=100`."},"rtt_ms":{"type":["integer","null"],"format":"int64","description":"Last reported round-trip-time over the tunnel in milliseconds."},"server_id":{"type":["string","null"],"description":"Hub server the session terminated on (`None` when deleted)."},"started_at":{"type":"string","description":"RFC3339 instant the session opened."},"tunnel_id":{"type":["string","null"],"description":"Tunnel the session uses (`None` when orphaned from a deleted\ntunnel)."}}},"PlatformDeviceListResponse":{"type":"object","description":"Response body for `GET /platform/devices`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformDeviceRead"},"description":"Page of device records, ordered `created_at DESC, id DESC`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` when exhausted."}}},"PlatformDeviceRead":{"type":"object","description":"One `client_devices` row as staff see it: the row plus org/user\nlookup context and the live-health connection summary.","required":["id","org_id","user_id","device_name","platform","device_type","status","always_on","kill_switch","joined_at","created_at","updated_at"],"properties":{"always_on":{"type":"integer","format":"int64","description":"`always_on` policy (0 / 1)."},"connection":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PlatformDeviceConnectionHealth","description":"The device's most-recent connection (live health), `None` if\nthe device has never connected."}]},"created_at":{"type":"string","description":"RFC3339 row-create instant."},"device_name":{"type":"string","description":"Human label."},"device_type":{"type":"string","description":"Device class."},"id":{"type":"string","description":"`client_devices.id` (UUIDv7)."},"joined_at":{"type":"string","description":"RFC3339 enrolment instant."},"kill_switch":{"type":"integer","format":"int64","description":"`kill_switch` policy (0 / 1)."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 instant of the last heartbeat (`None` until the first)."},"org_id":{"type":"string","description":"Owning org."},"org_name":{"type":["string","null"],"description":"Owning org's display name (`None` if the org row is gone)."},"platform":{"type":"string","description":"Reported platform."},"reported_version":{"type":["string","null"],"description":"The `appsynergy` client build version last reported."},"status":{"type":"string","description":"`joined` / `paused` / `revoked`."},"tunnel_ip":{"type":["string","null"],"description":"In-mesh tunnel IP (`None` until the device joins)."},"updated_at":{"type":"string","description":"RFC3339 row-update instant."},"user_email":{"type":["string","null"],"description":"Owning user's email (`None` if the user row is gone)."},"user_id":{"type":"string","description":"Owning user (the enroller)."}}},"PlatformDnsFilterEntryCreateRequest":{"type":"object","description":"Body for `POST /platform/dns/filter-lists/{id}/entries`. `domain`\nis UNIQUE within the list (collision → 409 `domain_exists`);\n`rewrite_to` is required iff `action = rewrite`.","required":["domain","action"],"properties":{"action":{"type":"string","description":"`block` / `sinkhole` / `rewrite` / `allow`."},"domain":{"type":"string","description":"Domain to match (lowercased server-side)."},"rewrite_to":{"type":["string","null"],"description":"Rewrite target; required iff `action = rewrite`, forbidden\notherwise."}}},"PlatformDnsFilterEntryDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/dns/filter-lists/{id}/entries/{entry_id}`.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"Always `true` on a 200 — the entry is gone."},"id":{"type":"string","description":"The deleted entry's id, echoed back."}}},"PlatformDnsFilterEntryListResponse":{"type":"object","description":"Response envelope for `GET /platform/dns/filter-lists/{id}/entries`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformDnsFilterEntryRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformDnsFilterEntryRead":{"type":"object","description":"One `dns_filter_entries` row.","required":["id","filter_list_id","domain","action","created_at"],"properties":{"action":{"type":"string","description":"`block` / `sinkhole` / `rewrite` / `allow`. `allow` is the\ncategory-precedence primitive: it always wins a\nsame-depth match tie against a `block` from a different\nfilter list."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"domain":{"type":"string","description":"Domain the rule matches (exact, lowercase)."},"filter_list_id":{"type":"string","description":"FK to `dns_filter_lists.id`."},"id":{"type":"string","description":"UUIDv7 primary key."},"rewrite_to":{"type":["string","null"],"description":"Rewrite target — present iff `action = rewrite`."}}},"PlatformDnsFilterListCreateRequest":{"type":"object","description":"Body for `POST /platform/dns/filter-lists`. `name` + `slug` are\nrequired; the rest default to schema defaults (`is_active = 1`,\nnullable `description` / `source_url`).","required":["name","slug"],"properties":{"category_id":{"type":["string","null"],"description":"Taxonomy category, FK to `dns_filter_categories.id`.\n`null` / omitted leaves the list uncategorized. An unknown id\nis rejected `422 category_invalid`."},"description":{"type":["string","null"],"description":"Free-form description (nullable)."},"is_active":{"type":["boolean","null"],"description":"Whether the SKU is selectable by customers. Defaults to `true`\nwhen omitted."},"name":{"type":"string","description":"Operator-supplied display name."},"slug":{"type":"string","description":"URL-safe slug, UNIQUE on the row. Collision → 409 `slug_in_use`."},"source_url":{"type":["string","null"],"description":"Upstream feed URL the resolver re-syncs from (nullable)."}}},"PlatformDnsFilterListDeleteResponse":{"type":"object","description":"Response for a successful delete.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"Always `true` on a 200 — the row is gone."},"id":{"type":"string","description":"The deleted row's id, echoed back."}}},"PlatformDnsFilterListListResponse":{"type":"object","description":"Response envelope for `GET /platform/dns/filter-lists`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformDnsFilterListRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformDnsFilterListPatchRequest":{"type":"object","description":"Body for `PATCH /platform/dns/filter-lists/{id}`. Every field is\noptional; only the present fields are written. An empty body is a\nno-op that returns the unchanged row.\n\n`description` / `source_url` / `category_id` use a nested `Option<Option<String>>`\nso the wire can distinguish \"absent\" (leave as-is) from \"present\nand null\" (clear the column): `None` leaves the column untouched,\n`Some(None)` sets it NULL, `Some(Some(v))` sets it to `v`.","properties":{"category_id":{"type":["string","null"],"description":"New taxonomy category: absent leaves it, `null` clears it, a\nvalue sets it. An unknown id is rejected `422\ncategory_invalid`."},"description":{"type":["string","null"],"description":"New description: absent leaves it, `null` clears it."},"is_active":{"type":["boolean","null"],"description":"New active state, when present."},"name":{"type":["string","null"],"description":"New display name, when present."},"source_url":{"type":["string","null"],"description":"New source feed URL: absent leaves it, `null` clears it."}}},"PlatformDnsFilterListRead":{"type":"object","description":"Staff-tier filter-list row. Superset of the customer projection:\nadds operational metadata (`source_url`, `last_synced_at`,\n`is_active`) and surfaces inactive rows the customer catalog hides.","required":["id","name","slug","is_active","created_at","updated_at"],"properties":{"category_id":{"type":["string","null"],"description":"Taxonomy category this list belongs to\n(`dns_filter_lists.category_id` — FK to\n`dns_filter_categories.id`). `null` for an uncategorized list.\nThe category catalog is DB-driven: rows are seeded by\nmigration or added by an operator, never a compile-time enum."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"description":{"type":["string","null"],"description":"Free-form description (nullable)."},"id":{"type":"string","description":"`dns_filter_lists.id` (UUIDv7)."},"is_active":{"type":"boolean","description":"`true` when the row is selectable by customers (the public\ncatalog filters on this)."},"last_synced_at":{"type":["string","null"],"description":"RFC3339 of the last successful sync."},"name":{"type":"string","description":"Operator-supplied display name."},"slug":{"type":"string","description":"URL-safe slug, UNIQUE on the row."},"source_url":{"type":["string","null"],"description":"Upstream feed URL the resolver re-syncs from."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"PlatformDnsQueryLogItem":{"type":"object","description":"One row in `GET /platform/dns/query-logs` (staff view).","required":["id","ts","query_name","query_type","response_code"],"properties":{"blocked_by_list_slug":{"type":["string","null"],"description":"Slug of the filter list that blocked the query (`LEFT JOIN`\nto `dns_filter_lists`). `null` when not blocked or when the\nreferenced list was later deleted (loose pointer)."},"id":{"type":"integer","format":"int64","description":"`dns_query_logs.id` — autoincrement integer key (cursor TB)."},"query_name":{"type":"string","description":"The queried name (`dns_query_logs.query_name`)."},"query_type":{"type":"string","description":"Record type, e.g. `\"A\"`, `\"AAAA\"`, `\"HTTPS\"`."},"response_code":{"type":"string","description":"DNS response code, e.g. `\"NOERROR\"`, `\"NXDOMAIN\"`."},"response_time_ms":{"type":["integer","null"],"format":"int64","description":"Server-side resolution time in milliseconds. `null` when\nunrecorded."},"subscription_id":{"type":["string","null"],"description":"Subscription the query was attributed to (denormalised; no\nFK; nullable when the resolver could not classify the source)."},"ts":{"type":"string","description":"RFC3339 timestamp the query was answered."},"tunnel_id":{"type":["string","null"],"description":"Tunnel the query was attributed to (denormalised; nullable)."}}},"PlatformDnsQueryLogListResponse":{"type":"object","description":"Response envelope for `GET /platform/dns/query-logs`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformDnsQueryLogItem"},"description":"Page contents — newest first on `(ts DESC, id DESC)`, capped\nat the request's `limit` (default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformDnsServerCreateRequest":{"type":"object","description":"Body for `POST /platform/dns/servers`. Pre-provisions the resolver\nrow the agent-join back-fill links to by `name`. `public_ip_id`\nmust reference an existing `public_ips` row (422\n`public_ip_not_found`); `status` defaults to `inactive` (the agent\nflips it on first heartbeat); `capabilities` defaults to `{}` and\nmust be valid JSON when supplied.","required":["name","public_ip_id"],"properties":{"capabilities":{"type":["string","null"],"description":"Capabilities JSON blob (e.g. DNSSEC, DoH, DoT). Defaults `{}`."},"location":{"type":["string","null"],"description":"City / data-centre label (nullable)."},"name":{"type":"string","description":"Operator-supplied display name — also the agent-join back-fill\nmatch key, so keep it unique across the fleet."},"public_ip_id":{"type":"string","description":"FK to `public_ips.id` — the IP the resolver listens on."},"status":{"type":["string","null"],"description":"Initial status: `active` / `inactive` (default) / `draining`."}}},"PlatformDnsServerDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/dns/servers/{id}`.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"Always `true` on a 200 — the row is gone."},"id":{"type":"string","description":"The deleted resolver's id, echoed back."}}},"PlatformDnsServerListResponse":{"type":"object","description":"Response envelope for `GET /platform/dns/servers`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformDnsServerRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformDnsServerPatchRequest":{"type":"object","description":"Body for `PATCH /platform/dns/servers/{id}`. Every field optional;\nat least one required (empty patch → 422). `location` uses the\ndouble-option convention (absent = leave, `null` = clear, value =\nset); `public_ip_id` is immutable (the resolver's listen address is\nits identity — re-homing is a decommission + re-provision).","properties":{"capabilities":{"type":["string","null"],"description":"New capabilities JSON blob; must be valid JSON."},"location":{"type":["string","null"],"description":"New location: absent leaves it, `null` clears it."},"name":{"type":["string","null"],"description":"New display name, when present."},"status":{"type":["string","null"],"description":"New status — `active` / `inactive` / `draining`."}}},"PlatformDnsServerRead":{"type":"object","description":"Staff-tier DNS-server row. Subset of the schema that excludes\n`agent_id` (the agent FK leads back to credential material\nliving in the `agents` table; staff query that surface separately).","required":["id","name","public_ip_id","status","capabilities","created_at","updated_at"],"properties":{"capabilities":{"type":"string","description":"Capabilities JSON blob (e.g. DNSSEC, DoH, DoT). Echoed raw so\nstaff tools can introspect without a second round-trip."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"id":{"type":"string","description":"`dns_servers.id` (UUIDv7)."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 of the last heartbeat we received from the resolver."},"location":{"type":["string","null"],"description":"City / data-centre location label."},"name":{"type":"string","description":"Operator-supplied display name."},"public_ip_id":{"type":"string","description":"FK to `public_ips.id` — the IP the resolver listens on."},"status":{"type":"string","description":"`active` / `inactive` / `draining`."},"telemetry_json":{"type":["string","null"],"description":"Most recent telemetry blob the resolver pushed (qps, cache\nhit rate, etc.). Optional — null until first heartbeat."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"PlatformExternalExitCreateRequest":{"type":"object","description":"Request body for `POST /platform/external-exits`. The plaintext\n`config` (driver credentials) is AEAD-sealed into the row's\n`config_ct` by the handler and never persisted or echoed.","required":["name","slug","kind","config"],"properties":{"capabilities":{"type":["string","null"],"description":"Free-form per-driver capability flags as a JSON object string.\nAbsent ⇒ `{}`. Handler-validated as parseable JSON."},"config":{"type":"string","description":"Plaintext driver credentials / config. Sealed into `config_ct`\nunder `SETTINGS_ENC_KEY` and never stored or returned in clear."},"cost_cents_per_gb":{"type":"integer","format":"int64","description":"Pass-through egress cost in cents per GB. `>= 0`. Absent ⇒ 0."},"kind":{"type":"string","description":"Driver kind — one of `tor` / `wireguard_external` /\n`openvpn_external` / `socks5` / `http_proxy` / `customer_owned`\n(handler-validated against the `external_exits.kind` CHECK)."},"location_hint":{"type":["string","null"],"description":"Operator-readable location hint. `None` ⇒ column `NULL`."},"name":{"type":"string","description":"Operator-facing display name. Non-empty, `<= 128`."},"slug":{"type":"string","description":"URL-safe slug, UNIQUE on the row. Non-empty, `<= 64`, and\n(handler-checked) lowercase alphanumeric with single internal\nhyphens."},"status":{"type":["string","null"],"description":"Initial status — `active` / `degraded` / `disabled`. Absent ⇒\n`disabled` (a new exit stays disabled until a health probe or an\nexplicit operator enable). Handler-validated against the CHECK."},"visible_to_customers":{"type":"boolean","description":"Whether the driver shows up in the customer-facing path-tier\ncatalog. Absent ⇒ `false`."}}},"PlatformExternalExitDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/external-exits/{id}` — a bare\nsuccess acknowledgement (the row is gone; nothing else to project).","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on a 200 — the driver row was hard-deleted."}}},"PlatformExternalExitListResponse":{"type":"object","description":"Response envelope for `GET /platform/external-exits`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformExternalExitRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformExternalExitRead":{"type":"object","description":"Staff-tier external-exit row.","required":["id","name","slug","kind","capabilities","cost_cents_per_gb","status","visible_to_customers","created_at","updated_at"],"properties":{"capabilities":{"type":"string","description":"Capabilities JSON blob (free-form per-driver flags)."},"cost_cents_per_gb":{"type":"integer","format":"int64","description":"Pass-through egress cost in cents per GB."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"id":{"type":"string","description":"`external_exits.id` (UUIDv7)."},"kind":{"type":"string","description":"Driver kind: `tor` / `wireguard_external` / `openvpn_external`\n/ `socks5` / `http_proxy` / `customer_owned`."},"last_health_check_at":{"type":["string","null"],"description":"RFC3339 of the last health check."},"last_health_check_ok":{"type":["boolean","null"],"description":"Outcome of the last health check, when one has been performed."},"location_hint":{"type":["string","null"],"description":"Operator-readable location hint."},"name":{"type":"string","description":"Operator-supplied display name."},"slug":{"type":"string","description":"URL-safe slug, UNIQUE on the row."},"status":{"type":"string","description":"`active` / `degraded` / `disabled`."},"updated_at":{"type":"string","description":"RFC3339 of last write."},"visible_to_customers":{"type":"boolean","description":"Whether the driver shows up in the customer-facing path-tier\ncatalog."}}},"PlatformExternalExitUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/external-exits/{id}`. Partial\nupdate: every field is `Option<T>` — omit ⇒ column unchanged. The\nplaintext `config`, when supplied, is re-AEAD-sealed into the row's\n`config_ct` and never persisted in clear nor echoed; it has\nno clear path (`config_ct` is `NOT NULL`). `location_hint` follows\nthe empty-string-clears convention (`Some(\"\")` ⇒ column `NULL`).","properties":{"capabilities":{"type":["string","null"],"description":"New capabilities JSON object string. Omit ⇒ unchanged.\nHandler-validated as a parseable JSON object."},"config":{"type":["string","null"],"description":"New plaintext driver credentials / config. Omit ⇒ unchanged.\nWhen present, re-sealed into `config_ct` under `SETTINGS_ENC_KEY`\nand never stored or returned in clear."},"cost_cents_per_gb":{"type":["integer","null"],"format":"int64","description":"New pass-through egress cost in cents per GB. Omit ⇒ unchanged.\n`>= 0`."},"kind":{"type":["string","null"],"description":"New driver kind. Omit ⇒ unchanged. Handler-validated against the\n`external_exits.kind` CHECK enum."},"location_hint":{"type":["string","null"],"description":"New location hint. Omit ⇒ unchanged; empty string ⇒ clears to\n`NULL` (the empty-string-clears convention)."},"name":{"type":["string","null"],"description":"New display name. Omit ⇒ unchanged. Non-empty, `<= 128` (never\na clear — the column is `NOT NULL`)."},"slug":{"type":["string","null"],"description":"New slug. Omit ⇒ unchanged. `<= 64`, handler-re-validated for\nthe lowercase-hyphen grammar + uniqueness."},"status":{"type":["string","null"],"description":"New status — `active` / `degraded` / `disabled`. Omit ⇒\nunchanged. Handler-validated against the CHECK."},"visible_to_customers":{"type":["boolean","null"],"description":"New customer-catalog visibility. Omit ⇒ unchanged."}}},"PlatformExternalExitUsageItem":{"type":"object","description":"One usage-rollup row for `GET /platform/external-exits/{id}/usage`\n— a per-subscription-per-period byte + cost counter (the\n`external_exit_usage` row, minus the redundant `external_exit_id`\nwhich is the path param). Billing-reconciliation data.","required":["id","subscription_id","period_start","period_end","bytes_in","bytes_out","cost_cents"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Inbound bytes for the period."},"bytes_out":{"type":"integer","format":"int64","description":"Outbound bytes for the period."},"cost_cents":{"type":"integer","format":"int64","description":"Pass-through cost accrued for the period, in cents."},"id":{"type":"string","description":"`external_exit_usage.id` (UUIDv7) — the rollup row id."},"period_end":{"type":"string","description":"RFC3339 end of the billing period."},"period_start":{"type":"string","description":"RFC3339 start of the billing period."},"subscription_id":{"type":"string","description":"Owning subscription (cross-org; this surface is staff-only)."}}},"PlatformExternalExitUsageResponse":{"type":"object","description":"Response envelope for `GET /platform/external-exits/{id}/usage`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformExternalExitUsageItem"},"description":"Page contents — newest period first, capped at the request's\n`limit` (default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null` when\nno more rows remain."}}},"PlatformIpPoolCreateRequest":{"type":"object","description":"Body for `POST /platform/ip-pools`. `name` + `cidr` are required;\n`cidr` is UNIQUE (collision → 409 `cidr_in_use`). `prefix_id`, when\ngiven, must reference an existing `network_prefixes` row (the pool's\nhoming is derived from it); a missing prefix → 422.","required":["name","cidr"],"properties":{"cidr":{"type":"string","description":"CIDR carved for this pool, e.g. `203.0.113.0/28`. Must contain a\n`/` prefix-length separator; UNIQUE across pools."},"location":{"type":["string","null"],"description":"City / data-centre label (nullable)."},"name":{"type":"string","description":"Operator-supplied display name."},"notes":{"type":["string","null"],"description":"Free-form ops notes (nullable)."},"prefix_id":{"type":["string","null"],"description":"FK into `network_prefixes` the pool is carved from (nullable for\na legacy-style unhomed pool)."}}},"PlatformIpPoolDeleteResponse":{"type":"object","description":"Response for a successful pool delete.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"Always `true` on a 200 — the pool is gone."},"id":{"type":"string","description":"The deleted pool's id, echoed back."}}},"PlatformIpPoolListResponse":{"type":"object","description":"Response envelope for `GET /platform/ip-pools`. Pool count is\nsmall (one per prefix per PoP) — no cursor pagination.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformIpPoolRead"},"description":"Every pool ordered `created_at ASC, id ASC`."}}},"PlatformIpPoolPatchRequest":{"type":"object","description":"Body for `PATCH /platform/ip-pools/{id}`. Every field optional;\n`cidr` is immutable (the pool's stable identity). `location` /\n`notes` / `prefix_id` use the double-option convention (absent =\nleave, `null` = clear, value = set). Empty body → no-op.","properties":{"location":{"type":["string","null"],"description":"New location: absent leaves it, `null` clears it."},"name":{"type":["string","null"],"description":"New display name, when present."},"notes":{"type":["string","null"],"description":"New notes: absent leaves it, `null` clears it."},"prefix_id":{"type":["string","null"],"description":"New backing prefix: absent leaves it, `null` clears it, value\nre-homes the pool (validated to exist)."}}},"PlatformIpPoolRead":{"type":"object","description":"Staff-tier IP pool row. Mirrors every column of `ip_pools`\nin its post-0018 shape.","required":["id","name","cidr","in_use_count","reserved_count","available_count","resting_count","created_at","updated_at"],"properties":{"available_count":{"type":"integer","format":"int64","description":"Count of `public_ips` in this pool with `status = 'available'` that\ncan be handed out now."},"cidr":{"type":"string","description":"CIDR carved from `prefix_id` (e.g. `203.0.113.0/28`)."},"created_at":{"type":"string","description":"RFC3339 row creation."},"homing":{"type":["string","null"],"description":"Homing model of the backing prefix — `single_homed_static` /\n`anycast`. NULL on legacy pools with no `prefix_id`."},"id":{"type":"string","description":"UUIDv7 primary key."},"in_use_count":{"type":"integer","format":"int64","description":"Count of `public_ips` in this pool with `status = 'in_use'`."},"location":{"type":["string","null"],"description":"City / data-centre label."},"name":{"type":"string","description":"Operator-supplied display name."},"notes":{"type":["string","null"],"description":"Free-form ops notes."},"prefix_id":{"type":["string","null"],"description":"FK into `network_prefixes` — NULL on legacy pre-0018 pools."},"reserved_count":{"type":"integer","format":"int64","description":"Count of `public_ips` in this pool with `status = 'reserved'`."},"resting_count":{"type":"integer","format":"int64","description":"Count of available `public_ips` still resting after a customer\nreleased them."},"updated_at":{"type":"string","description":"RFC3339 last write."}}},"PlatformNetworkPrefixCreateRequest":{"type":"object","description":"Request body for `POST /platform/network-prefixes`. The\n`network_prefixes` table has no credential columns, so every field is\na plain operator-supplied value. `prefix` is CIDR-validated and\nfamily-matched handler-side; `address_family` / `homing` are enums\nchecked handler-side; the schema `CHECK (homing != 'single_homed_static'\nOR home_pop_id IS NOT NULL)` plus the anycast-implies-no-home-PoP rule\nare re-checked handler-side for clean 422s.","required":["prefix","address_family","homing"],"properties":{"address_family":{"type":"string","description":"Address family: `\"v4\"` or `\"v6\"`. Handler-validated against the\nschema CHECK and re-matched against the parsed `prefix`."},"home_pop_id":{"type":["string","null"],"description":"For `single_homed_static`: the PoP whose edge the upstream\nstatically routes to (must reference an existing\n`points_of_presence` row). Required for `single_homed_static`,\nmust be absent for `anycast`."},"homing":{"type":"string","description":"Homing model: `\"single_homed_static\"` (provider-routed to one PoP,\n`home_pop_id` REQUIRED) or `\"anycast\"` (multi-PoP via BGP,\n`home_pop_id` must be absent)."},"notes":{"type":["string","null"],"description":"Operator-readable notes. `None` ⇒ `NULL`."},"prefix":{"type":"string","description":"CIDR-formatted prefix, UNIQUE on the row (e.g. `\"203.0.113.0/24\"`).\nHandler-validated as a parseable CIDR whose family matches\n`address_family`."},"provisioning_provider":{"type":["string","null"],"description":"Free-form provider tag (e.g. `\"transit-a\"`). `None` ⇒ `NULL`."}}},"PlatformNetworkPrefixDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/network-prefixes/{id}` — a bare success\nacknowledgement (the row is gone; nothing else to project).","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on a 200 — the prefix row was hard-deleted."}}},"PlatformNetworkPrefixListResponse":{"type":"object","description":"Response envelope for `GET /platform/network-prefixes`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformNetworkPrefixRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformNetworkPrefixRead":{"type":"object","description":"Staff-tier network-prefix row.","required":["id","prefix","address_family","homing","created_at","updated_at"],"properties":{"address_family":{"type":"string","description":"Address family: `\"v4\"` or `\"v6\"`."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"home_pop_id":{"type":["string","null"],"description":"For `single_homed_static`: the PoP whose edge the upstream\nstatically routes to. `null` for `anycast` (the schema CHECK\nconstraint ties the two together)."},"homing":{"type":"string","description":"Homing model: `\"single_homed_static\"` (provider-routed to one\nPoP) or `\"anycast\"` (multi-PoP via BGP)."},"id":{"type":"string","description":"`network_prefixes.id` (UUIDv7)."},"notes":{"type":["string","null"],"description":"Operator-readable notes."},"prefix":{"type":"string","description":"CIDR-formatted prefix, UNIQUE on the row."},"provisioning_provider":{"type":["string","null"],"description":"Free-form provider tag (e.g. `\"transit-a\"`)."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"PlatformNetworkPrefixUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/network-prefixes/{id}`. Partial\nupdate: every field is `Option<T>`, omit ⇒ column unchanged. Nullable\ntext columns (`provisioning_provider` / `home_pop_id` / `notes`)\nfollow the empty-string-clears convention (`Some(\"\")` ⇒ `NULL`). The\nresulting `(homing, home_pop_id)` pair is re-checked against the\nschema CHECK + the anycast-implies-no-home-PoP rule.","properties":{"address_family":{"type":["string","null"],"description":"New address family (`v4` / `v6`). Omit ⇒ unchanged. Re-matched\nagainst the resulting `prefix`."},"home_pop_id":{"type":["string","null"],"description":"New home PoP id. Omit ⇒ unchanged; empty string ⇒ clears to\n`NULL`; otherwise must reference an existing PoP."},"homing":{"type":["string","null"],"description":"New homing model. Omit ⇒ unchanged. The resulting\n`(homing, home_pop_id)` pair is re-checked."},"notes":{"type":["string","null"],"description":"New notes. Omit ⇒ unchanged; empty string ⇒ clears to `NULL`."},"prefix":{"type":["string","null"],"description":"New CIDR prefix. Omit ⇒ unchanged. Re-validated as a parseable\nCIDR whose family matches the resulting `address_family`;\nuniqueness re-checked (422 `prefix_taken`)."},"provisioning_provider":{"type":["string","null"],"description":"New provider tag. Omit ⇒ unchanged; empty string ⇒ clears to\n`NULL`."}}},"PlatformNotificationListResponse":{"type":"object","description":"`GET /platform/notifications` response.","required":["notifications"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque base64url cursor for the next page; `null` when last."},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/PlatformNotificationRead"},"description":"Cross-org notifications, `(created_at DESC, id DESC)`."}}},"PlatformNotificationRead":{"type":"object","description":"One row of the staff-only cross-org `GET /platform/notifications`.\nIdentical to [`NotificationRead`] plus the owning `user_id` so\nsupport can route a row back without a follow-up SELECT (the\n`platform_audit_list` cross-org `org_id` precedent).","required":["id","user_id","kind","status","payload","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 UTC enqueue time."},"dispatched_at":{"type":["string","null"],"description":"RFC3339 UTC dispatch time; `null` while `pending`."},"id":{"type":"string","description":"Row id (UUIDv7)."},"kind":{"type":"string","description":"Kind slug."},"payload":{"$ref":"#/components/schemas/Value","description":"Trigger payload — the free-form column (carve-out as above)."},"status":{"type":"string","description":"`pending` | `sent` | `failed`."},"user_id":{"type":"string","description":"Owning user id."}}},"PlatformOrgListResponse":{"type":"object","description":"Response body for `GET /platform/orgs`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformOrgRead"},"description":"Page of org records, ordered `created_at DESC, id DESC`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` when exhausted."}}},"PlatformOrgRead":{"type":"object","description":"One `orgs` row as staff see it, plus lightweight lookup context\n(`owner_email`, `member_count`) that a plain `orgs` projection\ncannot answer without a join.","required":["id","name","kind","member_count","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 row-create instant."},"id":{"type":"string","description":"`orgs.id` (UUIDv7)."},"kind":{"type":"string","description":"`personal` / `team` / `platform`."},"member_count":{"type":"integer","format":"int64","description":"Count of `org_members` rows for this org."},"name":{"type":"string","description":"Display name."},"owner_email":{"type":["string","null"],"description":"Email of the earliest-invited `org_admin` member, if any. The\nemail a support ticket typically arrives from."},"updated_at":{"type":"string","description":"RFC3339 row-update instant."}}},"PlatformPlanCreateRequest":{"type":"object","description":"`POST /platform/plans` request body.","required":["name","slug","plan_type"],"properties":{"active":{"type":["boolean","null"],"description":"Whether the plan is active (drafts default to false)."},"allow_ip_addons":{"type":["boolean","null"],"description":"Static-IP-addon SKU enabled."},"allow_port_forward":{"type":["boolean","null"],"description":"Port-forward subset SKU gate."},"allow_tunnel_addons":{"type":["boolean","null"],"description":"Tunnel-addon SKU enabled."},"description":{"type":["string","null"],"description":"Marketing description."},"display_order":{"type":["integer","null"],"format":"int64","description":"Sort order in the catalog."},"free_trial_eligible":{"type":["boolean","null"],"description":"Free-trial eligibility."},"ip_addon_price_monthly":{"type":["number","null"],"format":"double","description":"Per-IP monthly addon price; NULL when SKU disabled."},"name":{"type":"string","description":"Human-readable plan name."},"plan_type":{"type":"string","description":"Plan category — the schema column is `type`."},"price_annual":{"type":["number","null"],"format":"double","description":"Annual price in USD."},"price_biweekly":{"type":["number","null"],"format":"double","description":"Bi-weekly price in USD."},"price_monthly":{"type":["number","null"],"format":"double","description":"Monthly price in USD."},"profile_count":{"type":["integer","null"],"format":"int64","description":"Tunnel profiles included."},"slug":{"type":"string","description":"URL-safe slug; UNIQUE at the schema level."},"static_ip_count":{"type":["integer","null"],"format":"int64","description":"Static IPs included."},"stripe_price_id_annual":{"type":["string","null"],"description":"Stripe price id (annual)."},"stripe_price_id_biweekly":{"type":["string","null"],"description":"Stripe price id (bi-weekly)."},"stripe_price_id_monthly":{"type":["string","null"],"description":"Stripe price id (monthly)."},"stripe_product_id":{"type":["string","null"],"description":"Stripe product id bound to this plan."},"traffic_limit":{"type":["integer","null"],"format":"int64","description":"Monthly traffic cap in bytes; NULL = unlimited."},"tunnel_addon_price_monthly":{"type":["number","null"],"format":"double","description":"Per-tunnel monthly addon price; NULL when SKU disabled."},"visible":{"type":["boolean","null"],"description":"Whether the plan is publicly listed."}},"additionalProperties":false},"PlatformPlanDeleteResponse":{"type":"object","description":"Wire body for `DELETE /platform/plans/{id}` — echoes the id so\nthe audit caller can attach it to the audit row without a\nre-parse.","required":["ok","id"],"properties":{"id":{"type":"string","description":"The deleted plan id (echoed for client + audit convenience)."},"ok":{"type":"boolean","description":"`true` on the success path."}}},"PlatformPlanListResponse":{"type":"object","description":"Response envelope for `GET /platform/plans`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPlanRead"},"description":"Every plan in the catalog ordered `display_order ASC, id ASC`\n— including `active = false` / `visible = false` rows."}}},"PlatformPlanRead":{"type":"object","description":"Admin-tier plan row. Mirrors every `plans` table column to the\nwire — the public `PlanRead` is the subset; this is the superset.","required":["id","name","slug","plan_type","price_monthly","price_biweekly","price_annual","profile_count","static_ip_count","has_public_ip","allow_tunnel_addons","allow_ip_addons","allow_port_forward","free_trial_eligible","active","visible","display_order","created_at","updated_at"],"properties":{"active":{"type":"boolean","description":"Master on/off — drafts have `active = false`."},"addon_stripe_prices":{"$ref":"#/components/schemas/AddonStripePrices","description":"Stripe prices of the plan's add-ons, one per kind and cycle."},"allow_ip_addons":{"type":"boolean","description":"Static-IP-addon SKU enabled."},"allow_port_forward":{"type":"boolean","description":"Port-forward subset SKU gate."},"allow_tunnel_addons":{"type":"boolean","description":"Tunnel-addon SKU enabled."},"created_at":{"type":"string","description":"RFC3339 server-side insert timestamp."},"description":{"type":["string","null"],"description":"Marketing description (optional)."},"display_order":{"type":"integer","format":"int64","description":"Sort order in the catalog (ascending)."},"free_trial_eligible":{"type":"boolean","description":"Free-trial eligibility flag."},"has_public_ip":{"type":"boolean","description":"Deprecated `has_public_ip` column kept for legacy migration —\nexposed for staff audit only."},"id":{"type":"string","description":"UUIDv7 primary key."},"ip_addon_price_monthly":{"type":["number","null"],"format":"double","description":"Per-IP monthly addon price; NULL when SKU disabled."},"name":{"type":"string","description":"Human-readable plan name."},"plan_type":{"type":"string","description":"Plan category — the schema column is `type`."},"price_annual":{"type":"number","format":"double","description":"Annual price in USD."},"price_biweekly":{"type":"number","format":"double","description":"Bi-weekly price in USD."},"price_monthly":{"type":"number","format":"double","description":"Monthly price in USD."},"profile_count":{"type":"integer","format":"int64","description":"Tunnel profiles included."},"slug":{"type":"string","description":"URL-safe slug."},"static_ip_count":{"type":"integer","format":"int64","description":"Static IPs included."},"stripe_price_id_annual":{"type":["string","null"],"description":"Stripe price id (annual cadence); NULL on drafts."},"stripe_price_id_biweekly":{"type":["string","null"],"description":"Stripe price id (bi-weekly cadence); NULL on drafts."},"stripe_price_id_monthly":{"type":["string","null"],"description":"Stripe price id (monthly cadence); NULL on drafts."},"stripe_product_id":{"type":["string","null"],"description":"Stripe product id bound to this plan; NULL on drafts."},"subscriptions_in_use":{"type":"integer","format":"int64","description":"Subscriptions on the plan that are not cancelled or expired. A plan\nin use cannot be deleted; hide or deactivate it instead."},"traffic_limit":{"type":["integer","null"],"format":"int64","description":"Monthly traffic cap in bytes; NULL = unlimited."},"tunnel_addon_price_monthly":{"type":["number","null"],"format":"double","description":"Per-tunnel monthly addon price; NULL when SKU disabled."},"updated_at":{"type":"string","description":"RFC3339 server-side last-update timestamp."},"visible":{"type":"boolean","description":"Catalog visibility — hidden plans have `visible = false` but\nremain bindable for legacy subscriptions."}}},"PlatformPlanServerCreateRequest":{"type":"object","description":"Request body for `POST /platform/plan-servers`.","required":["plan_id","server_id"],"properties":{"active":{"type":["boolean","null"],"description":"Whether the link starts active. Defaults to `true`."},"max_users":{"type":["integer","null"],"format":"int64","description":"Per-plan-server max-user override."},"plan_id":{"type":"string","format":"uuid","description":"Plan id to link."},"priority":{"type":["integer","null"],"format":"int64","description":"Sort order inside the plan's server list; lower wins.\nDefaults to `0` when absent."},"profile_count":{"type":["integer","null"],"format":"int64","description":"Per-plan-server profile-count override."},"server_id":{"type":"string","format":"uuid","description":"Server id to link."}},"additionalProperties":false},"PlatformPlanServerDeleteResponse":{"type":"object","description":"Response body for `DELETE /platform/plan-servers/{id}`.","required":["ok","id"],"properties":{"id":{"type":"string","description":"Echo of the deleted row's id."},"ok":{"type":"boolean","description":"Always `true` on a successful delete."}}},"PlatformPlanServerJoinRow":{"type":"object","description":"Bare `plan_servers` join row — the canonical CRUD shape.\n`created_at` is RFC3339.","required":["id","plan_id","server_id","priority","active","created_at"],"properties":{"active":{"type":"boolean","description":"Whether this association is currently active (`plans` may\nkeep inactive links for audit / future re-activation)."},"created_at":{"type":"string","description":"RFC3339 timestamp."},"id":{"type":"string","description":"`plan_servers.id` — UUIDv7."},"max_users":{"type":["integer","null"],"format":"int64","description":"Optional override for the per-plan-server max-user cap;\nNULL ⇒ inherit `servers.max_users`."},"plan_id":{"type":"string","description":"The plan this link belongs to."},"priority":{"type":"integer","format":"int64","description":"Lower priority sorts first inside the / admin lists."},"profile_count":{"type":["integer","null"],"format":"int64","description":"Optional override for the per-plan-server profile-count cap;\nNULL ⇒ inherit the plan's base `profile_count`."},"server_id":{"type":"string","description":"The server this link points at."}}},"PlatformPlanServerListResponse":{"type":"object","description":"Response envelope for `GET /platform/plans/{id}/servers`.","required":["servers"],"properties":{"servers":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPlanServerRead"},"description":"Every plan↔server association for the requested plan id,\nordered `priority ASC, server_id ASC`. Includes inactive\n(`plan_servers.active = 0`) join rows the public catalog\nmasks."}}},"PlatformPlanServerRead":{"type":"object","description":"Admin-tier plan↔server row. Superset of the `PlanServerRead`.\nEncrypted `private_key_ct` is excluded by projection.","required":["plan_server_id","id","name","location","endpoint","public_key","server_type","status","allow_static_ips","priority","active","server_max_users","server_current_users"],"properties":{"active":{"type":"boolean","description":"Whether the join row itself is active — admin sees inactive\nassociations the public surface masks."},"allow_static_ips":{"type":"boolean","description":"SKU gate — static IPs bindable on this server."},"available_ips":{"type":["string","null"],"description":"Available internal IP pool string (`\"10.66.66.2/24\"` etc)."},"endpoint":{"type":"string","description":"WireGuard endpoint address `host:port`."},"id":{"type":"string","description":"`servers.id`."},"ipv6_subnet":{"type":["string","null"],"description":"IPv6 subnet allocated to this server."},"location":{"type":"string","description":"City / data-centre location label."},"max_users_override":{"type":["integer","null"],"format":"int64","description":"Per-plan-server max users override; NULL ⇒ use the\n`servers.max_users` ceiling."},"name":{"type":"string","description":"Server display name."},"nat_network":{"type":["string","null"],"description":"NAT network slug used for outbound flows."},"plan_server_id":{"type":"string","description":"`plan_servers.id` — the join row id; useful for admin\npatch/delete endpoints."},"priority":{"type":"integer","format":"int64","description":"Plan-server join priority (ascending)."},"profile_count_override":{"type":["integer","null"],"format":"int64","description":"Per-plan-server profile-count override; NULL ⇒ use the\nplan's base `profile_count`."},"public_key":{"type":"string","description":"Base64-encoded WG public key."},"region":{"type":["string","null"],"description":"Continent / region label."},"server_current_users":{"type":"integer","format":"int64","description":"Server-level current users (infra utilisation)."},"server_max_users":{"type":"integer","format":"int64","description":"Server-level max users (infra capacity)."},"server_type":{"type":"string","description":"Server type slug (e.g. `wireguard`)."},"specs":{"type":["string","null"],"description":"Free-form spec blob (CPU / RAM / NIC) the admin UI renders."},"status":{"type":"string","description":"Operational status — `online` / `offline` / `error` /\n`maintenance`."}}},"PlatformPlanServerUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/plan-servers/{id}`.\nAll fields optional — partial update. `plan_id` / `server_id` are\nnot patchable here (link identity is immutable; delete + recreate\nto repoint a link).","properties":{"active":{"type":["boolean","null"],"description":"New active flag."},"max_users":{"type":["integer","null"],"format":"int64","description":"New per-plan-server max-user override. `Some(None)` clears the\noverride; absent field ⇒ no change. (Serde rule:\n`#[serde(default, with = \"serde_with::rust::double_option\")]`\nwould be needed for true triple-state; v1 accepts the simpler\nrule: present integer sets, absent leaves alone.)"},"priority":{"type":["integer","null"],"format":"int64","description":"New priority. NULL field ⇒ no change."},"profile_count":{"type":["integer","null"],"format":"int64","description":"New per-plan-server profile-count override. Same rule as\n`max_users` above."}},"additionalProperties":false},"PlatformPlanUpdateRequest":{"type":"object","description":"`PATCH /platform/plans/{id}` request body. Every field optional;\nomitted fields leave the column unchanged. Empty string clears\n`description` to NULL (mirrors `PATCH /auth/me`).","properties":{"active":{"type":["boolean","null"],"description":"New `active` flag."},"allow_ip_addons":{"type":["boolean","null"],"description":"New static-IP-addon SKU flag."},"allow_port_forward":{"type":["boolean","null"],"description":"New port-forward SKU gate."},"allow_tunnel_addons":{"type":["boolean","null"],"description":"New tunnel-addon SKU flag."},"description":{"type":["string","null"],"description":"New description; `\"\"` clears to NULL."},"display_order":{"type":["integer","null"],"format":"int64","description":"New display order."},"free_trial_eligible":{"type":["boolean","null"],"description":"New free-trial flag."},"ip_addon_price_monthly":{"type":["number","null"],"format":"double","description":"New per-IP addon price."},"name":{"type":["string","null"],"description":"New display name."},"plan_type":{"type":["string","null"],"description":"New plan category."},"price_annual":{"type":["number","null"],"format":"double","description":"New annual price."},"price_biweekly":{"type":["number","null"],"format":"double","description":"New bi-weekly price."},"price_monthly":{"type":["number","null"],"format":"double","description":"New monthly price."},"profile_count":{"type":["integer","null"],"format":"int64","description":"New tunnel-profile count."},"slug":{"type":["string","null"],"description":"New URL-safe slug. UNIQUE; reject collision with 409."},"static_ip_count":{"type":["integer","null"],"format":"int64","description":"New static-IP count."},"stripe_price_id_annual":{"type":["string","null"],"description":"New Stripe price id (annual); `\"\"` clears."},"stripe_price_id_biweekly":{"type":["string","null"],"description":"New Stripe price id (bi-weekly); `\"\"` clears."},"stripe_price_id_monthly":{"type":["string","null"],"description":"New Stripe price id (monthly); `\"\"` clears."},"stripe_product_id":{"type":["string","null"],"description":"New Stripe product id; `\"\"` clears to NULL."},"traffic_limit":{"type":["integer","null"],"format":"int64","description":"New traffic cap in bytes."},"tunnel_addon_price_monthly":{"type":["number","null"],"format":"double","description":"New per-tunnel addon price."},"visible":{"type":["boolean","null"],"description":"New `visible` flag."}},"additionalProperties":false},"PlatformPopCreateRequest":{"type":"object","description":"Request body for `POST /platform/pops`. The `points_of_presence`\ntable has no credential columns, so every field is a plain\noperator-supplied value. The schema `CHECK (ipv6_only = 0 OR\nipv6_enabled = 1)` is mirrored handler-side for a clean 422.","required":["slug"],"properties":{"anycast_v4_prefix":{"type":["string","null"],"description":"IPv4 anycast prefix advertised from this PoP. `None` ⇒ `NULL`."},"anycast_v6_prefix":{"type":["string","null"],"description":"IPv6 anycast prefix advertised from this PoP. `None` ⇒ `NULL`."},"asn":{"type":["integer","null"],"format":"int64","description":"Public ASN that announces this PoP's anycast prefixes. `None` ⇒\n`NULL`."},"country_code":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code (e.g. `\"FR\"`). `None` ⇒ `NULL`."},"ipv6_enabled":{"type":"boolean","description":"Whether IPv6 listeners are wired up. Absent ⇒ `false`."},"ipv6_only":{"type":"boolean","description":"Whether this PoP is IPv6-only. Absent ⇒ `false`. Requires\n`ipv6_enabled` (the schema CHECK, mirrored handler-side)."},"location":{"type":["string","null"],"description":"City / data-centre location label. `None` ⇒ column `NULL`."},"peering_profile":{"type":["string","null"],"description":"Peering-profile JSON object string. Absent ⇒ `{}`.\nHandler-validated as a parseable JSON object."},"slug":{"type":"string","description":"URL-safe slug, UNIQUE on the row. Non-empty, `<= 64`, and\n(handler-checked) lowercase alphanumeric with single internal\nhyphens."},"status":{"type":["string","null"],"description":"Initial status — `active` / `draining` / `disabled`. Absent ⇒\n`disabled` (a new PoP stays disabled until the operator brings\nit online). Handler-validated against the CHECK."}}},"PlatformPopDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/pops/{id}` — a bare success\nacknowledgement (the row is gone; nothing else to project).","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on a 200 — the PoP row was hard-deleted."}}},"PlatformPopListResponse":{"type":"object","description":"Response envelope for `GET /platform/pops`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPopRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformPopRead":{"type":"object","description":"Staff-tier PoP row.","required":["id","slug","ipv6_enabled","ipv6_only","peering_profile","status","created_at","updated_at"],"properties":{"anycast_v4_prefix":{"type":["string","null"],"description":"IPv4 anycast prefix advertised from this PoP."},"anycast_v6_prefix":{"type":["string","null"],"description":"IPv6 anycast prefix advertised from this PoP."},"asn":{"type":["integer","null"],"format":"int64","description":"Public ASN that announces this PoP's anycast prefixes."},"country_code":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code (e.g. `\"FR\"`)."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"id":{"type":"string","description":"`points_of_presence.id` (UUIDv7)."},"ipv6_enabled":{"type":"boolean","description":"Whether IPv6 listeners are wired up at this PoP."},"ipv6_only":{"type":"boolean","description":"Whether this PoP is IPv6-only (ipv6_enabled is implied\nby the schema CHECK constraint)."},"location":{"type":["string","null"],"description":"City / data-centre location label."},"peering_profile":{"type":"string","description":"Peering-profile JSON (free-form operator metadata)."},"slug":{"type":"string","description":"URL-safe slug, UNIQUE on the row."},"status":{"type":"string","description":"`active` / `draining` / `disabled`."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"PlatformPopUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/pops/{id}`. Partial update: every\nfield is `Option<T>`, omit ⇒ column unchanged. Nullable text columns\n(`location` / `country_code` / `anycast_v4_prefix` /\n`anycast_v6_prefix`) follow the empty-string-clears convention\n(`Some(\"\")` ⇒ `NULL`). `asn` is a double-option: JSON `null` ⇒\n`NULL`, a number ⇒ set, omitted ⇒ unchanged.","properties":{"anycast_v4_prefix":{"type":["string","null"],"description":"New IPv4 anycast prefix. Omit ⇒ unchanged; empty string ⇒\nclears to `NULL`."},"anycast_v6_prefix":{"type":["string","null"],"description":"New IPv6 anycast prefix. Omit ⇒ unchanged; empty string ⇒\nclears to `NULL`."},"asn":{"type":["integer","null"],"format":"int64","description":"New ASN. Omit ⇒ unchanged; JSON `null` ⇒ clears to `NULL`; a\nnumber (handler-checked `>= 0`) ⇒ set. The `double_option`\nadapter distinguishes absent (outer `None`) from explicit null\n(`Some(None)`)."},"country_code":{"type":["string","null"],"description":"New country code. Omit ⇒ unchanged; empty string ⇒ clears to\n`NULL`; otherwise handler-checked as exactly 2 chars."},"ipv6_enabled":{"type":["boolean","null"],"description":"New IPv6-enabled flag. Omit ⇒ unchanged."},"ipv6_only":{"type":["boolean","null"],"description":"New IPv6-only flag. Omit ⇒ unchanged. The resulting\n`(ipv6_only, ipv6_enabled)` pair is re-checked against the\nschema CHECK."},"location":{"type":["string","null"],"description":"New location. Omit ⇒ unchanged; empty string ⇒ clears to `NULL`."},"peering_profile":{"type":["string","null"],"description":"New peering-profile JSON object string. Omit ⇒ unchanged.\nHandler-validated as a parseable JSON object."},"slug":{"type":["string","null"],"description":"New slug. Omit ⇒ unchanged. `<= 64`, handler-re-validated for\nthe lowercase-hyphen grammar + uniqueness."},"status":{"type":["string","null"],"description":"New status — `active` / `draining` / `disabled`. Omit ⇒\nunchanged. Handler-validated against the CHECK."}}},"PlatformPublicIpAssignRequest":{"type":"object","description":"Body for `POST /platform/public-ips/{id}/assign` — staff-tier\nreservation of an `available` IP for an org without going through\nthe customer claim flow (billing-recovery / white-glove path).","required":["org_id"],"properties":{"org_id":{"type":"string","description":"FK to `orgs.id` — the org receiving the reservation. Unknown\norg → 422 `org_not_found`."},"subscription_id":{"type":["string","null"],"description":"Optional FK to `subscriptions.id` to attach billing linkage at\nassign time. Unknown subscription → 422 `subscription_not_found`."}}},"PlatformPublicIpCreateRequest":{"type":"object","description":"Body for `POST /platform/public-ips`. The new row starts unowned:\n`status` may be `available` (in the public pool, default) or\n`management` (infrastructure-held, never customer-claimable).\nOwned states (`reserved` / `in_use`) are reached via assign / bind,\nnever minted directly.","required":["pool_id","ip_address"],"properties":{"claim_scope":{"type":["string","null"],"description":"Initial eligibility section (`public_ips.claim_scope`): `customer`,\n`infra`, or `any` (default — claimable by either path). Anything\nelse → 422 `claim_scope_invalid`. This is how an operator carves\nout the customer-only / infra-only sections of the pool."},"ip_address":{"type":"string","description":"Dotted-quad / colon-hex address. UNIQUE across all pools —\ncollision → 409 `ip_exists`."},"pool_id":{"type":"string","description":"FK to `ip_pools.id` — the pool the address is carved from.\nUnknown pool → 422 `pool_not_found`."},"status":{"type":["string","null"],"description":"Initial status: `available` (default) or `management`.\nAnything else → 422 `status_invalid`."}}},"PlatformPublicIpDeleteResponse":{"type":"object","description":"Response for `DELETE /platform/public-ips/{id}`.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"Always `true` on a 200 — the row is gone."},"id":{"type":"string","description":"The deleted row's id, echoed back."}}},"PlatformPublicIpListResponse":{"type":"object","description":"Response envelope for `GET /platform/public-ips`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPublicIpRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformPublicIpRead":{"type":"object","description":"Staff-tier public-IP row. Mirrors the `public_ips` schema.","required":["id","pool_id","ip_address","status","claim_scope","created_at","updated_at"],"properties":{"claim_scope":{"type":"string","description":"Eligibility section (`public_ips.claim_scope`): `customer` (only\ncustomers may claim it), `infra` (only the infra host-route path\nmay claim it), or `any` (either). Orthogonal to `status` — the\nownership arbiter — per the constitution's two-axis IP model."},"cooldown_until":{"type":["string","null"],"description":"RFC3339 end of the rest after a customer released it. Until then it\nis not handed to anyone (staff can end it early)."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"id":{"type":"string","description":"UUIDv7 primary key."},"ip_address":{"type":"string","description":"Dotted-quad / colon-hex IP address."},"last_bound_at":{"type":["string","null"],"description":"RFC3339 of the most recent binding, if any."},"org_id":{"type":["string","null"],"description":"FK to `orgs.id`. NULL when status = `available` or `management`."},"pool_id":{"type":"string","description":"FK to `ip_pools.id`."},"reserved_at":{"type":["string","null"],"description":"RFC3339 of reservation, if any."},"status":{"type":"string","description":"`available` / `reserved` / `in_use` / `management` / `removed`."},"subscription_id":{"type":["string","null"],"description":"FK to `subscriptions.id`. NULL when not currently subscribed."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"PlatformPublicIpRouteRequest":{"type":"object","description":"Body for `POST /platform/public-ips/{id}/route`.","required":["tunnel_id"],"properties":{"priority":{"type":["integer","null"],"format":"int64","description":"Forwarding priority (higher first). Default 100."},"rule_type":{"type":["string","null"],"description":"`dnat` / `snat` / `both` (default `both`)."},"tunnel_id":{"type":"string","description":"The tunnel to route this IP into. Must be active and owned by\nthe same org as the IP."}}},"PlatformPublicIpSetScopeRequest":{"type":"object","description":"Body for `PATCH /platform/public-ips/{id}/scope` — staff-tier flip of\nan existing IP's eligibility section without touching ownership\n(`status`). The two axes are orthogonal, so this never moves an IP in\nor out of a customer's hands; it only changes who may claim it next.","required":["claim_scope"],"properties":{"claim_scope":{"type":"string","description":"New eligibility section: `customer`, `infra`, or `any`. Anything\nelse → 422 `claim_scope_invalid`."}}},"PlatformRoutingServerListResponse":{"type":"object","description":"Response envelope for `GET /platform/routing-servers`.","required":["routing_servers"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."},"routing_servers":{"type":"array","items":{"$ref":"#/components/schemas/PlatformRoutingServerRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."}}},"PlatformRoutingServerRead":{"type":"object","description":"Staff-tier routing-server row. Subset of the schema that excludes\n`agent_key_hash` (hashes are never echoed back).","required":["id","name","status","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 of row creation."},"id":{"type":"string","description":"`routing_servers.id` (UUIDv7)."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 of the last heartbeat we received from this agent."},"location":{"type":["string","null"],"description":"City / data-centre location label."},"name":{"type":"string","description":"Operator-supplied display name."},"public_endpoint":{"type":["string","null"],"description":"Public endpoint the agent reaches us at."},"status":{"type":"string","description":"`active` / `inactive` / `draining`."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"PlatformServerCreateRequest":{"type":"object","description":"`POST /platform/servers` request body.","required":["name","location","endpoint","public_key","private_key","server_type"],"properties":{"allow_static_ips":{"type":["boolean","null"],"description":"SKU gate."},"available_ips":{"type":["string","null"],"description":"Internal IP pool string."},"endpoint":{"type":"string","description":"WireGuard endpoint `host:port`."},"ipv6_subnet":{"type":["string","null"],"description":"IPv6 subnet."},"location":{"type":"string","description":"City / data-centre label."},"max_users":{"type":["integer","null"],"format":"int64","description":"Max users (infra capacity)."},"name":{"type":"string","description":"Display name."},"nat_network":{"type":["string","null"],"description":"NAT network slug."},"private_key":{"type":"string","description":"Plaintext WG private key (base64-encoded). The handler seals\nthis with `settings_enc_key` and writes only the AEAD\nciphertext — the plaintext never round-trips and never\ntouches disk in clear."},"public_key":{"type":"string","description":"Base64-encoded WG public key."},"region":{"type":["string","null"],"description":"Continent / region label."},"server_type":{"type":"string","description":"Server type slug (`wireguard`, etc)."},"specs":{"type":["string","null"],"description":"Free-form spec blob."},"status":{"type":["string","null"],"description":"Initial operational status; defaults to `offline`."}},"additionalProperties":false},"PlatformServerDeleteResponse":{"type":"object","description":"Wire body for `DELETE /platform/servers/{id}` — echoes the id so\nthe audit caller can attach it without re-parsing the path.","required":["ok","id"],"properties":{"id":{"type":"string","description":"Deleted server id (echoed for client + audit convenience)."},"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"PlatformServerListResponse":{"type":"object","description":"Response envelope for `GET /platform/servers`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformServerRead"},"description":"Every server ordered `created_at ASC, id ASC`. Small fleet\n— no cursor pagination."}}},"PlatformServerRead":{"type":"object","description":"Admin-tier server row. Mirrors every column of the `servers`\ntable except the AEAD-encrypted `private_key_ct`.","required":["id","name","location","endpoint","public_key","server_type","max_users","current_users","status","allow_static_ips","protocol","created_at","updated_at"],"properties":{"allow_static_ips":{"type":"boolean","description":"SKU gate — static IPs bindable on this server."},"available_ips":{"type":["string","null"],"description":"Available internal IP pool (`\"10.66.66.2/24\"` etc)."},"created_at":{"type":"string","description":"RFC3339 insert timestamp."},"current_users":{"type":"integer","format":"int64","description":"Current users (infra-side utilisation)."},"endpoint":{"type":"string","description":"WireGuard endpoint `host:port`."},"id":{"type":"string","description":"UUIDv7 primary key."},"ipv6_subnet":{"type":["string","null"],"description":"IPv6 subnet allocated."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 of the last heartbeat received (NULL until the agent's\nfirst beat lands). Drives the operator dashboard's\nonline/offline indicator."},"location":{"type":"string","description":"City / data-centre label."},"max_users":{"type":"integer","format":"int64","description":"Max users (infra-side capacity)."},"name":{"type":"string","description":"Display name."},"nat_network":{"type":["string","null"],"description":"NAT network slug used for outbound flows."},"pop_id":{"type":["string","null"],"description":"Point-of-presence this server is racked in (FK to\n`points_of_presence.id`; `None` on a pre-0018 row that hasn't\nbeen backfilled). Cross-reference with `GET /platform/pops`\nfor the PoP's location/status (support console)."},"protocol":{"type":"string","description":"Data-plane protocol this server terminates — `wireguard` or\n`quic`."},"public_key":{"type":"string","description":"Base64-encoded WG public key."},"quic_mode":{"type":["string","null"],"description":"QUIC listener mode when `protocol = \"quic\"` — `kernel` or\n`userspace`; `None` for a WireGuard server."},"region":{"type":["string","null"],"description":"Continent / region label (optional)."},"reported_version":{"type":["string","null"],"description":"The `appsynergy-agent` build version the server last reported\n(NULL until the first heartbeat)."},"server_type":{"type":"string","description":"Server type slug (e.g. `wireguard`)."},"specs":{"type":["string","null"],"description":"Free-form spec blob."},"status":{"type":"string","description":"Operational status — `online` / `offline` / `error` /\n`maintenance`."},"updated_at":{"type":"string","description":"RFC3339 last-update timestamp."}}},"PlatformServerUpdateRequest":{"type":"object","description":"`PATCH /platform/servers/{id}` request body. All fields optional.\nEmpty string clears `region` / `available_ips` / `ipv6_subnet` /\n`nat_network` / `specs` to NULL.\n\n`private_key` / `public_key` are NOT patchable here; key\nrotation is a separate operator action.","properties":{"allow_static_ips":{"type":["boolean","null"],"description":"New SKU gate flag."},"available_ips":{"type":["string","null"],"description":"New internal IP pool string; `\"\"` clears to NULL."},"endpoint":{"type":["string","null"],"description":"New WireGuard endpoint."},"ipv6_subnet":{"type":["string","null"],"description":"New IPv6 subnet; `\"\"` clears to NULL."},"location":{"type":["string","null"],"description":"New location label."},"max_users":{"type":["integer","null"],"format":"int64","description":"New max users."},"name":{"type":["string","null"],"description":"New display name."},"nat_network":{"type":["string","null"],"description":"New NAT network slug; `\"\"` clears to NULL."},"pop_id":{"type":["string","null"],"description":"Re-home the server to this `points_of_presence.id`;\n`\"\"` clears to NULL (un-homed). Validated against an existing\nPoP row — an unknown id is 422. Display-only downstream: the\nagent-facing QUIC config emits the PoP's slug but excludes it\nfrom the config ETag, so a re-home never restarts live\nlisteners."},"region":{"type":["string","null"],"description":"New region label; `\"\"` clears to NULL."},"server_type":{"type":["string","null"],"description":"New server type slug."},"specs":{"type":["string","null"],"description":"New spec blob; `\"\"` clears to NULL."},"status":{"type":["string","null"],"description":"New operational status. Validated against the schema CHECK\n(`online` / `offline` / `error` / `maintenance`) at insert\ntime; an unknown slug surfaces as an sqlx CHECK violation\ntranslated to 422."}},"additionalProperties":false},"PlatformStripePaymentListResponse":{"type":"object","description":"Response envelope for `GET /platform/stripe/payments`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformStripePaymentRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformStripePaymentRead":{"type":"object","description":"Staff-tier Stripe payment row. Mirrors the `stripe_checkout_sessions`\nschema.","required":["id","amount","currency","status","created_at"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount in cents."},"cancel_reason":{"type":["string","null"],"description":"Free-form reason for customer cancellation."},"checkout_url":{"type":["string","null"],"description":"Hosted Stripe checkout URL, if any."},"created_at":{"type":"string","description":"RFC3339 row creation."},"currency":{"type":"string","description":"ISO 4217 currency code."},"email":{"type":["string","null"],"description":"Customer email captured at checkout."},"failure_reason":{"type":["string","null"],"description":"Free-form reason for Stripe-side failure."},"id":{"type":"string","description":"Stripe session id (also our PK)."},"org_id":{"type":["string","null"],"description":"FK to `orgs.id`. Set to NULL after the org is deleted."},"plan_id":{"type":["string","null"],"description":"FK to `plans.id`. Set to NULL after the plan is deleted."},"plan_name":{"type":["string","null"],"description":"Snapshotted plan name at checkout."},"status":{"type":"string","description":"`open` / `paid` / `cancelled` / `expired` / `failed`."},"updated_at":{"type":["string","null"],"description":"RFC3339 last write."},"user_id":{"type":["string","null"],"description":"FK to `users.id`. Set to NULL after the user is deleted."}}},"PlatformSubnetRouteListResponse":{"type":"object","description":"Wire response for `GET /platform/devices/subnet-routes`. One-array\nenvelope + opaque `next_cursor` matching every other staff-tier list.","required":["routes"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page; `null` when\nthe current page is the last."},"routes":{"type":"array","items":{"$ref":"#/components/schemas/PlatformSubnetRouteRead"},"description":"Routes ordered `(advertised_at DESC, id DESC)` — newest first."}}},"PlatformSubnetRouteRead":{"type":"object","description":"One row of the staff-tier cross-org subnet-route list\n(`GET /platform/devices/subnet-routes`). Carries the advertising\ndevice + owning org alongside the route so staff can triage the\napproval queue without a second lookup.","required":["id","cidr","advertised_at","device_id","device_name","org_id"],"properties":{"advertised_at":{"type":"string","description":"RFC3339 timestamp the customer advertised the route."},"approved_at":{"type":["string","null"],"description":"RFC3339 approval timestamp; NULL while pending."},"approved_by_user_id":{"type":["string","null"],"description":"User id of the staff member who approved; NULL while pending."},"cidr":{"type":"string","description":"IPv4 or IPv6 CIDR the device offers to route."},"device_id":{"type":"string","description":"`client_devices.id` of the advertising gateway device."},"device_name":{"type":"string","description":"Human label of the advertising device."},"id":{"type":"string","description":"`device_subnet_routes.id` (UUIDv7)."},"org_id":{"type":"string","description":"`orgs.id` that owns the device."}}},"PlatformSubscriptionBandwidthLimitRequest":{"type":"object","description":"Request body for `PATCH /platform/subscriptions/{id}/bandwidth-limit`.","properties":{"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"New monthly cap in bytes for the current quota period.\n`null` clears the cap (unlimited). Must be ≥ 0 when set."}},"additionalProperties":false},"PlatformSubscriptionBandwidthLimitResponse":{"type":"object","description":"Response body for the bandwidth-limit endpoint.","required":["subscription_id","updated_at"],"properties":{"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"New cap value, or `null` if unlimited."},"subscription_id":{"type":"string","description":"Subscription id this cap belongs to."},"updated_at":{"type":"string","description":"RFC3339 timestamp the row was last touched."}}},"PlatformSubscriptionDeleteResponse":{"type":"object","description":"Response body for `DELETE /platform/subscriptions/{id}`.","required":["ok","id"],"properties":{"id":{"type":"string","description":"Echo of the deleted row's id."},"ok":{"type":"boolean","description":"Always `true` on a successful delete."}}},"PlatformSubscriptionGrantRequest":{"type":"object","description":"Request body for `POST /platform/subscriptions`.","required":["org_id","plan_id","billing_cycle"],"properties":{"billing_cycle":{"type":"string","description":"One of `monthly` / `biweekly` / `annual`."},"org_id":{"type":"string","format":"uuid","description":"UUIDv7 of the org to grant the subscription to."},"period_days":{"type":["integer","null"],"format":"int64","description":"Days until `current_period_end`. Omit for a **perpetual** comp\n(no period end — never expires). When given, max 3650."},"plan_id":{"type":"string","format":"uuid","description":"UUIDv7 of the plan to grant."}}},"PlatformSubscriptionListResponse":{"type":"object","description":"Response envelope for `GET /platform/subscriptions`.","required":["subscriptions"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/PlatformSubscriptionRead"},"description":"Page contents — newest first, capped at the request's\n`limit` (default 50, max 200)."}}},"PlatformSubscriptionRead":{"type":"object","description":"Staff-tier subscription row.","required":["id","org_id","plan_id","billing_cycle","status","started_at","cancel_at_period_end","created_at","updated_at"],"properties":{"billing_cycle":{"type":"string","description":"`monthly` / `biweekly` / `annual`."},"cancel_at_period_end":{"type":"boolean","description":"`true` ⇒ the subscription enters `cancelled` at\n`current_period_end` rather than auto-renewing."},"cancelled_at":{"type":["string","null"],"description":"RFC3339 of cancellation (when `status = cancelled`)."},"created_at":{"type":"string","description":"RFC3339 of row creation."},"crypto_tx_hash":{"type":["string","null"],"description":"Crypto transaction hash for the last verified payment."},"current_period_end":{"type":["string","null"],"description":"RFC3339 of the current period boundary."},"grace_until":{"type":["string","null"],"description":"RFC3339 of grace-period expiry (when `status = grace`)."},"id":{"type":"string","description":"`subscriptions.id` (UUIDv7)."},"org_id":{"type":"string","description":"Owning org."},"org_name":{"type":["string","null"],"description":"Owning org's display name (`orgs.name`). Populated by the list\nendpoint (`GET /platform/subscriptions`), which JOINs `orgs`;\nNULL on the single-subscription endpoints (get / grant /\nreassign / cancel) and when the org row is missing (dangling\n`org_id`)."},"owner_email":{"type":["string","null"],"description":"Email of the org's `org_admin` (the owner) — for a personal org,\nthe account holder. Populated by the list endpoint; NULL on the\nsingle-subscription endpoints, when the org has no `org_admin`\nmember, or the user row is missing."},"payment_method":{"type":["string","null"],"description":"`stripe` / `crypto` / NULL (legacy free tier)."},"plan_id":{"type":"string","description":"Selected plan."},"started_at":{"type":"string","description":"RFC3339 of when the subscription first activated."},"status":{"type":"string","description":"`active` / `cancelled` / `expired` / `grace`."},"stripe_customer_id":{"type":["string","null"],"description":"Stripe customer id (`cus_…`)."},"stripe_invoice_id":{"type":["string","null"],"description":"Stripe invoice id (`in_…`) for the most recent settled invoice."},"stripe_subscription_id":{"type":["string","null"],"description":"Stripe subscription id (`sub_…`)."},"updated_at":{"type":"string","description":"RFC3339 of last write."}}},"PlatformSubscriptionReassignRequest":{"type":"object","description":"Request body for `POST /platform/subscriptions/{id}/reassign`.","required":["plan_id"],"properties":{"plan_id":{"type":"string","format":"uuid","description":"New plan id. Must reference an existing `plans.id`."}},"additionalProperties":false},"PlatformTopologyMapResponse":{"type":"object","description":"Response envelope for `GET /platform/topology/map` — one coherent\nsnapshot of every node and edge the live map renders.","required":["generated_at","servers","agents","orgs","tunnels","devices"],"properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/TopologyMapAgent"},"description":"Every fleet agent row (all statuses — the map shows paused /\nretired agents dimmed rather than hiding system state)."},"devices":{"type":"array","items":{"$ref":"#/components/schemas/TopologyMapDevice"},"description":"Device nodes (capped; see handler doc)."},"generated_at":{"type":"string","description":"RFC3339 server-clock stamp for this snapshot; the client's\nrate math divides counter deltas by the elapsed time between\nconsecutive `generated_at` values."},"orgs":{"type":"array","items":{"$ref":"#/components/schemas/TopologyMapOrg"},"description":"Every org that owns a subscription, tunnel, or device, with\ncurrent-period usage."},"servers":{"type":"array","items":{"$ref":"#/components/schemas/TopologyMapServer"},"description":"Every infra server row."},"tunnels":{"type":"array","items":{"$ref":"#/components/schemas/TopologyMapTunnel"},"description":"Tunnel edges (capped; see handler doc)."}}},"PlatformTunnelCreateRequest":{"type":"object","description":"Body for `POST /platform/vpn/tunnels`.","required":["subscription_id"],"properties":{"profile_name":{"type":["string","null"],"description":"Optional display name stamped onto the WG profile."},"server_id":{"type":["string","null"],"description":"Optional explicit server; must be `online` (400\n`server_not_available`). Omitted → lowest-occupancy online\nserver (503 `no_server_available` when the fleet is empty)."},"subscription_id":{"type":"string","description":"The subscription (any org) receiving the tunnel. Unknown id →\n422 `subscription_not_found`."}}},"PlatformTunnelListResponse":{"type":"object","description":"Response envelope for `GET /platform/vpn/tunnels`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformTunnelRead"},"description":"Page contents — newest first, capped at the request's `limit`\n(default 50, max 200)."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page, or `null`\nwhen no more rows remain."}}},"PlatformTunnelRead":{"type":"object","description":"Staff-tier tunnel row. Schema mirror of `tunnels` left-joined to\n`wireguard_tunnels`. `private_key_ct` is excluded.","required":["id","org_id","subscription_id","tunnel_type","profile_number","status","created_at","updated_at"],"properties":{"allocated_ip":{"type":["string","null"],"description":"Internal IP allocated to the peer inside the server's pool."},"created_at":{"type":"string","description":"RFC3339 row creation."},"dns_servers":{"type":["string","null"],"description":"Comma-separated DNS server overrides, if any."},"id":{"type":"string","description":"UUIDv7 primary key."},"last_bytes_in":{"type":["integer","null"],"format":"int64","description":"Lifetime bytes received from the peer, as last observed on the\nWG server's kernel counter (observability only — billing uses\nwindowed deltas). NULL until the first peer-status beat."},"last_bytes_out":{"type":["integer","null"],"format":"int64","description":"Lifetime bytes sent to the peer, as last observed on the WG\nserver's kernel counter (observability only). NULL until the\nfirst peer-status beat."},"last_handshake":{"type":["string","null"],"description":"RFC3339 of the most recent handshake, if any."},"org_id":{"type":"string","description":"FK to `orgs.id`."},"org_name":{"type":["string","null"],"description":"Display name of the owning org (`orgs.name`) — the customer\nattribution staff read off this list. NULL only if the org\nrow is gone (FK'd, so effectively never)."},"platform":{"type":["string","null"],"description":"Customer-supplied platform label (`linux` / `windows` / …)."},"profile_name":{"type":["string","null"],"description":"Customer-supplied friendly name for the profile."},"profile_number":{"type":"integer","format":"int64","description":"Per-subscription profile slot (1..n)."},"public_key":{"type":["string","null"],"description":"WireGuard peer public key, base64. NULL when `tunnel_type` is\nnot `wireguard`."},"server_id":{"type":["string","null"],"description":"FK to `servers.id` (NULL when the tunnel hasn't been pinned\nto a server yet)."},"status":{"type":"string","description":"`active` / `inactive` / `pending`."},"subscription_id":{"type":"string","description":"FK to `subscriptions.id`."},"tunnel_type":{"type":"string","description":"Tunnel protocol — `wireguard` / `quic`."},"updated_at":{"type":"string","description":"RFC3339 last write."},"use_case":{"type":["string","null"],"description":"Customer-supplied use-case label."}}},"PlatformUserBulkClearStripeResponse":{"type":"object","description":"`POST /platform/users/clear-stripe` response — bulk-cleared row\ncount. No per-row payload (the bulk endpoint is a recovery\nhammer; per-user reconciliation lives in the per-user endpoint).","required":["cleared_count"],"properties":{"cleared_count":{"type":"integer","format":"int64","description":"Count of `users` rows whose `stripe_customer_id` transitioned\nfrom non-NULL to NULL. Rows that were already NULL are not\ncounted.","minimum":0}}},"PlatformUserClearStripeResponse":{"type":"object","description":"`POST /platform/users/{id}/clear-stripe` response — echoes the\nrow's prior `stripe_customer_id` so the audit caller can preserve\nit for the recovery path.","required":["ok"],"properties":{"cleared_customer_id":{"type":["string","null"],"description":"The Stripe customer id that was cleared. NULL when the column\nwas already NULL on entry (still success — idempotent clear)."},"ok":{"type":"boolean","description":"`true` on success; the row was found and the column cleared."}}},"PlatformUserListResponse":{"type":"object","description":"Wire response for `GET /platform/users`. One-array envelope +\nopaque `next_cursor` matching every other staff-tier list.","required":["users"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque base64url-no-pad cursor for the next page; `null`\nwhen the current page is the last."},"users":{"type":"array","items":{"$ref":"#/components/schemas/PlatformUserRead"},"description":"Users ordered `(created_at DESC, id DESC)` — newest first."}}},"PlatformUserRead":{"type":"object","description":"One row of the staff-tier user list / single-user read.\n\n`is_platform_admin` is derived at read time from\n`org_members.role_name = 'platform_admin'` — the legacy\n`users.is_admin` column was retired in B's IAM migration; platform\nrole membership is the source of truth.","required":["id","email","passkey_enabled","enforce_passkey","is_platform_admin","is_platform_support","created_at","updated_at","verification","live_paid_subscription"],"properties":{"avatar":{"type":["string","null"],"description":"Library avatar key the user picked via `PATCH /auth/me`\n([`crate::platform::auth::avatars::AVATAR_KEYS`]); `None` = initials."},"closed_at":{"type":["string","null"],"description":"RFC3339 instant the account was deleted (closed); it is erased at\n`purge_after` unless restored."},"closed_reason":{"type":["string","null"],"description":"Why it was deleted: `owner_request`, `user_asked`, `abuse`,\n`fraud`, `legal`."},"created_at":{"type":"string","description":"RFC3339 server-side insert timestamp."},"deleted_at":{"type":["string","null"],"description":"RFC3339 soft-delete timestamp; NULL when the account\nis active."},"email":{"type":"string","description":"Login email — case-insensitive UNIQUE in the `users` table. For a\ndeleted account whose unverified address was freed at deletion, the\naddress it signed up with."},"email_verified_at":{"type":["string","null"],"description":"RFC3339 instant the address was first proven by a login link."},"enforce_passkey":{"type":"boolean","description":"`true` when password login is blocked for this account\n(passkey-only enforcement)."},"id":{"type":"string","description":"UUIDv7 id of the user."},"is_platform_admin":{"type":"boolean","description":"`true` when the user holds at least one `platform_admin`\n`org_members` row."},"is_platform_support":{"type":"boolean","description":"`true` when the user holds at least one `platform_support`\n`org_members` row."},"live_paid_subscription":{"type":"boolean","description":"An org this user administers holds a live Stripe-billed\nsubscription. Suspending the account never cancels it."},"name":{"type":["string","null"],"description":"Optional display name."},"passkey_enabled":{"type":"boolean","description":"`true` when the user has at least one registered passkey\ncredential AND has flipped the per-account toggle on."},"purge_after":{"type":["string","null"],"description":"RFC3339 instant a deleted account is erased."},"stripe_customer_id":{"type":["string","null"],"description":"Stripe customer id when the user has a Stripe account\nassociated; NULL when never billed. The `clear-stripe`\nadmin write resets this to NULL."},"suspended_at":{"type":["string","null"],"description":"RFC3339 instant staff suspended the account; NULL when not\nsuspended."},"suspended_reason":{"type":["string","null"],"description":"Staff's reason for the suspension."},"trial_claimed_at":{"type":["string","null"],"description":"RFC3339 timestamp of when the user claimed their one-time\nStripe trial; NULL when never claimed."},"updated_at":{"type":"string","description":"RFC3339 server-side last-update timestamp."},"verification":{"type":"string","description":"`verified`: a login link mailed to the address has been used.\n`unverified`: none has. `sso`: the account was created by its\norganization's identity provider, which vouches for the address."}}},"PlatformUserUpdateRequest":{"type":"object","description":"`PATCH /platform/users/{id}` request body. Every field is optional;\nomitted fields leave the underlying column unchanged. `name =\n\"\"` clears the column to NULL (matches `PATCH /auth/me` behaviour).","properties":{"email":{"type":["string","null"],"description":"New login email — case-insensitive UNIQUE; reject when in use."},"is_platform_admin":{"type":["boolean","null"],"description":"Toggle the user's `platform_admin` membership in the singleton\n`_platform` org. `Some(true)` ⇒ INSERT OR IGNORE;\n`Some(false)` ⇒ DELETE; `None` ⇒ no change."},"is_platform_support":{"type":["boolean","null"],"description":"Toggle the user's `platform_support` membership. Same\nsemantics as `is_platform_admin`."},"name":{"type":["string","null"],"description":"New display name. Empty string clears to NULL."}},"additionalProperties":false},"PolicyConditionListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/policy-conditions`.\nA bare object with a single `conditions` array — keeps the\ndoor open to add envelope-level fields (`total`, `has_more`,\nfuture cursor) without breaking clients that already parse the\narray shape, mirroring `ResourceGrantListResponse` /\n`OrgCustomRoleListResponse` / `OrgMemberListResponse` /\n`ApiTokenListResponse`. Each item reuses\n[`PolicyConditionSummary`] so a future schema addition cannot\ndrift the list shape away from the per-row projection.","required":["conditions"],"properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/PolicyConditionSummary"},"description":"Policy conditions defined within the resolved org, ordered by\n`(created_at DESC, id DESC)` — newest first, with the `id DESC`\ntie-breaker keeping rows ordered when two seeds land in the\nsame RFC3339 second."}}},"PolicyConditionSummary":{"type":"object","description":"Per-row summary projected by `GET /iam/orgs/{org_id}/policy-conditions`\n(the foundation slice). One row per\n`policy_conditions` table entry, scoped to the path-resolved org.\n\n`condition_json` is the per-kind opaque payload, decoded from the\nrow's JSON-encoded `TEXT` column at read time. The per-kind shape\n(CIDR list / time window / mfa-max-age / regex) lives in the\nevaluator slice that consumes the column; the list endpoint\nprojects the payload verbatim and lets the matching create\nhandler validate the shape against the per-kind contract.","required":["id","attached_to_kind","attached_to_id","org_id","condition_kind","condition_json","created_at"],"properties":{"attached_to_id":{"type":"string","description":"UUID of the parent the condition is attached to. Polymorphic\nby design — matches `org_custom_roles.id` OR\n`resource_grants.id` OR `api_tokens.id`; the\n[`PolicyConditionSummary::attached_to_kind`] field is the\ndiscriminator."},"attached_to_kind":{"type":"string","description":"Discriminator for [`PolicyConditionSummary::attached_to_id`].\nOne of `custom_role`, `resource_grant`, `api_token` — the same\nset as the schema-level `CHECK (attached_to_kind IN (...))`\nconstraint."},"condition_json":{"type":"object","description":"Per-kind opaque condition payload, decoded from the row's\n`condition_json` JSON-encoded TEXT column. The list endpoint\nprojects the payload verbatim; the per-kind shape is\ndocumented on the create handler that ships."},"condition_kind":{"type":"string","description":"Bounded condition kind. One of `ip_cidr_allowlist`,\n`time_of_day`, `mfa_required`, `user_agent_match`,\n`device_posture` — the same set as the schema-level\n`CHECK (condition_kind IN (...))` constraint."},"created_at":{"type":"string","description":"RFC3339 timestamp the row was created (matches\n`policy_conditions.created_at`)."},"id":{"type":"string","description":"UUIDv7 identifier of the condition row (matches\n`policy_conditions.id`). Stable across the row's lifetime."},"org_id":{"type":"string","description":"UUIDv7 of the owning org (matches `policy_conditions.org_id`).\nConstant across the row's lifetime — conditions cannot move\nbetween orgs."}}},"PopAnycastStatusResponse":{"type":"object","description":"Response for `GET /platform/pops/{id}/anycast-status`.","required":["pop_id","slug","prefixes","withdraws_in_last_hour"],"properties":{"pop_id":{"type":"string","description":"`points_of_presence.id`."},"prefixes":{"type":"array","items":{"$ref":"#/components/schemas/AnycastPrefixStatus"},"description":"Advertisement status per prefix this PoP advertises\n(`pop_advertised_prefixes`)."},"slug":{"type":"string","description":"The PoP's slug, echoed for display."},"withdraws_in_last_hour":{"type":"integer","format":"int64","description":"Count of manual withdraw commands issued against this PoP's\npeers in the last hour (from the audit trail) — the \"why did\ntraffic move\" signal."}}},"PostureCheckResult":{"type":"object","description":"One evaluated posture check on one device. Only checks the org\npolicy actually requires are present — a policy with\n`require_firewall = false` produces no `firewall` entry for any\ndevice, trivial-compliant on that dimension by construction.","required":["check","status"],"properties":{"check":{"type":"string","description":"One of `disk_encryption`, `screen_lock`, `firewall`,\n`min_os_version`, `min_agent_version` — mirrors the five\n`OrgDevicePolicyRead` requirement fields."},"detail":{"type":["string","null"],"description":"Human-readable detail — e.g. `\"reported 1.2.0 is below the\nrequired floor 1.3.0\"` or `\"device has not reported this\nattribute\"`. `None` on a `Pass`."},"status":{"$ref":"#/components/schemas/PostureCheckStatus","description":"The verdict for this dimension."}}},"PostureCheckStatus":{"type":"string","description":"One posture dimension's verdict against the org's policy.","enum":["pass","fail","unknown"]},"ProbeMode":{"type":"string","description":"The two operator probes exposes for an external exit.","enum":["health","reachability"]},"ProbeOutcome":{"type":"object","description":"The result of a [`ProbeMode`] probe, reported by the agent and\nreturned verbatim to the operator HTTP caller. Carries no secret\ndriver config — only a usability verdict + a short state token.","required":["reachable","state"],"properties":{"detail":{"type":["string","null"],"description":"Optional human-readable detail (an error class, a hop count).\nLength-bounded; never carries secret config."},"latency_ms":{"type":["integer","null"],"format":"int32","description":"Optional round-trip latency of the reachability probe, in\nmilliseconds. Absent for a `health` state read.","minimum":0},"reachable":{"type":"boolean","description":"Whether the exit is usable: for `health`, the driver reports a\nlive connection; for `reachability`, the out-of-band probe\nsucceeded."},"state":{"type":"string","description":"A short driver-state token (e.g. `connected`, `degraded`,\n`down`, `no_circuit`). Length-bounded."}}},"ProgramSpec":{"type":"object","description":"The program a browser runs for a challenge.","required":["seed","ops"],"properties":{"ops":{"type":"array","items":{"$ref":"#/components/schemas/Op"},"description":"Steps, in order."},"seed":{"type":"integer","format":"int32","description":"Starting value of the accumulator.","minimum":0}}},"ProtocolQuotaUpdateRequest":{"type":"object","description":"Wire request body for\n`PATCH /platform/subscriptions/{subscription_id}/protocol-quotas/{protocol}`\n(the admin-tier writer slice\n\"Per-protocol bandwidth enforcement\"). Sets\n`subscription_protocol_quotas.monthly_limit_bytes` on the\ncaller-resolved active-period row.\n\n`monthly_limit_bytes` is `Option<i64>` to mirror the schema column\n(NULLable). `None` ⇒ unlimited (the evaluator worker\nemits no drop rule for unlimited rows regardless of `bytes_used`).\n`Some(n)` ⇒ that cap; the validator forbids negative values\n(the schema's `bytes_used >= 0` CHECK does not bind on\n`monthly_limit_bytes`, but a negative cap is meaningless and would\nproduce a permanently-tripped quota — reject at the wire boundary).\n`0` is a legitimate cap meaning \"drop all traffic on this protocol\"\nand is intentionally accepted.","properties":{"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"New cap on monthly bytes for this protocol within the active\nperiod. `null` sets the row's `monthly_limit_bytes` to NULL\n(unlimited); a non-negative integer sets that cap. `0` is\nadmitted (drops all traffic on this protocol) so the admin can\nquarantine a subscription's protocol without deleting the row."}}},"ProtocolUsageItem":{"type":"object","description":"One row of `GET /billing/subscriptions/{subscription_id}/protocol-usage`\n(the customer read-side surface\n\"Per-protocol bandwidth enforcement\"). Mirrors the shape of one\n`subscription_protocol_quotas` row narrowed to the active period for the\nsubscription, with the columns the customer UX needs to render the\nper-protocol usage view.\n\n`monthly_limit_bytes` is `Option<i64>` because the schema column is\nnullable (NULL = unlimited); the wire serialises NULL as JSON `null`\nso a frontend can distinguish \"uncapped protocol\" from \"0-byte cap\"\n(the latter would be a non-null `0`). `last_sample_at` is also\n`Option<String>` because the row is created by the evaluator worker\nthe first time a sample lands; until then the column carries\nthe row's `created_at` value via a default UPDATE, but the wire keeps\nthe optional shape so frontends render \"no traffic yet\" cleanly.","required":["protocol","period_start","period_end","bytes_used"],"properties":{"bytes_used":{"type":"integer","format":"int64","description":"Total bytes seen on this protocol within the active period\n(`subscription_protocol_quotas.bytes_used`). Direction-agnostic\nsum of `bytes_in + bytes_out` from `tunnel_traffic_samples`\nrolled up by the evaluator worker."},"last_sample_at":{"type":["string","null"],"description":"RFC3339 timestamp of the most recent sample the evaluator worker\ningested into this row. NULL until the worker first writes the\nrow (or after a fresh period rollover). The frontend can use\nthis to mark \"no traffic in current period\" for any uncapped\nprotocol that the worker has nonetheless seeded."},"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"Cap on total bytes for this protocol within the active period\n(`subscription_protocol_quotas.monthly_limit_bytes`). NULL =\nunlimited; the evaluator worker does not emit a drop\nrule for an unlimited row regardless of `bytes_used`."},"period_end":{"type":"string","description":"RFC3339 timestamp of the end of the active period\n(`subscription_protocol_quotas.period_end`). Exclusive bound;\nthe row whose `[period_start, period_end)` window contains\n`state.clock.now()` is the active row."},"period_start":{"type":"string","description":"RFC3339 timestamp of the start of the active period\n(`subscription_protocol_quotas.period_start`). Inclusive bound."},"protocol":{"type":"string","description":"Protocol classifier string (matches\n`subscription_protocol_quotas.protocol` and\n`tunnel_traffic_samples.protocol`). Free-form by schema design —\nthe agent reports whatever the kernel classifier emits."}}},"ProtocolUsageListResponse":{"type":"object","description":"Wire response for\n`GET /billing/subscriptions/{subscription_id}/protocol-usage`. A bare\nobject with a single `items` array — mirrors `OrgMemberListResponse`\n/ `AuditEventListResponse` precedent. Keeps the door open to add\nenvelope-level fields (`period_start_active`, `total_bytes_used`,\nfuture cursor) without breaking clients that already parse the array\nshape.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProtocolUsageItem"},"description":"Per-protocol usage rows for the active period of the resolved\nsubscription, ordered by `protocol ASC` for deterministic\nrendering. Empty when the subscription has no quota rows yet\n(the evaluator worker creates rows on first sample)."}}},"PublicIpBindRequest":{"type":"object","description":"Request body for `POST /static-ips/{id}/bind`. Creates a `bindings`\nrow and transitions the IP to `in_use`. Any `removed` predecessor\nfor this IP is hard-deleted synchronously.","required":["tunnel_id"],"properties":{"dest_ports":{"type":["string","null"],"description":"Optional port-forward subset, e.g. `\"tcp/443,udp/53\"`. When set,\nthe caller's subscription plan must have `allow_port_forward = 1`."},"path_tier_id":{"type":["string","null"],"description":"Optional UUIDv7 of the network path tier to attach to this\nbinding. When present the tier must be granted by the\nIP's subscription plan via `plan_path_tiers` (`included = 1`), or\nbe an overage-available tier (`included = 0`) while the\nsubscription has `allow_overages = 1`. `null` keeps the binding\non default ingress-PoP egress. Mutually exclusive with\n`preset_slug` (the server expands a preset to its tier;\nsupplying both is ambiguous → 400 `tier_and_preset_exclusive`)."},"preset_slug":{"type":["string","null"],"description":"Optional preset slug (the customer-facing \"5-button\npicker\", e.g. `\"privacy\"`) — an alternative to a raw\n`path_tier_id`. The server expands the preset to its underlying\n`path_tier_id`, runs the same plan/overage eligibility gate,\napplies the preset's `qos_overrides` as ephemeral org-scoped\nrules, and records the slug on the binding so the dashboard can\nshow the picked label without leaking tier mechanics. When\nneither `path_tier_id` nor `preset_slug` is given the default\npreset (`simple`) is selected automatically; an absent/inactive\n`simple` preset leaves the binding on default egress."},"rule_type":{"type":["string","null"],"description":"Traffic direction for the nft rule. Defaults to `\"both\"` when\nabsent (standard 1:1 routed-IP behaviour)."},"tunnel_id":{"type":"string","description":"UUIDv7 of the tunnel to bind. Must belong to the caller's org."}}},"PublicIpClaimAnyRequest":{"type":"object","description":"Request body for `POST /static-ips/claim-any`. The server picks the\nlowest-numbered `available` IP in the specified pool and atomically\nreserves it — saves the frontend a browse-pick-claim round-trip.","required":["subscription_id","pool_id"],"properties":{"pool_id":{"type":"string","description":"Pool to draw from. The server picks the lowest `ip_address` in\nthis pool that has `status = 'available'`."},"subscription_id":{"type":"string","description":"Subscription to attach the claimed IP to. Must be owned by the\ncaller's org and in an active state."}}},"PublicIpClaimRequest":{"type":"object","description":"Request body for `POST /static-ips/{id}/claim`. Claims a specific\n`available` IP and assigns it to the caller's org + subscription.","required":["subscription_id"],"properties":{"subscription_id":{"type":"string","description":"Subscription to attach the IP to. Must be owned by the caller's\norg and in an active state."}}},"PublicIpHistoryItem":{"type":"object","description":"One entry in the binding-state-transition history for a public IP.\nSourced from `bindings` rows for this IP, ordered by `created_at DESC`.","required":["id","tunnel_id","status","rule_type","created_at"],"properties":{"applied_at":{"type":["string","null"],"description":"RFC3339 timestamp when the routing agent applied the rule.\n`null` if the binding never reached `active`."},"created_at":{"type":"string","description":"RFC3339 timestamp when this binding row was created (the bind action)."},"dest_ports":{"type":["string","null"],"description":"Port-forward subset, if any."},"id":{"type":"string","description":"UUIDv7 primary key of the `bindings` row."},"removed_at":{"type":["string","null"],"description":"RFC3339 timestamp when the binding was fully removed.\n`null` for the current (non-removed) binding."},"rule_type":{"type":"string","description":"Rule type for this binding."},"status":{"type":"string","description":"Terminal or current status of this binding row."},"tunnel_id":{"type":"string","description":"UUIDv7 of the tunnel this binding linked to (`bindings.tunnel_id`)."}}},"PublicIpHistoryResponse":{"type":"object","description":"Response body for `GET /static-ips/{id}/history`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicIpHistoryItem"},"description":"Binding-state transitions ordered by `created_at DESC` (newest first)."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."}}},"PublicIpListResponse":{"type":"object","description":"Response body for `GET /static-ips`.","required":["static_ips"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."},"static_ips":{"type":"array","items":{"$ref":"#/components/schemas/PublicIpRead"},"description":"Page of IP records owned by the caller's org, ordered by\n`created_at DESC, id DESC`."}}},"PublicIpPatchRequest":{"type":"object","description":"Request body for `PATCH /static-ips/{id}`.\nRetargets the IP's live (`pending`/`active`) binding to a different\nnetwork path tier in place — no rebind, no new `bindings` row. The\nnew tier passes the same plan/overage eligibility gate as bind-time\ntier selection (`included = 1`, or `included = 0` while the\nsubscription has `allow_overages = 1`).","required":["path_tier_id"],"properties":{"path_tier_id":{"type":"string","description":"UUIDv7 of the network path tier to retarget the live binding to.\nMust be granted by the IP's subscription plan via\n`plan_path_tiers` (`included = 1`), or be an overage-available\ntier (`included = 0`) while the subscription has\n`allow_overages = 1`. Parsed as a UUID in the handler\n(malformed ⇒ 400 `invalid_path_tier_id`)."}}},"PublicIpRead":{"type":"object","description":"Wire response for `GET /static-ips` (list items) and\n`GET /static-ips/{id}` (single fetch). Mirrors the `public_ips` row\nplus an optional `bindings` JOIN for the active/pending binding.","required":["id","ip_address","status","pool_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation timestamp."},"current_binding":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CurrentBindingRef","description":"Active or pending binding for this IP. `null` when unbound."}]},"id":{"type":"string","description":"UUIDv7 primary key (`public_ips.id`)."},"ip_address":{"type":"string","description":"The public IPv4 address string (`public_ips.ip_address`)."},"last_bound_at":{"type":["string","null"],"description":"RFC3339 timestamp of the last binding for this IP\n(`public_ips.last_bound_at`). `null` when never bound."},"org_id":{"type":["string","null"],"description":"Owning org (`public_ips.org_id`). `null` when `status = 'available'`."},"pool_id":{"type":"string","description":"UUIDv7 of the IP pool this address belongs to (`public_ips.pool_id`)."},"reserved_at":{"type":["string","null"],"description":"RFC3339 timestamp when the IP was reserved by this org.\n`null` when unclaimed."},"status":{"type":"string","description":"Lifecycle status: `\"available\"`, `\"reserved\"`, `\"in_use\"`,\n`\"management\"`, `\"removed\"`."},"subscription_id":{"type":["string","null"],"description":"Parent subscription (`public_ips.subscription_id`).\n`null` when unclaimed."},"updated_at":{"type":"string","description":"RFC3339 last-updated timestamp."}}},"PublicIpReleaseResponse":{"type":"object","description":"Response body for `POST /static-ips/{id}/release`.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the 200 success path."}}},"PublicIpUnbindResponse":{"type":"object","description":"Response body for `POST /static-ips/{id}/unbind`.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the 200 success path."}}},"PurgeHoldRequest":{"type":"object","description":"`POST /platform/users/{id}/purge-hold` body.","required":["reason"],"properties":{"reason":{"type":"string","description":"Why the account must be kept, e.g. the legal matter (3 to 500\ncharacters, not counting surrounding spaces)."}}},"PurgeHoldResponse":{"type":"object","description":"Purge-hold response.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on success."}}},"Purpose":{"type":"string","description":"What a re-authentication is for.","enum":["staff","account","delete_account"]},"QosRuleAction":{"type":"string","description":"The `qos_rules.action` column's verb. The on-the-wire mirror of\nthe column `CHECK (action IN ('route_via', 'prefer_path_tier',\n'rate_limit', 'drop'))` (`0017_path_tiers_qos_init.sql`) — a\nreal stored enum (the [`crate::platform::agents::agent_types`]\n`AgentStatus` precedent), not a derived value.\n\n* [`RouteVia`](Self::RouteVia) — force the flow's egress to a\n  specific server ([`QosRuleTarget::server_id`]).\n* [`PreferPathTier`](Self::PreferPathTier) — bias the flow onto\n  a network-path tier ([`QosRuleTarget::path_tier_id`]).\n* [`RateLimit`](Self::RateLimit) — cap the flow's throughput\n  ([`QosRuleTarget::max_mbps`]).\n* [`Drop`](Self::Drop) — discard matching flows; the `target`\n  column is an empty object for this verb.","enum":["route_via","prefer_path_tier","rate_limit","drop"]},"QosRuleAdminEntry":{"type":"object","description":"One row of `GET /platform/qos-rules` — the **admin** view of a\n`qos_rules` row (`platform_admin`-only). Every\nfield maps off `0017_path_tiers_qos_init.sql`. Response-only (no\n`Validate`): the admin list is a GET with no client body; the\ncreate / patch request bodies are separate shapes\nthat land with their handlers.","required":["id","name","src_match","flow_match","action","target","priority","active","created_at","updated_at"],"properties":{"action":{"$ref":"#/components/schemas/QosRuleAction","description":"`qos_rules.action` verb (see [`QosRuleAction`])."},"active":{"type":"boolean","description":"`qos_rules.active` — `0/1` column decoded to `bool`."},"created_at":{"type":"string","format":"date-time","description":"`qos_rules.created_at` (RFC3339) — row-creation instant; the\nsecondary cursor key is `id`, ordered with `priority`."},"flow_match":{"$ref":"#/components/schemas/QosRuleFlowMatch","description":"`qos_rules.flow_match` decoded into the typed superset."},"id":{"type":"string","description":"`qos_rules.id` (UUIDv7). The handle for the\nPer-rule routes."},"name":{"type":"string","description":"`qos_rules.name` — operator label; `NOT NULL`."},"org_id":{"type":["string","null"],"description":"`qos_rules.org_id` — the owning org, or `None` for a\n**platform-wide** rule (the column is nullable; NULL =\nglobal)."},"priority":{"type":"integer","format":"int64","description":"`qos_rules.priority` — evaluation order; lower is more\nprecedent. The cursor-ordering key."},"src_match":{"$ref":"#/components/schemas/QosRuleSrcMatch","description":"`qos_rules.src_match` decoded into the typed superset."},"target":{"$ref":"#/components/schemas/QosRuleTarget","description":"`qos_rules.target` decoded into the typed superset."},"updated_at":{"type":"string","format":"date-time","description":"`qos_rules.updated_at` (RFC3339) — last mutation of the row."}}},"QosRuleAdminListResponse":{"type":"object","description":"Response envelope for `GET /platform/qos-rules`. A page\nof [`QosRuleAdminEntry`] rows ordered `(priority ASC, id ASC)`\nplus the opaque `next_cursor` (`null` on the last page). Mirrors\nthe `AgentListResponse` `{ items, next_cursor }` contract so\nevery cursor-paginated list on the wire is uniform.","required":["qos_rules"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or `null` on the last\npage."},"qos_rules":{"type":"array","items":{"$ref":"#/components/schemas/QosRuleAdminEntry"},"description":"One page of QoS-rule rows, `(priority ASC, id ASC)`. `[]`\nwhen no rows match the filters at or after the cursor."}}},"QosRuleCreateRequest":{"type":"object","description":"Request body for `POST /platform/qos-rules` — operator\ncreation of one admin traffic-engineering rule. Every field maps\nonto a `qos_rules` column (`0017_path_tiers_qos_init.sql`); the\nresponse is the freshly inserted row as a\n[`super::qos_rule_admin_types::QosRuleAdminEntry`] (the same\nshape lists, this reads, patches).\n\n`Validate` enforces the boundary: `name` is non-empty\nand length-capped, `priority` is `>= 0`. The strict input\nsupersets reject an unsupported `src_match` / `flow_match` /\n`target` key at deserialization (the \"reject unsupported\nkeys\" clause). The action↔target consistency is checked in the\nhandler via [`action_target_error`] (the validator crate cannot\nexpress a cross-field enum predicate — the `path_tiers_create`\nmanual-`FieldError` precedent). `org_id` absent ⇒ a\nplatform-wide rule (column NULL); `priority` absent ⇒ the schema\ndefault `100`; `active` absent ⇒ `true` (schema default `1`).","required":["name","action"],"properties":{"action":{"$ref":"#/components/schemas/QosRuleAction","description":"`qos_rules.action` — the verb the routing agent applies on a\nmatch (see [`QosRuleAction`])."},"active":{"type":["boolean","null"],"description":"`qos_rules.active` — whether the routing agent evaluates the\nrule. Absent ⇒ `true` (schema default `1`)."},"flow_match":{"$ref":"#/components/schemas/QosRuleFlowMatchInput","description":"`qos_rules.flow_match` — the per-flow classifier predicate.\nAbsent ⇒ `{}` (match-any). Unknown key ⇒ 422."},"name":{"type":"string","description":"`qos_rules.name` — operator label. Non-empty, `<= 128`."},"org_id":{"type":["string","null"],"format":"uuid","description":"`qos_rules.org_id` — the owning org, or `None`/absent for a\n**platform-wide** rule (column NULL). Typed `Uuid` so a\nmalformed value rejects at deserialization; the handler\npre-checks `orgs` existence."},"priority":{"type":["integer","null"],"format":"int64","description":"`qos_rules.priority` — evaluation order; lower is more\nprecedent. Absent ⇒ the schema default `100`. `>= 0`."},"src_match":{"$ref":"#/components/schemas/QosRuleSrcMatchInput","description":"`qos_rules.src_match` — the flow-source selector. Absent ⇒\n`{}` (match-any). Unknown key ⇒ 422."},"target":{"$ref":"#/components/schemas/QosRuleTargetInput","description":"`qos_rules.target` — the action argument. Absent ⇒ `{}`\n(valid only for `drop`). Unknown key ⇒ 422; shape is checked\nagainst `action` via [`action_target_error`]."}}},"QosRuleDeleteResponse":{"type":"object","description":"Response envelope for `DELETE /platform/qos-rules/{id}`:\n`{ ok: true }` on the single 200 path (the hard-delete of one\n`qos_rules` row), mirroring the\n[`super::plan_path_tier_admin_types::PlanPathTierDeleteResponse`]\n/ [`crate::platform::agents::agent_types::AgentRetireResponse`]\nshape. A deliberate QoS-rule-local copy (not a reuse of the\nplan-grant `PlanPathTierDeleteResponse`) so the QoS-rule wire\nvocabulary stays self-contained on its own resource path — the\nper-concern file discipline this module follows. The audit row\nis the canonical record (the `prev_*` rule identity + state so\nthe removed rule is reconstructable after the row is gone); the\n404 path returns an [`crate::error::ApiError`], never this\nshape. Response-only, no `Validate`;\n`ToSchema`.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for a\nforward-compatible envelope shape rather than as a status\nflag (the `PlanPathTierDeleteResponse` / `AgentRetireResponse`\nprecedent)."}}},"QosRuleFlowMatch":{"type":"object","description":"Typed optional-superset of the `qos_rules.flow_match` JSON-object\ncolumn — the per-flow classifier predicate (protocol / port /\ndestination / flow class). Same posture as [`QosRuleSrcMatch`]:\nall-`Option`, `{}` ⇒ all-`None`, no `deny_unknown_fields`.","properties":{"dst_cidr":{"type":["string","null"],"description":"Match this destination CIDR (e.g. `\"10.0.0.0/8\"`), or\n`None`."},"dst_port":{"type":["integer","null"],"format":"int64","description":"Match this destination port, or `None`."},"flow_class":{"type":["string","null"],"description":"Match this classifier-assigned flow class, or `None`."},"protocol":{"type":["string","null"],"description":"Match this L4/L7 protocol class (e.g. `\"https\"`,\n`\"quic\"`), or `None`. The protocol-quota auto-emit\npredicate."}}},"QosRuleFlowMatchInput":{"type":"object","description":"Strict request-side mirror of [`QosRuleFlowMatch`]. Same posture\nas [`QosRuleSrcMatchInput`]: `#[serde(deny_unknown_fields)]`.","properties":{"dst_cidr":{"type":["string","null"],"description":"See [`QosRuleFlowMatch::dst_cidr`]."},"dst_port":{"type":["integer","null"],"format":"int64","description":"See [`QosRuleFlowMatch::dst_port`]."},"flow_class":{"type":["string","null"],"description":"See [`QosRuleFlowMatch::flow_class`]."},"protocol":{"type":["string","null"],"description":"See [`QosRuleFlowMatch::protocol`]."}},"additionalProperties":false},"QosRuleFlowSample":{"type":"object","description":"Concrete flow-attribute sample for the dry-run — the\nhypothetical flow's L4/L7 shape the rule-set is evaluated\nagainst. The request-side analogue of\n[`super::qos_rule_admin_types::QosRuleFlowMatch`]: same\n`protocol` / `dst_port` / `flow_class` selector fields, but a\nconcrete [`dst_ip`](Self::dst_ip) (one address) where the rule\ncarries a `dst_cidr` (a network) — the dry-run tests whether the\nsample address falls inside each rule's CIDR.\n\n`#[serde(deny_unknown_fields)]`, the\n[`QosRuleSrcMatchInput`] posture: an unsupported key fails at\nthe axum `Json` extractor as a `JsonDataError` ⇒ 422 before the\nhandler runs, so an operator typo cannot silently widen the\nprobe. Every field is `#[serde(default)]` `Option`: an absent\nfield is \"the flow does not carry this attribute\", which a rule\npredicate on that field can never satisfy (fail-closed — the\nrule requires the attribute the sample omits).","properties":{"dst_ip":{"type":["string","null"],"description":"The simulated flow's destination IP (v4 or v6), or `None`.\nTested for membership in a rule's\n[`QosRuleFlowMatch::dst_cidr`](super::qos_rule_admin_types::QosRuleFlowMatch::dst_cidr)\nnetwork (longest-match is not modelled — a rule's `dst_cidr`\neither contains this address or it does not)."},"dst_port":{"type":["integer","null"],"format":"int64","description":"The simulated flow's destination port, or `None`. Matched\nexactly against a rule's\n[`QosRuleFlowMatch::dst_port`](super::qos_rule_admin_types::QosRuleFlowMatch::dst_port)."},"flow_class":{"type":["string","null"],"description":"The simulated flow's classifier-assigned flow class, or\n`None`. Matched exactly against a rule's\n[`QosRuleFlowMatch::flow_class`](super::qos_rule_admin_types::QosRuleFlowMatch::flow_class)."},"protocol":{"type":["string","null"],"description":"The simulated flow's L4/L7 protocol class (e.g. `\"https\"`,\n`\"quic\"`), or `None` (the flow carries no protocol hint).\nMatched exactly against a rule's\n[`QosRuleFlowMatch::protocol`](super::qos_rule_admin_types::QosRuleFlowMatch::protocol)."}},"additionalProperties":false},"QosRuleSrcMatch":{"type":"object","description":"Typed optional-superset of the `qos_rules.src_match` JSON-object\ncolumn — the flow-source selector the routing agent matches a\nflow's origin against. The column is `TEXT NOT NULL`,\nschema-shape-only; this is its on-the-wire form\n(no ad-hoc JSON `Value`, the `PathTierCapabilities`\nprecedent). Every field is `#[serde(default)]` `Option`: a `{}`\ncolumn deserialises to all-`None`, and an emitter that sets only\n`tunnel_id` (the protocol-quota auto-emit shape) leaves the\nothers `None`. No `deny_unknown_fields` — a forward selector key\nround-trips untyped-but-preserved at the column level and is\nsimply not surfaced until a field is added here.","properties":{"binding_id":{"type":["string","null"],"description":"Match flows on this binding (`bindings.id`), or `None`."},"device_id":{"type":["string","null"],"description":"Match flows from this client device (`client_devices.id`),\nor `None`."},"org_id":{"type":["string","null"],"description":"Match flows owned by this org (`orgs.id`), or `None`."},"subscription_id":{"type":["string","null"],"description":"Match flows of this subscription (`subscriptions.id`), or\n`None`. The protocol-quota auto-emit selector."},"tunnel_id":{"type":["string","null"],"description":"Match flows on this tunnel (`tunnels.id`), or `None`. The\ntunnel-bandwidth auto-emit selector."}}},"QosRuleSrcMatchInput":{"type":"object","description":"Strict request-side mirror of [`QosRuleSrcMatch`]. Identical\nfields, but `#[serde(deny_unknown_fields)]` — the\nclause \"validate `src_match` JSON shapes (reject unsupported\nkeys)\". The response superset deliberately tolerates a\nforward key for read forward-compat; the *write* boundary\nrejects one so an operator typo (`{\"subscritpion_id\": …}`)\nfails fast as a `JsonDataError` ⇒ 422 at the axum `Json`\nextractor rather than silently persisting a no-op selector.\nConverted to\nthe response superset via [`From`] for the persisted column +\nthe echoed entry.","properties":{"binding_id":{"type":["string","null"],"description":"See [`QosRuleSrcMatch::binding_id`]."},"device_id":{"type":["string","null"],"description":"See [`QosRuleSrcMatch::device_id`]."},"org_id":{"type":["string","null"],"description":"See [`QosRuleSrcMatch::org_id`]."},"subscription_id":{"type":["string","null"],"description":"See [`QosRuleSrcMatch::subscription_id`]."},"tunnel_id":{"type":["string","null"],"description":"See [`QosRuleSrcMatch::tunnel_id`]."}},"additionalProperties":false},"QosRuleTarget":{"type":"object","description":"Typed optional-superset of the `qos_rules.target` JSON-object\ncolumn — the action argument. Which field is meaningful depends\non [`QosRuleAdminEntry::action`]: `route_via` reads\n[`server_id`](Self::server_id), `prefer_path_tier` reads\n[`path_tier_id`](Self::path_tier_id), `rate_limit` reads\n[`max_mbps`](Self::max_mbps), `drop` has an empty `{}` target\n(all-`None`). Same posture as [`QosRuleSrcMatch`].","properties":{"max_mbps":{"type":["integer","null"],"format":"int64","description":"`rate_limit` ceiling in megabits/second, or `None`."},"path_tier_id":{"type":["string","null"],"description":"`prefer_path_tier` tier (`network_path_tiers.id`), or\n`None`."},"server_id":{"type":["string","null"],"description":"`route_via` egress server (`servers.id`), or `None`."}}},"QosRuleTargetInput":{"type":"object","description":"Strict request-side mirror of [`QosRuleTarget`]. Same posture as\n[`QosRuleSrcMatchInput`]: `#[serde(deny_unknown_fields)]`. Which\nfield is required depends on the request `action` — see\n[`action_target_error`].","properties":{"max_mbps":{"type":["integer","null"],"format":"int64","description":"See [`QosRuleTarget::max_mbps`]."},"path_tier_id":{"type":["string","null"],"description":"See [`QosRuleTarget::path_tier_id`]."},"server_id":{"type":["string","null"],"description":"See [`QosRuleTarget::server_id`]."}},"additionalProperties":false},"QosRuleTestRequest":{"type":"object","description":"Request body for `POST /platform/qos-rules/test` — the\nhypothetical flow to evaluate the stored rule-set against. No\nfield is required: an empty body\n(`{\"src_match_sample\":{},\"flow_sample\":{}}` or `{}`) is a valid\nprobe that matches only rules with empty `src_match` /\n`flow_match` (the catch-all rules).\n\n`Validate` is derived for boundary uniformity with the other\n`platform::qos` request DTOs (no scalar bound applies — the\nstrict inner supersets carry the only structural constraint, the\n`#[serde(deny_unknown_fields)]` unknown-key rejection). The\nscoping org for the dry-run is\n[`src_match_sample.org_id`](QosRuleSrcMatchInput::org_id): the\nhandler considers a rule in scope when the rule is platform-wide\n(`qos_rules.org_id` NULL) or its `org_id` equals this — the\nrouting agent's real evaluation scope for one org's flow.","properties":{"flow_sample":{"$ref":"#/components/schemas/QosRuleFlowSample","description":"The simulated flow's L4/L7 attributes. Absent ⇒ `{}` (a\nflow with no attributes set; only rules with an empty\n`flow_match` can match on the flow axis)."},"src_match_sample":{"$ref":"#/components/schemas/QosRuleSrcMatchInput","description":"The simulated flow's source identity (org / subscription /\ntunnel / binding / device). Reuses the strict\n[`QosRuleSrcMatchInput`] — same selector fields the\n`qos_rules.src_match` column carries, same unknown-key 422.\nAbsent ⇒ `{}` (a flow with no source selectors set; only\nrules with an empty `src_match` can match on the source\naxis)."}}},"QosRuleTestResponse":{"type":"object","description":"Response for `POST /platform/qos-rules/test` — the\nresolved dry-run verdict. `matched` is the highest-precedent\nactive in-scope rule whose `src_match` *and* `flow_match`\npredicates the sample satisfies (`priority ASC, id ASC` — the\nsame evaluation order the list pages in, lowest priority\nnumber = most precedent), or `null` when no rule matches.\n`resolved_action` is that rule's [`QosRuleAction`] verb (the\n\"+ resolved action\" half of the contract), or `null`\nwhen nothing matched — it is always `matched.action` when\n`matched` is non-null, surfaced as a top-level field so a caller\ninspecting only the decision need not reach into the rule body.\n\nResponse-only (no `Validate`); `ToSchema`. The\nreturned [`QosRuleAdminEntry`] is the exact\nprojection so a dry-run → fetch-the-rule round-trips loss-free.","properties":{"matched":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QosRuleAdminEntry","description":"The matched rule in full, or `null` when no active in-scope\nrule's predicates the sample satisfied."}]},"resolved_action":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QosRuleAction","description":"The matched rule's action verb, or `null` when nothing\nmatched. Mirrors `matched.action` when `matched` is present."}]}}},"QosRuleUpdateRequest":{"type":"object","description":"Request body for `PATCH /platform/qos-rules/{id}` —\noperator partial-edit of one admin traffic-engineering rule.\nEvery field is `Option<T>`; a JSON object that omits a key\nleaves the `qos_rules` column unchanged, and an empty-object\nPATCH (`{}`) is a no-op (the matching handler does NOT bump\n`updated_at` on the no-op path — touch-only idempotence, the\n`path_tiers_patch` precedent). The response is the refreshed\nrow as a [`super::qos_rule_admin_types::QosRuleAdminEntry`] so\nthe caller reads-after-write in one round trip.","properties":{"action":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QosRuleAction","description":"New `qos_rules.action` verb. Omit ⇒ keep. The handler\nre-checks the action↔target consistency on the resolved pair."}]},"active":{"type":["boolean","null"],"description":"New `qos_rules.active` flag — whether the routing agent\nevaluates the rule. Omit ⇒ keep."},"flow_match":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QosRuleFlowMatchInput","description":"New `qos_rules.flow_match` — whole-value replacement of the\nper-flow classifier predicate. Omit ⇒ keep; present\n(including `{}`) ⇒ replace. Unknown key ⇒ 422."}]},"name":{"type":["string","null"],"description":"New `qos_rules.name` (operator label). `NOT NULL` column —\n`length(min = 1, max = 128)`, so an empty string is a 422\nreject, never a clear. Omit ⇒ keep."},"org_id":{"type":["string","null"],"description":"New `qos_rules.org_id`. The `double_option` adapter:\nomitted ⇒ keep, explicit JSON `null` ⇒ clear to a\n**platform-wide** rule (`org_id` NULL), a uuid ⇒ set (the\nhandler pre-checks `orgs` existence + maps the FK-violation\nTOCTOU to a 422). `#[schema(value_type = Option<String>)]`\nkeeps the OpenAPI shape a clean nullable string (the\nspec is code-generated, the nested option is a serde-only\ndetail)."},"priority":{"type":["integer","null"],"format":"int64","description":"New `qos_rules.priority` — evaluation order; lower is more\nprecedent. `>= 0`. Omit ⇒ keep."},"src_match":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QosRuleSrcMatchInput","description":"New `qos_rules.src_match` — whole-value replacement of the\nflow-source selector. Omit ⇒ keep the stored object; present\n(including `{}`) ⇒ replace. Unknown key ⇒ 422."}]},"target":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QosRuleTargetInput","description":"New `qos_rules.target` — whole-value replacement of the\naction argument. Omit ⇒ keep; present (including `{}`) ⇒\nreplace. Unknown key ⇒ 422; shape is checked against the\nresolved `action` handler-side."}]}}},"QuicBackendTier":{"type":"string","description":"Which data-plane mode the QUIC server is currently running.\nMaps to `servers.quic_mode` — operator-pinned target; the\nheartbeat reports the agent's observed mode so a drift\nbetween target and observed surfaces in telemetry without\nmutating the target column (there is never drift-fixing).","enum":["kernel","userspace"]},"QuicClientProfileRead":{"type":"object","description":"One QUIC tunnel the calling device is allowed to dial. Maps 1:1 to the\nclient's `QuicDialPlan`:\n\n- `server_ed25519_public_key` → the pinned server identity\n- `server_endpoint` → the UDP address to dial\n- `allocated_ip` → the device's overlay address (the TUN interface IP)\n- `allowed_ips` → the nets routed through the tunnel (server peer's\n  `allowed_ips` for cryptokey routing)\n- `pq_mode` → hybrid post-quantum KEM vs classical","required":["tunnel_id","server_id","name","server_ed25519_public_key","server_endpoint","allocated_ip","allowed_ips","pq_mode","bridge_endpoints","port_ladder_endpoints","ech_mode","client_hello_profile"],"properties":{"allocated_ip":{"type":"string","description":"`quic_tunnels.allocated_ip` — the device's overlay `/32` address,\nwritten to the client's TUN interface."},"allowed_ips":{"type":"string","description":"`quic_tunnels.allowed_ips` — JSON array of CIDRs routed through the\ntunnel (the server peer's cryptokey-routing `allowed_ips`). `[]` when\nunset; the client then defaults to a full tunnel."},"alpn_set":{"type":"array","items":{"type":"string"},"description":"ALPN identifiers the server advertises (F-CAP1/3). Empty on an\nolder control plane (serde default) ⇒ client uses its built-in\ndual-window set."},"backend_tier":{"type":["string","null"],"description":"Agent-observed data-plane tier (`kernel` / `userspace` /\n`other`); `None` until the first heartbeat that reports it\n(F-CAP1/3)."},"bridge_endpoints":{"type":"array","items":{"type":"string"},"description":"Alternate reachable addresses for `server_id` (F-CENS3) --\nprovisioned via `POST /platform/quic-servers/{id}/bridges` and\ndialed with the same `server_ed25519_public_key`, so a censor\nblocking `server_endpoint` does not strand the client. Ordered by\n`quic_server_bridge_endpoints.priority` ascending then id; `[]` when\nthe server has no bridges provisioned. The client dial loop tries\n`server_endpoint` first, then these in order."},"client_hello_profile":{"type":"string","description":"ClientHello crypto-preference profile id (F-CENS2,\n`servers.quic_client_hello_profile`): `native` | `chrome` |\n`firefox`. Defaults to `native`."},"dns_servers":{"type":["string","null"],"description":"Optional DNS server list (`quic_tunnels.dns_servers`), comma-\nseparated as stored; `None` when NULL (client defaults to the system\nresolver)."},"ech_config_list_b64":{"type":["string","null"],"description":"Base64-STANDARD of the ECH config-list bytes (DNS HTTPS `ech=`\npayload). Required when `ech_mode = \"enable\"`; `None` when unset."},"ech_mode":{"type":"string","description":"ECH mode for this server (F-CENS2, `servers.quic_ech_mode`):\n`off` | `grease` | `enable`. Defaults to `off`."},"masque_enabled":{"type":"boolean","description":"Whether the dedicated MASQUE listener is enabled on the server\n(F-CAP3). Independent of `masque_listen_addr` being set — both\nmust be true for `--masque` to dial."},"masque_listen_addr":{"type":["string","null"],"description":"The server's dedicated MASQUE/CONNECT-IP listener address\n(`servers.masque_listen_addr`) — distinct from\n`server_endpoint`, since the two listeners run on separate ports.\n`None` when the server has no MASQUE listener enabled (`servers\n.masque_enabled = 0`) or configured; `connect --quic --masque`\nrefuses to dial without one rather than silently falling back to\nthe native path."},"min_client_version":{"type":"integer","format":"int64","description":"Minimum client version code required to dial this server\n(F-CAP2/3). `0` = any client. The dial plan surfaces it so the\nagent can refuse locally rather than spin forever against an\nincompatible peer."},"name":{"type":"string","description":"Human-facing label (`quic_tunnels.profile_name`), falling back to\n`profile-<n>` from the tunnel's `profile_number` when unset."},"outer_sni":{"type":["string","null"],"description":"Outer TLS SNI the client puts on the wire when dialing this\nserver (F-CENS2, `servers.quic_outer_sni`). Cover\nidentity only — mutual-TLS still pins by ed25519. `None` when\nunset; the client falls back to the engine default\n(`appsynergy-quic`)."},"pop_slug":{"type":["string","null"],"description":"The serving PoP/colo's human-readable handle\n(`points_of_presence.slug` via `servers.pop_id`).\nDisplay-only — the client prints it (`list --quic` POP column)\nbut never dials or routes off it. `None` when the server is not\nhomed to a PoP; additive, so an older daemon simply ignores it."},"port_ladder_endpoints":{"type":"array","items":{"type":"string"},"description":"Same-server port-ladder candidates (the server multi-port\nbind / client port ladder): one `host:port` per entry in\n`servers.quic_additional_ports`, using `server_endpoint`'s own\nhost — the canonical entry is `443`, so the QUIC session blends\nwith ordinary HTTPS traffic on networks that block non-standard\nUDP ports. `[]` when the operator has configured no extra\nports. The client dial loop merges these ahead of\n[`Self::bridge_endpoints`] (same-host, operator-controlled ports\nfirst, then third-party/off-host bridges) before walking the\nexisting ordered-endpoint candidate set — no new dial-loop code,\njust a richer input to it."},"pq_mode":{"type":"string","description":"`quic_tunnels.pq_mode` — `hybrid` (`X25519MLKEM768` + classical) or\n`off` (classical only). Customer tunnels are `hybrid`."},"protocol":{"type":"string","description":"`servers.protocol` — always `\"quic\"` for this roster (F-CAP3).\nCarried so a multi-protocol dial planner never has to re-query."},"quic_mode":{"type":["string","null"],"description":"`servers.quic_mode` (`kernel` / `userspace`) — the operator-\npinned target mode (F-CAP3)."},"server_ed25519_public_key":{"type":"string","description":"`servers.ed25519_public_key` (base64-STANDARD) — the server identity\nthe client pins for the handshake. Non-NULL for QUIC servers by the\nschema `CHECK`."},"server_endpoint":{"type":"string","description":"`servers.endpoint` (`<ip>:<port>` or `<fqdn>:<port>`) — the UDP\naddress the client dials."},"server_id":{"type":"string","description":"`tunnels.server_id` (UUIDv7) — the QUIC server this tunnel lands on."},"tunnel_id":{"type":"string","description":"`tunnels.id` (UUIDv7) — the handle the daemon uses to identify this\ntunnel when reporting connection state."}}},"QuicClientProfilesListResponse":{"type":"object","description":"`GET /client/me/quic-profiles` response. Single-array envelope so future\nfields land additively without breaking clients parsing the array.","required":["profiles"],"properties":{"profiles":{"type":"array","items":{"$ref":"#/components/schemas/QuicClientProfileRead"},"description":"Active QUIC tunnels the calling device is allowed to dial, ordered by\n`tunnels.profile_number` for a stable display."}}},"QuicConfigRead":{"type":"object","description":"Response body for `GET /quic/tunnels/{id}/config`. The `config`\nfield contains the quictun-core TOML config (`[Client]` +\n`[[Server.Peer]]` blocks) ready to write to a `.toml` file and feed\nto the `appsynergy` client. The ed25519 private key IS included here\n(this is the only endpoint that surfaces it — the caller must\ntransport this securely). Returns `404` when the tunnel has no\nserver assignment.","required":["config","filename"],"properties":{"config":{"type":"string","description":"Full quictun-core config text (`[Client]` / `[[Server.Peer]]`\nTOML sections)."},"filename":{"type":"string","description":"Filename hint for the download dialog. Typically\n`\"appsynergy-<profile_name>.toml\"` or `\"appsynergy-<id>.toml\"`."}}},"QuicDetails":{"type":"object","description":"QUIC-specific fields nested inside [`QuicTunnelRead`] when\n`tunnel.type = 'quic'`. Absent (`null`) for WireGuard tunnels.\nThe `ed25519_private_key_ct` column of `quic_tunnels` is **never**\nincluded in any response — callers download the full quictun-core\nconfig (which contains the private key) via\n`GET /quic/tunnels/{id}/config`.","required":["ed25519_public_key","allocated_ip","allowed_ips","pq_mode"],"properties":{"allocated_ip":{"type":"string","description":"Internal IP allocated to this tunnel (`/32` within the QUIC\nserver's subnet). This is the `destination_ip` field in\nbindings — identical to the WireGuard case (bindings\ndo not care which extension table holds the per-protocol state)."},"allowed_ips":{"type":"array","items":{"type":"string"},"description":"Cryptokey-routing `allowed_ips` (the prefixes this peer may\nsend/receive inside the QUIC handshake). Stored as a JSON array\nin `quic_tunnels.allowed_ips`; exposed here as a string list."},"ed25519_public_key":{"type":"string","description":"Server-assigned ed25519 public key for this tunnel. The\nquictun-core identity uses SPKI = pubkey; base64-encoded\n32-byte ed25519 public key."},"last_handshake":{"type":["string","null"],"description":"RFC3339 timestamp of the last observed QUIC handshake.\n`null` when no handshake has been seen yet."},"persistent_keepalive_seconds":{"type":["integer","null"],"format":"int64","description":"Optional persistent-keepalive interval in seconds. `null` when\nkeepalive is disabled for this tunnel."},"platform":{"type":["string","null"],"description":"OS / platform tag set at tunnel creation (e.g. \"macos\", \"linux\",\n\"windows\", \"ios\", \"android\"). Free-form; stored as-is."},"pq_mode":{"type":"string","description":"Post-quantum hybrid KEM mode (`quic_tunnels.pq_mode`):\n`\"hybrid\"` (X25519MLKEM768, the default) or `\"off\"`."},"profile_name":{"type":["string","null"],"description":"Human-readable label for this tunnel (e.g. \"Home MacBook\").\nStored in `quic_tunnels.profile_name`."},"use_case":{"type":["string","null"],"description":"Usage-category tag set at tunnel creation (e.g. \"personal\",\n\"work\", \"gaming\"). Free-form; stored as-is."}}},"QuicDnsServerRef":{"type":"object","description":"Minimal reference to the DNS server assigned to a QUIC tunnel.\nNested inside [`QuicTunnelRead::dns_server`] when a `dns_assignments`\nrow scopes this tunnel or its parent subscription to a specific\nserver. Magic DNS resolves identically for QUIC and WireGuard\nclients (the resolver checks source IP against\n`quic_tunnels.allocated_ip` ∪ `wireguard_tunnels.allocated_ip`).\n\nProduct-local copy of the structurally identical vpn\n`DnsServerRef` — not a cross-product import.","required":["id","address"],"properties":{"address":{"type":"string","description":"Public IP address the DNS server listens on. This is the\nresolver address embedded in the generated quictun-core config."},"id":{"type":"string","description":"UUIDv7 primary key of the `dns_servers` row."}}},"QuicPeerRecord":{"type":"object","description":"One peer entry in the roster. Field set tracks the\n`quictun-core::Peer` record the agent installs; new\noptional fields can join without breaking deployed agents.","required":["tunnel_id","ed25519_public_key","allowed_ips","pq_mode"],"properties":{"allowed_ips":{"type":"array","items":{"type":"string"},"description":"CIDRs this peer is allowed to source/sink on the tunnel\n(cryptokey routing). Today this is the single\n`<allocated_ip>/32`; the per-tunnel `allowed_ips` JSON\ncolumn is the future expansion point."},"ed25519_public_key":{"type":"string","description":"The peer's ed25519 public key (also the peer's SPKI)."},"persistent_keepalive_seconds":{"type":["integer","null"],"format":"int64","description":"Optional keepalive interval the agent should advertise\nfor this peer. `None` means no keepalive (the default\nquictun behaviour)."},"pq_mode":{"type":"string","description":"PQ-KEM negotiation mode the agent should enforce for\nhandshakes against this peer (`\"hybrid\"` /\n`\"off\"`). Mirrors `quic_tunnels.pq_mode`."},"tunnel_id":{"type":"string","description":"The `tunnels.id` this peer entry maps to. The agent\ncarries it as engine peer metadata so its telemetry loop\ncan attribute observed byte counters to the right tunnel\nwhen posting `/quic_server/traffic` samples."}}},"QuicPeerStatus":{"type":"object","description":"One per-peer report from the QUIC agent.","required":["peer_pubkey_prefix"],"properties":{"bytes_in":{"type":["integer","null"],"format":"int64","description":"Absolute total bytes received by the server for this\npeer's tunnel since `current_endpoint` was last\nestablished. Informational — the canonical billing\ncounter is `bandwidth_quotas` (rolled by L-Q PR4)."},"bytes_out":{"type":["integer","null"],"format":"int64","description":"Absolute total bytes sent by the server for this peer."},"current_endpoint":{"type":["string","null"],"description":"The peer's currently observed remote endpoint\n(`host:port`). `None` if no peer is currently\nconnected."},"datagrams_in":{"type":["integer","null"],"format":"int64","description":"Cumulative QUIC datagrams received by the server for this\npeer's tunnel since `current_endpoint` was last\nestablished (one inner packet == one QUIC datagram per\nRFC 9221 packet-per-datagram framing). Pairs with\n`bytes_in` at datagram rather than byte granularity."},"datagrams_out":{"type":["integer","null"],"format":"int64","description":"Cumulative QUIC datagrams sent by the server for this\npeer. See `datagrams_in`."},"last_handshake_at":{"type":["string","null"],"format":"date-time","description":"RFC3339 UTC timestamp of the last observed handshake for\nthis peer. `None` means the agent has not yet observed\none this poll cycle (the column stays at its prior\nvalue)."},"packet_loss_pct":{"type":["number","null"],"format":"double","description":"Most recent packet-loss sample for this peer's QUIC\nconnection (percentage, `[0.0, 100.0]`). Same not-yet-\npopulated status as `rtt_ms`."},"peer_pubkey_prefix":{"type":"string","description":"First N hex characters of the peer's ed25519 public key,\ncase-sensitive. The handler matches via\n`LIKE <prefix>%` against `quic_tunnels.ed25519_public_key`\nfor tunnels on the caller's server. A prefix shorter than\n4 chars is too ambiguous to be useful and the validator\nrejects it (so 4 is the floor; longer is fine)."},"pq_negotiated":{"type":["boolean","null"],"description":"`true` iff the last handshake for this peer negotiated\nthe post-quantum hybrid KEM (`X25519MLKEM768`). `None`\nwhen the agent has not yet observed a handshake."},"rtt_ms":{"type":["integer","null"],"format":"int64","description":"Most recent RTT sample for this peer's QUIC connection, in\nmilliseconds. Not yet populated by any agent build —\nreserved for the endpoint-health / RTT-probe work tracked\nseparately. Bounded to a sane wire range regardless of\nproducer."},"streams_open":{"type":["integer","null"],"format":"int64","description":"Currently open QUIC streams on this peer's connection.\n`quictun-core`'s tunnel forwarding is datagram-only today\n(no stream-based control channel exists yet), so no agent\nbuild reports this field yet; `None` until one does."}}},"QuicServerConfig":{"type":"object","description":"`PATCH /platform/quic-servers/{id}/config` request body. Every\nfield optional (partial update, same convention as\n[`crate::platform::wg_server::platform_servers_write_types::PlatformServerUpdateRequest`]).\nDoes NOT carry the ed25519 identity (agent-reported only, via\n`POST /quic_server/identity`) or `expected_quictun_core_version`\n(owned by the generic fleet-agent admin endpoint,\n`PATCH /platform/agents/{id}`) — this endpoint's write authority is\nscoped to the columns only an operator sets.","properties":{"additional_ports":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"New set of extra UDP ports the agent binds as additional NATIVE\nlisteners alongside `servers.endpoint` (the server\nmulti-port bind / client port ladder). The canonical entry is\n`443`, so the QUIC session blends with ordinary HTTPS traffic on\nnetworks that block non-standard UDP ports. `None` leaves the\ncolumn unchanged; `Some(vec![])` clears it back to no extra\nports. Bounded to 8 entries here (garde); [`validate_ports`]\nadditionally rejects port `0` and duplicates, a constraint garde\nhas no per-element combinator for on a plain `Vec<u16>`."},"alpn_cutover_at":{"type":["string","null"],"description":"New ALPN dual-window cutover instant, RFC3339. Before\nthis time (or when unset) the agent's QUIC listener accepts BOTH\nthe current and legacy ALPN identifiers, so already-deployed\npre-cutover clients are never dropped mid-rollout. At/after this\ntime the listener accepts ONLY the current identifier, retiring\nthe legacy one. `None` leaves the column unchanged; `Some(\"\")`\nclears it back to unset (dual window open indefinitely) — same\npartial-update convention as [`Self::masque_listen_addr`].\nLength-bounded here (garde); [`validate_alpn_cutover_at`]\nadditionally rejects a non-RFC3339 value."},"alpn_set":{"type":["array","null"],"items":{"type":"string"},"description":"New ALPN identifier set advertised to clients on the profile\nwire (F-CAP1/3). `None` leaves the column unchanged. Element\ngrammar is enforced by\n[`super::server_capability::validate_alpn_set`] (allowlist of\nthe dual-window ALPNs); garde only bounds list length."},"masque_enabled":{"type":["boolean","null"],"description":"Toggle the dedicated MASQUE/CONNECT-IP listener\n(`vendor/quictun-core::server::BoundServer::with_masque_listener`).\nThe agent binds it alongside the native listener set on its own\n`masque_listen_addr`, feeding the same shared router/host\nbackend. `None` leaves the column unchanged."},"masque_listen_addr":{"type":["string","null"],"description":"New `host:port` the MASQUE listener binds — distinct from the\nnative `servers.endpoint`, since the two listeners run on\nseparate ports (dedicated-port discrimination, not ALPN\nmultiplexing). `None` leaves the column unchanged; `Some(\"\")`\nclears it back to unset."},"min_client_version":{"type":["integer","null"],"format":"int64","description":"New minimum client version code (F-CAP1/2): integer\nsemver `major*1_000_000 + minor*1_000 + patch`. Auto-assignment\nonly picks this server when the caller's version code is ≥ this\nfloor. `None` leaves the column unchanged; `Some(0)` clears the\nfloor (any client). Bounded here; the handler rejects negatives\nthat slip past garde via a non-negative range check."},"quic_listener_count":{"type":["integer","null"],"format":"int64","description":"New listener-set size — the number of `SO_REUSEPORT` UDP\nsockets the agent binds at the same address\n(`vendor/quictun-core::Server::bind_many`). `1` is a\nsingle listener (today's default); the upper bound of 16 mirrors\nthe schema `CHECK`. `None` leaves the column unchanged."},"quic_mode":{"type":["string","null"],"description":"New QUIC backend mode. The agent restarts its listener with the\nnew mode on its next config poll. `None` leaves the column\nunchanged."},"quic_obfuscation_enabled":{"type":["boolean","null"],"description":"Toggle the padding + timing-jitter traffic obfuscator\n(`vendor/quictun-core::obfs::PaddingObfuscator`) for this\nserver's sessions. `None` leaves the column unchanged."}},"additionalProperties":false},"QuicServerConfigResponse":{"type":"object","description":"Response body for `GET /quic_server/config`. Single shape\nthe agent reads; absent fields are not included (the\n`Option` ⇒ `serde(skip_serializing_if)` framing keeps the\nJSON tight without forcing every revision in lockstep).","required":["version","quic_mode","endpoint_listen_addr","masque_enabled"],"properties":{"additional_ports":{"type":"array","items":{"type":"integer","format":"int32","minimum":0},"description":"Extra UDP ports the agent binds as additional NATIVE listeners\nalongside [`Self::endpoint_listen_addr`] (the server\nmulti-port bind), each its own `quinn::Endpoint` feeding the\nSAME shared router/policy as the primary listener set\n(`vendor/quictun-core::server::BoundServer::with_additional_listener`).\nThe canonical entry is `443`, so the session blends with\nordinary HTTPS traffic on networks that block non-standard UDP\nports. `[]` when the operator has configured no extra ports —\ntoday's single-port behaviour, unaffected."},"alpn_cutover_at":{"type":["string","null"],"description":"ALPN dual-window cutover instant, RFC3339. `None` ⇒\nthe listener accepts BOTH the current and legacy ALPN identifiers\nindefinitely — the default until an operator sets a value. At/after\nthis instant the listener accepts ONLY the current identifier."},"endpoint_listen_addr":{"type":"string","description":"The QUIC endpoint the agent should bind / advertise\n(`host:port` form, as stored in `servers.endpoint`)."},"expected_quictun_core_version":{"type":["string","null"],"description":"The operator-pinned target version of the\n`quictun-core` engine the agent should be running.\n`None` until the operator sets one (the agent treats\n`None` as \"no target — keep current\")."},"masque_enabled":{"type":"boolean","description":"Whether the agent should bind the dedicated MASQUE/CONNECT-IP\nlistener alongside its native listener set, feeding\nthe same shared router/host backend. Binding also requires\n[`Self::masque_listen_addr`] to be set — `true` with no address\nis a no-op (fail-open, same posture as an unresolvable\n`endpoint_listen_addr`)."},"masque_listen_addr":{"type":["string","null"],"description":"The `host:port` the MASQUE listener binds — distinct from\n[`Self::endpoint_listen_addr`], since the two listeners run on\nseparate ports. `None` ⇒ the agent does not start the listener\nregardless of `masque_enabled`."},"pop_slug":{"type":["string","null"],"description":"The serving PoP/colo's human-readable handle\n(`points_of_presence.slug` via `servers.pop_id`).\nDisplay-only identity: the agent logs it at listener start but\nnever binds or routes off it, and it is deliberately EXCLUDED\nfrom the `version`/`ETag` digest — a PoP re-home must not flip\nthe version and restart the fleet's listeners (which would drop\nlive QUIC sessions). `None` when the server is not homed to a\nPoP."},"quic_mode":{"type":"string","description":"The operator-pinned QUIC backend mode (`\"kernel\"` /\n`\"userspace\"`). The agent restarts its listener with\nthe new mode on a change."},"version":{"type":"string","description":"Content-derived opaque version tag, byte-identical to\nthe `ETag` header on the same response. Stable while\nthe underlying config tuple is unchanged; flips the\nmoment any field below changes."}}},"QuicServerHeartbeatRequest":{"type":"object","description":"Request body for `POST /quic_server/heartbeat`. The agent's\n`agt_` bearer identifies the caller; the body carries only\nthe per-tick observable state. No `server_id` — identity is\nthe bearer hash alone, so cross-server isolation is\nstructural.","required":["reported_version"],"properties":{"backend_tier":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QuicBackendTier","description":"Which data-plane the server is currently driving\n(`kernel` / `userspace`). Optional so an older agent\nthat has not yet learned the field still successfully\nheartbeats."}]},"datagrams_in":{"type":["integer","null"],"format":"int64","description":"Cumulative datagrams received by the server since\nprocess start. Server-wide aggregate; per-tunnel rollup\nlives in `tunnel_traffic_samples` (L-Q PR4)."},"datagrams_out":{"type":["integer","null"],"format":"int64","description":"Cumulative datagrams sent by the server since process\nstart."},"handshakes_5min":{"type":["integer","null"],"format":"int64","description":"Count of completed QUIC handshakes observed in the\nprevious 5 min window. Informational telemetry."},"hostname":{"type":["string","null"],"description":"`gethostname()` at agent start, free-form. Stored only\ninside the rolling telemetry blob."},"hybrid_kem_negotiated_pct":{"type":["integer","null"],"format":"int64","description":"Percentage of handshakes in the previous 5 min window\nthat completed with the post-quantum hybrid KEM\n(`X25519MLKEM768`) negotiated. Field is `[0, 100]`\ninclusive; the dashboard renders a fleet-wide\nPQ-rollout indicator from this."},"peer_count":{"type":["integer","null"],"format":"int64","description":"Current count of `quictun-core::Peer` records the server\nis willing to accept. Read by the operator dashboard for\nthe per-server utilisation widget."},"reported_version":{"type":"string","description":"The `appsynergy-agent` build version the caller is\nrunning. Persisted to `servers.reported_version`."},"started_at":{"type":["string","null"],"format":"date-time","description":"RFC3339 UTC timestamp of when the agent process started."},"streams_open":{"type":["integer","null"],"format":"int64","description":"Currently open QUIC streams across all connections."}}},"QuicServerHeartbeatResponse":{"type":"object","description":"Response body for `POST /quic_server/heartbeat`. Single\nflag today — the agent does not need any payload back. The\nfuture config-version push happens via the sibling\n`/quic_server/config` long-poll surface (L-Q PR5).","required":["ok"],"properties":{"ok":{"type":"boolean","description":"`true` on a successful beat."}}},"QuicServerIdentityRequest":{"type":"object","description":"Request body: the agent's engine public key.","required":["ed25519_public_key"],"properties":{"ed25519_public_key":{"type":"string","description":"Standard base64 of the 32-byte ed25519 public key (43 chars +\none `=` pad) — the same encoding `quic_tunnels` peer keys and\nthe generated client config use, so the recorded value drops\nstraight into `PublicKey = \"…\"` lines."}}},"QuicServerIdentityResponse":{"type":"object","description":"Response: which server row recorded the key.","required":["server_id","updated"],"properties":{"server_id":{"type":"string","description":"The caller's `servers.id`."},"updated":{"type":"boolean","description":"`true` when the stored key changed (first report or rotation);\n`false` when the report matched what was already recorded."}}},"QuicServerPeerStatusRequest":{"type":"object","description":"Request body for `POST /quic_server/peer-status`. Batch of\nper-peer reports — per-peer acceptance is independent; one\nbad report does NOT block the rest.","required":["peers"],"properties":{"peers":{"type":"array","items":{"$ref":"#/components/schemas/QuicPeerStatus"},"description":"One or more per-peer reports. Validator recurses via\n`nested`."}}},"QuicServerPeerStatusResponse":{"type":"object","description":"Response body for `POST /quic_server/peer-status`.","required":["accepted_count","rejected_count","results"],"properties":{"accepted_count":{"type":"integer","format":"int64","description":"Total peers whose row was updated."},"rejected_count":{"type":"integer","format":"int64","description":"Total peers whose report was rejected per-peer."},"results":{"type":"array","items":{"$ref":"#/components/schemas/QuicServerPeerStatusResult"},"description":"Per-peer outcomes in request order."}}},"QuicServerPeerStatusResult":{"type":"object","description":"Per-peer outcome on the wire.","required":["peer_pubkey_prefix","accepted","code"],"properties":{"accepted":{"type":"boolean","description":"`true` when the matched `quic_tunnels` row was updated\nwith the report's fields."},"code":{"type":"string","description":"Stable rejection slug when `accepted == false`. Possible\nvalues: `\"peer_not_found\"` (no `quic_tunnels` row on the\ncaller's server matches the prefix); `\"ambiguous_prefix\"`\n(more than one row matches — the agent should re-send\nwith a longer prefix). Empty on acceptance."},"peer_pubkey_prefix":{"type":"string","description":"Echo of the input `peer_pubkey_prefix` so the agent can\ncorrelate without relying on positional order."}}},"QuicServerPeersResponse":{"type":"object","description":"Response body for `GET /quic_server/peers`. Flat list — no\ncursor pagination today (one server typically hosts\nO(100..1000) peers; if a server's roster ever exceeds that\nthis is the obvious place to add cursoring).","required":["peers"],"properties":{"peers":{"type":"array","items":{"$ref":"#/components/schemas/QuicPeerRecord"},"description":"Peers in stable order (sorted by `tunnel_id`) so the\nagent's `PeerStore::replace()` sees byte-identical input\non a no-op re-fetch and skips the swap."}}},"QuicServerResponse":{"type":"object","description":"`GET`/`PATCH /platform/quic-servers/{id}/config` response body.\nOperator-mutable fields plus two read-only fields surfaced for\nvisibility: the agent-reported ed25519 identity and the fleet\nagent's pinned `expected_quictun_core_version` (both owned\nelsewhere — see [`QuicServerConfig`]'s doc comment).","required":["id","name","endpoint","quic_listener_count","quic_obfuscation_enabled","masque_enabled","additional_ports","min_client_version","alpn_set","mode_mismatch","version","updated_at"],"properties":{"additional_ports":{"type":"array","items":{"type":"integer","format":"int32","minimum":0},"description":"Extra UDP ports the agent binds as additional NATIVE listeners\nalongside `endpoint` (the server multi-port bind / client\nport ladder). `[]` when unset — today's single-port behaviour."},"alpn_cutover_at":{"type":["string","null"],"description":"ALPN dual-window cutover instant, RFC3339. `None` ⇒\nthe dual window stays open indefinitely — both ALPN identifiers\naccepted, the default until an operator sets a value."},"alpn_set":{"type":"array","items":{"type":"string"},"description":"ALPN identifiers this server advertises to clients (F-CAP1/3)."},"backend_tier":{"type":["string","null"],"description":"Agent-observed data-plane tier (`kernel` / `userspace` /\n`other`); `None` until the first heartbeat that reports it.\nRead-only — written by `POST /quic_server/heartbeat`, not by\nthis PATCH (operators set the target `quic_mode`; the\nagent reports the observed tier)."},"ed25519_public_key":{"type":["string","null"],"description":"Read-only: the agent-reported ed25519 public key\n(`POST /quic_server/identity`). `None` before the agent's\nfirst identity report."},"endpoint":{"type":"string","description":"The QUIC endpoint this server binds/advertises (`host:port`)."},"expected_quictun_core_version":{"type":["string","null"],"description":"Read-only: the fleet agent's operator-pinned target\n`quictun-core` version (`agents.expected_version`, set via\n`PATCH /platform/agents/{id}`). `None` when unset."},"id":{"type":"string","description":"The `servers.id` this config belongs to."},"masque_enabled":{"type":"boolean","description":"Whether the dedicated MASQUE/CONNECT-IP listener is enabled."},"masque_listen_addr":{"type":["string","null"],"description":"The `host:port` the MASQUE listener binds. `None` when unset —\nthe agent does not start the listener regardless of\n`masque_enabled` until an operator also sets this."},"min_client_version":{"type":"integer","format":"int64","description":"Minimum client version code required for provisioning onto this\nserver (F-CAP1/2). `0` = any client."},"mode_mismatch":{"type":"boolean","description":"Read-only, derived: `true` when [`Self::quic_mode`] (the\noperator's target) and [`Self::backend_tier`] (the\nagent-observed tier) are both known and disagree — the\noperator-visible signal that a `kernel`-pinned server is\nactually serving the userspace fallback ([`quic_mode_mismatch`]).\nLike `backend_tier`, this rides outside the `version`/ETag\ndigest (the digest covers only operator-mutable fields), so a\nconditional GET with a matching `If-None-Match` will 304 across\nan observed-tier flip; the topology map is the live-poll surface\nthat catches the flip without cache interference."},"name":{"type":"string","description":"Display name, for admin-UI context."},"quic_listener_count":{"type":"integer","format":"int64","description":"Current listener-set size."},"quic_mode":{"type":["string","null"],"description":"Current QUIC backend mode (`\"kernel\"` / `\"userspace\"`); `None`\nonly transiently, before the server's first config write."},"quic_obfuscation_enabled":{"type":"boolean","description":"Whether the padding + timing-jitter obfuscator is enabled."},"updated_at":{"type":"string","description":"Row `updated_at`, RFC3339."},"version":{"type":"string","description":"Content-derived opaque version tag, byte-identical to the\n`ETag` header on the same response. Stable while the\noperator-mutable tuple `(quic_mode, quic_listener_count,\nquic_obfuscation_enabled, masque_enabled, masque_listen_addr,\nadditional_ports, alpn_cutover_at, min_client_version, alpn_set)`\nis unchanged."}}},"QuicServerTrafficRequest":{"type":"object","description":"Request body for `POST /quic_server/traffic`. Batch of\nsamples — every sample commits atomically with the others,\nper-sample acceptance is independent (a bad\nsample does NOT block the rest).","required":["samples"],"properties":{"samples":{"type":"array","items":{"$ref":"#/components/schemas/QuicServerTrafficSample"},"description":"One or more samples to ingest. Validator recurses into\neach via `nested`."}}},"QuicServerTrafficResponse":{"type":"object","description":"Response body for `POST /quic_server/traffic`. Per-sample\noutcomes plus aggregate counters.","required":["accepted_count","rejected_count","results"],"properties":{"accepted_count":{"type":"integer","format":"int64","description":"Total samples accepted (upserted + quota-applied)."},"rejected_count":{"type":"integer","format":"int64","description":"Total samples rejected. Sum of accepted + rejected\nequals `samples.len()`."},"results":{"type":"array","items":{"$ref":"#/components/schemas/QuicServerTrafficSampleResult"},"description":"Per-sample outcomes in request order."}}},"QuicServerTrafficSample":{"type":"object","description":"One per-tunnel QUIC sample. Same field shape the WG\nsurface uses; `protocol` is forced to `'quic'` server-side\nregardless of what the agent puts here (the agent has no\nsay in which protocol bucket the sample lands in, by\ndesign).","required":["tunnel_id","period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Absolute total bytes received by the server in the\nwindow for this tunnel. Counters are `>= 0`."},"bytes_out":{"type":"integer","format":"int64","description":"Absolute total bytes sent by the server in the window\nfor this tunnel."},"dest_cidr":{"type":["string","null"],"description":"Optional destination CIDR. Format-validated on length\nonly; opaque to the rest of the schema."},"period_end":{"type":"string","description":"RFC3339 UTC timestamp of the window end. Must be\n`>= period_start`."},"period_start":{"type":"string","description":"RFC3339 UTC timestamp of the window start."},"tunnel_id":{"type":"string","description":"`tunnels.id` (UUIDv7) the sample belongs to. Rejected\nper-sample if the tunnel is not hosted on the caller's\nQUIC server."}}},"QuicServerTrafficSampleResult":{"type":"object","description":"Per-sample outcome on the wire. Codes mirror the WG\nsurface's enum: `invalid_window`, `tunnel_not_found`,\n`tunnel_not_owned_by_caller`.","required":["tunnel_id","period_start","accepted","code"],"properties":{"accepted":{"type":"boolean","description":"`true` when the sample was upserted into\n`tunnel_traffic_samples` and any subscription delta was\napplied."},"code":{"type":"string","description":"Stable rejection slug when `accepted == false`. Empty\non acceptance."},"period_start":{"type":"string","description":"Echo of the input sample's `period_start`."},"tunnel_id":{"type":"string","description":"Echo of the input sample's `tunnel_id`."}}},"QuicTunnelCreateRequest":{"type":"object","description":"Request body for `POST /quic/tunnels`. The server generates the\ned25519 key pair, allocates an internal IP, and creates both the\n`tunnels` and `quic_tunnels` rows inside one transaction.\nThe capacity check uses the same plan-allowance formula as the vpn\ncreate path; a single subscription's `profile_count` is shared\nbetween WireGuard and QUIC tunnels. The endpoint returns\n`403 (beta_not_enabled)` unless `orgs.beta_features.quic = true`.","required":["subscription_id"],"properties":{"client_version":{"type":["string","null"],"description":"Optional client binary version (F-CAP2). Encoded to an\ninteger version code and compared against\n`servers.min_client_version` at the provisioning assignment site\nso a mixed fleet never strands an older client on a server that\nrequires a newer dial stack. Absent ⇒ version code `0` (only\nservers with `min_client_version = 0` are eligible for auto-pick;\nan explicit `server_id` with a higher floor returns 400\n`server_requires_newer_client`)."},"device_ed25519_public_key":{"type":["string","null"],"description":"Device-generated ed25519 public key (base64-STANDARD, 44 chars) for\nclient-side key custody: the device holds its own private seed and\nregisters only this public key, so the control plane stores it with\n`ed25519_private_key_ct = NULL` (the AWS device-key model, migration\n0220 — the private key never transits the wire nor lives server-side).\nWhen absent the control plane server-generates and AEAD-seals the\nidentity (server-to-server custody, unchanged). The handler decodes it\nand rejects anything that is not exactly 32 bytes with 400\n`invalid_device_public_key`."},"path_tier_id":{"type":["string","null"],"description":"Optional network-path tier the customer intends to use for this\ntunnel. Same fail-fast eligibility contract as the vpn\ncreate path: a bare QUIC tunnel has no `bindings` row, so nothing\nis persisted here; the durable per-binding tier selection happens\nat `POST /static-ips/{id}/bind` and `PATCH /static-ips/{id}`.\nValidated as a UUIDv7 in the handler (mirrors `subscription_id` /\n`server_id`)."},"platform":{"type":["string","null"],"description":"OS / platform tag (e.g. \"macos\", \"linux\", \"windows\", \"ios\",\n\"android\"). Max 64 characters; free-form."},"preset_slug":{"type":["string","null"],"description":"Optional preset slug (the customer-facing 5-button picker).\nMutually exclusive with `path_tier_id` (both present ⇒\n400 `tier_and_preset_exclusive`). Fail-fast eligibility gate only;\nthe durable preset selection happens at binding creation. Slug\nlookup is in the handler."},"profile_name":{"type":["string","null"],"description":"Human-readable label for this tunnel (e.g. \"Work Laptop\").\nMax 128 characters. Stored in `quic_tunnels.profile_name`."},"routed_cidrs":{"type":["array","null"],"items":{"type":"string"},"description":"Optional split-tunnel route set: the CIDRs the client routes into\nthe tunnel. Absent or empty ⇒ full-tunnel (`[\"0.0.0.0/0\"]`,\nmirroring the WireGuard default in `products::vpn::tunnels_config`),\nso all traffic transits the tunnel and a bound static IP governs\negress. When non-empty, only these CIDRs route through the tunnel\n(split-tunnel) and the rest uses the host's normal link. Each entry\nis validated as an `ip/prefix` CIDR in the handler (400\n`invalid_routed_cidr`); capped at 64 entries."},"server_id":{"type":["string","null"],"description":"QUIC server to provision on. When absent, the handler picks the\nlowest-load `protocol = 'quic'` server eligible for the\nsubscription's plan. Must be `status = 'online'` and\n`protocol = 'quic'` if specified."},"subscription_id":{"type":"string","description":"Subscription to create the tunnel under. Must be owned by the\ncaller's org. Capacity (`plan.profile_count + active tunnel\naddons`) counts WireGuard and QUIC tunnels together."},"use_case":{"type":["string","null"],"description":"Usage-category tag (e.g. \"personal\", \"work\"). Max 64 characters;\nfree-form."}}},"QuicTunnelDeleteResponse":{"type":"object","description":"Response body for `DELETE /quic/tunnels/{id}`. Returns `{ ok: true }`\non success (mirrors the vpn delete pattern). Any active binding is\nsoft-transitioned to `removing` (the routing agent will remove the\nnft rule); the bound public IP remains `status = 'reserved'` until\nexplicitly released.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the 200 success path."}}},"QuicTunnelListResponse":{"type":"object","description":"Response body for `GET /quic/tunnels`.","required":["tunnels"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor token for the next page. `null` when this is the\nlast page."},"tunnels":{"type":"array","items":{"$ref":"#/components/schemas/QuicTunnelRead"},"description":"Page of QUIC tunnel records, ordered by `created_at DESC,\nid DESC`."}}},"QuicTunnelQrRead":{"type":"object","description":"Response body for `GET /quic/tunnels/{id}/qr`. A PNG image of the\nquictun-core config encoded as a QR code, base64-encoded for JSON\ntransport. The caller can render it as `<img src=\"data:image/png;\nbase64,<png_base64>\">`.","required":["png_base64"],"properties":{"png_base64":{"type":"string","description":"Base64-standard-encoded PNG image of the quictun-core config QR\ncode."}}},"QuicTunnelRead":{"type":"object","description":"Wire response for `GET /quic/tunnels` (list items) and\n`GET /quic/tunnels/{id}` (single fetch). Mirrors the JOIN of\n`tunnels` + `quic_tunnels` + an optional active-binding lookup for\nthe bound public IP + an optional `dns_assignments` lookup for the\nassigned DNS server. Field-for-field parallel to the vpn\n`TunnelRead`, with [`QuicDetails`] in place of `WireguardDetails`.","required":["id","org_id","subscription_id","tunnel_type","profile_number","status","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation timestamp."},"dns_server":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QuicDnsServerRef","description":"DNS server assigned to this tunnel (most specific) or its parent\nsubscription (less specific). `null` when both are unset and the\ntunnel uses the system-default resolver."}]},"id":{"type":"string","description":"UUIDv7 primary key (`tunnels.id`)."},"org_id":{"type":"string","description":"Owning org (`tunnels.org_id`)."},"profile_number":{"type":"integer","format":"int64","description":"Monotonically increasing slot index within the subscription\n(`tunnels.profile_number`). Unique per subscription, shared\nacross WireGuard and QUIC tunnels of the same subscription."},"public_ip":{"type":["string","null"],"description":"Currently bound public IP address. `null` when no active binding\nexists (the tunnel is unbound or the binding is still `pending`)."},"quic":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/QuicDetails","description":"QUIC-specific fields. `null` for WireGuard tunnels (never the\ncase for rows returned by this area, but the shape is symmetric\nwith the vpn read so generic clients can treat both uniformly)."}]},"server_id":{"type":["string","null"],"description":"QUIC server this tunnel is provisioned on (`tunnels.server_id`).\n`null` when the server row was deleted (ON DELETE SET NULL)."},"status":{"type":"string","description":"Lifecycle status (`tunnels.status`). Values:\n`\"active\"`, `\"inactive\"`, `\"pending\"`."},"subscription_id":{"type":"string","description":"Parent subscription (`tunnels.subscription_id`)."},"tunnel_type":{"type":"string","description":"Tunnel protocol (`tunnels.type`). Always `\"quic\"` for rows\nreturned by this area."},"updated_at":{"type":"string","description":"RFC3339 last-updated timestamp."}}},"QuicTunnelRegenerateResponse":{"type":"object","description":"Response body for `POST /quic/tunnels/{id}/regenerate`. Returns the\nnew ed25519 public key and the (unchanged) allocated IP so the\ncaller can re-download the config or display the new public key\nwithout a separate GET.","required":["id","ed25519_public_key","allocated_ip"],"properties":{"allocated_ip":{"type":"string","description":"Internal IP (unchanged by regeneration — the IP stays\nallocated)."},"ed25519_public_key":{"type":"string","description":"New ed25519 public key after key rotation."},"id":{"type":"string","description":"UUIDv7 id of the tunnel (echoed for correlation)."}}},"QuicTunnelUsageHistoryItem":{"type":"object","description":"One daily bucket in `GET /quic/tunnels/{id}/usage/history`.\nSourced from `tunnel_traffic_samples` rows for this tunnel,\nordered by `period_start DESC`.","required":["period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Bytes received in this period."},"bytes_out":{"type":"integer","format":"int64","description":"Bytes sent in this period."},"period_end":{"type":"string","description":"RFC3339 end of this sample period."},"period_start":{"type":"string","description":"RFC3339 start of this sample period."}}},"QuicTunnelUsageHistoryResponse":{"type":"object","description":"Response body for `GET /quic/tunnels/{id}/usage/history`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/QuicTunnelUsageHistoryItem"},"description":"Ordered by `period_start DESC` (newest first)."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."}}},"QuicTunnelUsageRead":{"type":"object","description":"Response body for `GET /quic/tunnels/{id}/usage`. Returns the\ncurrent-period byte counters for this tunnel plus the parent\nsubscription's monthly cap for context. Same shape as the vpn\nper-tunnel usage read.","required":["period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Bytes received by the tunnel in the current period\n(`tunnel_traffic_samples.bytes_in` sum)."},"bytes_out":{"type":"integer","format":"int64","description":"Bytes sent by the tunnel in the current period\n(`tunnel_traffic_samples.bytes_out` sum)."},"period_end":{"type":"string","description":"RFC3339 end of the active quota period."},"period_start":{"type":"string","description":"RFC3339 start of the active quota period."},"subscription_monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"Subscription-level monthly cap from `bandwidth_quotas\n.monthly_limit_bytes`. `null` means unlimited."}}},"RecentAddress":{"type":"object","description":"One address an account used recently.","required":["address","last_seen"],"properties":{"address":{"type":"string","description":"The address."},"last_seen":{"type":"string","description":"RFC3339 instant it was last seen."}}},"RecordCreateRequest":{"type":"object","description":"Request body for `POST /dns/zones/{zone_id}/records`.","required":["name","record_type","value"],"properties":{"name":{"type":"string","description":"Record name relative to the zone apex; `@` for apex."},"port":{"type":["integer","null"],"format":"int64","description":"Optional port (SRV only; 0..65535)."},"priority":{"type":["integer","null"],"format":"int64","description":"Optional priority (MX / SRV only)."},"record_type":{"type":"string","description":"DNS record type — must be one of the canonical types accepted by\nthe `dns_records.record_type` CHECK constraint."},"ttl":{"type":["integer","null"],"format":"int64","description":"Optional TTL in seconds. Defaults to the zone's `minimum_ttl`."},"value":{"type":"string","description":"Record rdata as a string. The exact format is record-type\ndependent and not validated here beyond a length cap."},"weight":{"type":["integer","null"],"format":"int64","description":"Optional weight (SRV only)."}}},"RecordDeleteResponse":{"type":"object","description":"Response body for `DELETE /dns/zones/{zone_id}/records/{record_id}`.\nMirrors the [`super::zone_types::ZoneDeleteResponse`] precedent and\ncarries the deleted row's id so audit log readers can confirm which\nrecord went away.","required":["id"],"properties":{"id":{"type":"string","description":"The UUIDv7 of the record that was deleted."}}},"RecordListResponse":{"type":"object","description":"`GET /dns/zones/{zone_id}/records` response envelope. Cursor\npagination.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RecordRead"},"description":"Records in the requested zone (and only that zone), ordered\n`(created_at DESC, id DESC)`."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url cursor for the next page; `null` on the last page."}}},"RecordPatchRequest":{"type":"object","description":"Request body for `PATCH /dns/zones/{zone_id}/records/{record_id}`.\nAll fields are optional; only provided fields are updated.","properties":{"name":{"type":["string","null"],"description":"New record name relative to the zone apex."},"port":{"type":["integer","null"],"format":"int64","description":"New port (SRV; 0..65535)."},"priority":{"type":["integer","null"],"format":"int64","description":"New priority (MX / SRV)."},"record_type":{"type":["string","null"],"description":"New DNS record type."},"ttl":{"type":["integer","null"],"format":"int64","description":"New TTL in seconds."},"value":{"type":["string","null"],"description":"New record rdata."},"weight":{"type":["integer","null"],"format":"int64","description":"New weight (SRV)."}}},"RecordRead":{"type":"object","description":"Single `dns_records` row projected to the wire.","required":["id","zone_id","name","record_type","value","ttl","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp."},"id":{"type":"string","description":"UUIDv7 primary key (`dns_records.id`)."},"name":{"type":"string","description":"Record name relative to the zone apex; `@` for apex."},"port":{"type":["integer","null"],"format":"int64","description":"Optional port (SRV only; 0..65535)."},"priority":{"type":["integer","null"],"format":"int64","description":"Optional priority (MX / SRV only)."},"record_type":{"type":"string","description":"DNS record type — one of `A`, `AAAA`, `CNAME`, `MX`, `TXT`, `SRV`,\n`NS`, `SOA`, `CAA`, `PTR`, `ALIAS`."},"ttl":{"type":"integer","format":"int64","description":"Record TTL in seconds."},"updated_at":{"type":"string","description":"RFC3339 UTC last-update timestamp."},"value":{"type":"string","description":"Record rdata as a string. The exact format is record-type dependent."},"weight":{"type":["integer","null"],"format":"int64","description":"Optional weight (SRV only)."},"zone_id":{"type":"string","description":"Owning zone (`dns_records.zone_id`)."}}},"RecoveryCodesGenerateResponse":{"type":"object","description":"Response for `POST /auth/2fa/recovery-codes` — the freshly minted\nplaintext set, shown to the user exactly once. No read endpoint ever\nreturns these again.","required":["codes"],"properties":{"codes":{"type":"array","items":{"type":"string"},"description":"The plaintext codes, in generation order. Display once; only\ntheir hashes are persisted."}}},"RecoveryCodesStatusResponse":{"type":"object","description":"Response for `GET /auth/2fa/recovery-codes` — counts only, never the\ncodes themselves.","required":["total","remaining"],"properties":{"remaining":{"type":"integer","format":"int64","description":"Codes still usable (`used_at IS NULL`)."},"total":{"type":"integer","format":"int64","description":"Total codes in the current set (used + unused). `0` ⇒ the user\nhas never generated a set."}}},"RecoveryLoginRequest":{"type":"object","description":"Request for `POST /auth/2fa/recovery` — complete a TOTP-gated login\nwith a backup code instead of a TOTP code. `challenge_id` is the\nsame one-shot continuation `/auth/verify_magic_link` issued.","required":["challenge_id","recovery_code"],"properties":{"challenge_id":{"type":"string","description":"The `totp_challenges.id` handed back by `/auth/verify_magic_link`."},"recovery_code":{"type":"string","description":"A previously-issued recovery code. Whitespace / case are\nnormalised before comparison."}}},"Refusal":{"type":"object","description":"Something that must be settled before the account can be deleted.","required":["kind","count","waivable","waived"],"properties":{"count":{"type":"integer","format":"int64","description":"How many."},"kind":{"type":"string","description":"`platform_role` (the account is staff: another admin removes the\nrole first), `unpaid_invoices`, `pending_payments` (a crypto\npayment in flight)."},"waivable":{"type":"boolean","description":"Staff deleting for fraud, or removing spam or abuse, may go ahead:\nan unpaid balance is written off, a payment in flight is left to\nstaff."},"waived":{"type":"boolean","description":"Waived for the deletion being made."}}},"RemovedBindingRead":{"type":"object","description":"One pending-removal binding row the agent must remove from its\nlocal nft `appsynergy` table. The handler joins\n`bindings`–`public_ips` so the agent receives the resolved\n`public_ip` address rather than just the foreign-key id.\n\nField set is intentionally narrower than: the agent's\nremove path keys on `(public_ip, destination_ip, rule_type,\ndest_ports)` to find the matching nft rule and delete it. The\nschema's `priority`, `routing_server_id`, `created_at`,\n`applied_at`, `removed_at`, `last_error` are not surfaced because\nthe agent does not need them to delete the rule — and surfacing\nextras would dilute the tuple contract.","required":["id","public_ip","destination_ip","rule_type"],"properties":{"dest_ports":{"type":["string","null"],"description":"Port-forward subset, per the 0012 schema. `None` ⇒ the\nbinding forwarded the whole public IP; `Some(s)` ⇒ the\nrule was scoped to the protocol/port list `s` (e.g.\n`tcp/80,443`). The agent's remove path must distinguish\nthese cases so the nft rule it deletes matches the rule\nit applied — a remove that ignores `dest_ports` would\neither fail to find the rule (when the apply scoped it)\nor yank a sibling rule (when the apply was full-IP and a\nport-scoped sibling exists for the same public IP)."},"destination_ip":{"type":"string","description":"Internal target the binding forwarded to. Stored directly\non `bindings.destination_ip`. The other half of the tuple\nthe PATCH validates."},"id":{"type":"string","description":"Binding row id. The agent feeds this back through the\n`PATCH /router/bindings/{id}/status` when reporting that\nthe removal completed (or failed)."},"public_ip":{"type":"string","description":"Public-facing IP the binding routed. Resolved from the\n`public_ips.ip_address` column via JOIN. Half of the\n`(key, value)` tuple the PATCH validates."},"rule_type":{"$ref":"#/components/schemas/RouterRuleType","description":"Rule kind. Mirrors the `bindings.rule_type` CHECK\nconstraint via the shared [`RouterRuleType`] enum. Tells\nthe agent which nft chain (DNAT, SNAT, or both) the rule\nlives in."}}},"RemovedBindingsResponse":{"type":"object","description":"Response shape for `GET /router/bindings/removed`. The\n`bindings` array is `[]` when no removals are pending for the\nauth'd agent (the steady-state case once the queue has been\ndrained).\n\n`server_time` is a server-derived \"now\" so the agent's drift\nmetrics can use a clock that is consistent with the API's view\nof time (mirrors the heartbeat / pending / active\ncontracts).","required":["bindings","server_time"],"properties":{"bindings":{"type":"array","items":{"$ref":"#/components/schemas/RemovedBindingRead"},"description":"Zero or more pending-removal binding rows scoped to the\nauth'd agent's `routing_servers` ownership. Order is\nstable — `(id ASC)` — so a future ETag layer (or\nagent-side dedupe) can rely on a deterministic frame."},"server_time":{"type":"string","format":"date-time","description":"Server-derived \"now\" for the agent's drift / latency\nmetrics. RFC3339 wire form."}}},"RequestOutcome":{"type":"object","description":"`POST /auth/me/elevation` outcome.","required":["offered","expires_at"],"properties":{"expires_at":{"type":"string","description":"When the request lapses."},"offered":{"type":"array","items":{"type":"string"},"description":"What the sign-in page offers: `passkey`, `email`."}}},"ResetSignInResponse":{"type":"object","description":"`POST /platform/users/{id}/reset-sign-in` response: what was on.","required":["ok","passkey_only_was_on","two_factor_was_on","revoked_sessions"],"properties":{"ok":{"type":"boolean","description":"Always `true` on success."},"passkey_only_was_on":{"type":"boolean","description":"Passkey-only sign-in was on and is now off."},"revoked_sessions":{"type":"integer","format":"int64","description":"Sessions signed out."},"two_factor_was_on":{"type":"boolean","description":"An authenticator enrollment existed and was removed."}}},"ResourceCount":{"type":"object","description":"How many of one kind of resource are deleted with the account.","required":["kind","count"],"properties":{"count":{"type":"integer","format":"int64","description":"How many."},"kind":{"type":"string","description":"`tunnels`, `public_ips`, `public_ip6s`, `dns_zones`,\n`mesh_bridges`, `devices`, `service_accounts`, `api_tokens`,\n`webhooks`."}}},"ResourceGrantListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/grants`. A bare\nobject with a single `grants` array — keeps the door open to add\nenvelope-level fields (`total`, `has_more`, future cursor) without\nbreaking clients that already parse the array shape, mirroring\n`OrgCustomRoleListResponse` / `OrgMemberListResponse` /\n`ApiTokenListResponse`. Each item reuses [`ResourceGrantSummary`]\nso a future schema addition cannot drift the list shape away from\nthe per-row projection.","required":["grants"],"properties":{"grants":{"type":"array","items":{"$ref":"#/components/schemas/ResourceGrantSummary"},"description":"Resource grants defined within the resolved org, ordered by\n`(created_at DESC, id DESC)` — newest first, with the `id DESC`\ntie-breaker keeping rows ordered when two seeds land in the\nsame RFC3339 second."}}},"ResourceGrantSummary":{"type":"object","description":"Per-row summary projected by `GET /iam/orgs/{org_id}/grants`\n(the foundation slice). One row per `resource_grants`\ntable entry, scoped to the path-resolved org.\n\n`granted_actions` is the role's bounded action set, decoded from the\nrow's JSON-encoded `TEXT` column at read time. `expires_at` carries\nthe optional grant-expiry timestamp; the column is NULL when the\ngrant is open-ended, surfaced as `None` (and `null` on the wire).","required":["id","principal_id","principal_kind","org_id","resource_kind","resource_id","granted_actions","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 timestamp the row was created (matches\n`resource_grants.created_at`)."},"expires_at":{"type":["string","null"],"description":"RFC3339 timestamp at which the grant stops being effective.\n`None` (and `null` on the wire) when the grant is open-ended;\nthe resolver extension treats a row whose `expires_at` is in\nthe past as absent, and the TTL housekeeping path prunes\nexpired rows alongside the audit / sessions / idempotency\nprunes."},"granted_actions":{"type":"array","items":{"type":"string"},"description":"Action slugs this grant carries, decoded from\n`resource_grants.granted_actions` (JSON-encoded TEXT). Each\nentry is a known catalog slug — the create handler validates\nmembership against `appsynergy_iam_types::is_known_action`\nbefore insert."},"id":{"type":"string","description":"UUIDv7 identifier of the grant row (matches `resource_grants.id`).\nStable across the row's lifetime."},"org_id":{"type":"string","description":"UUIDv7 of the owning org (matches `resource_grants.org_id`).\nConstant across the row's lifetime — grants cannot move between\norgs."},"principal_id":{"type":"string","description":"UUID of the principal the grant is bound to. Polymorphic by\ndesign — matches `users.id` OR `service_accounts.id` OR\n`api_tokens.id`; the [`ResourceGrantSummary::principal_kind`]\nfield is the discriminator."},"principal_kind":{"type":"string","description":"Discriminator for [`ResourceGrantSummary::principal_id`]. One of\n`user`, `service_account`, `api_token` — the same set as the\nschema-level `CHECK (principal_kind IN (...))` constraint."},"resource_id":{"type":"string","description":"UUID of the resource the grant covers. The schema carries no FK\nbecause `resource_kind` decides which product schema this id\npoints at; the resolver extension does the per-kind lookup at\nrequest time."},"resource_kind":{"type":"string","description":"Discriminator for [`ResourceGrantSummary::resource_id`]. One of\n`subscription`, `tunnel`, `public_ip`, `binding`, `dns_zone` —\nthe same set as the schema-level `CHECK (resource_kind IN\n(...))` constraint."}}},"RestoreUserResponse":{"type":"object","description":"`POST /platform/users/{id}/restore` response.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on success."}}},"RevokeSessionsRequest":{"type":"object","description":"Body of `POST /platform/users/{id}/sessions/revoke`.","properties":{"session_id":{"type":["string","null"],"description":"One session; absent = every session."}}},"RevokedCount":{"type":"object","description":"Count of things revoked.","required":["revoked"],"properties":{"revoked":{"type":"integer","format":"int64","description":"How many."}}},"RouterRuleType":{"type":"string","description":"Permitted rule kinds the binary will ever ask the routing agent\nto apply. Mirrors the `bindings.rule_type` CHECK constraint\nfrom migration 0006 `0006_routing_agent_init.sql:56` 1:1. Each\nvariant `serde(rename)`s to its lowercase string so the wire\nround-trips through the column's stored form without an\nint-cast.\n\nWire tokens are pinned by the matching test sibling.\n\n`'both'` is the legacy 1:1 routed-IP behaviour (DNAT + SNAT +\nforward exception). `'dnat'` is one-way inbound (DNAT + forward\nexception only; egress traffic from the internal IP comes out\nthe routing server's own IP, not the bound public IP).\n`'snat'` is egress branding (the internal IP is reachable via\nDNAT through some other mechanism, but its egress should appear\nfrom the bound public IP). Lines 929-933 capture the\nsemantics in full.","enum":["dnat","snat","both"]},"SamlCallbackForm":{"type":"object","description":"Form-urlencoded body the IdP `POST`s to the ACS URL (SAML2 §3.5).","properties":{"RelayState":{"type":["string","null"],"description":"CSRF token; primary key into `sso_saml_states`."},"SAMLResponse":{"type":["string","null"],"description":"Base64-encoded `<samlp:Response>` XML."}}},"ScheduledPlanChange":{"type":"object","description":"A plan change waiting for the end of the period.","required":["plan_id","billing_cycle","effective_at"],"properties":{"billing_cycle":{"type":"string","description":"The cycle it moves to."},"effective_at":{"type":"string","description":"RFC3339 UTC time the change takes effect."},"plan_id":{"type":"string","description":"The plan the subscription moves to."}}},"SecretPresence":{"type":"string","description":"Marker for a never-echoed secret on the wire. Surfaces the\npresence (or absence) of a stored secret without leaking its\nplaintext. The literal-token JSON form is\n(`\"<set>\"` / `\"<unset>\"`) so the serde renames carry that shape\nregardless of the variant name in code.\n\nThe GET handler and the PATCH handler both map column\nNULL-ness to this enum: `Set` when the underlying BLOB column\n(`secret_key_ct` / `webhook_secret_ct`) is non-NULL, `Unset`\notherwise. Neither handler reads the ciphertext to construct\nthe marker; the BLOB stays at rest.","enum":["<set>","<unset>"]},"SecurityEvent":{"type":"object","description":"One recent security event from the audit log.","required":["ts","action","metadata"],"properties":{"action":{"type":"string","description":"Audit action."},"metadata":{"type":"string","description":"Audit metadata (JSON)."},"ts":{"type":"string","description":"RFC3339 instant."}}},"SecurityGroupAttachmentRead":{"type":"object","description":"One attachment as read.","required":["id","interface_kind","interface_id","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339."},"id":{"type":"string","description":"UUIDv7."},"interface_id":{"type":"string","description":"The interface's id."},"interface_kind":{"type":"string","description":"`\"public_ip\" | \"binding\"`."}}},"SecurityGroupCreate":{"type":"object","description":"Request DTO.","required":["name"],"properties":{"description":{"type":"string","description":"Free text; defaults to empty."},"name":{"type":"string","description":"Unique within the owner scope."},"owner_org_id":{"type":["string","null"],"description":"Required when `owner_scope = \"org\"`, forbidden otherwise."},"owner_scope":{"type":["string","null"],"description":"`\"platform\"` (default) or `\"org\"`."}}},"SecurityGroupDeleteResponse":{"type":"object","description":"Response body for a group delete — the id echoed back, so a client that\nbatched several can tell which one this answered.","required":["id","deleted"],"properties":{"deleted":{"type":"boolean","description":"Always `true` on a 200 — the row is gone."},"id":{"type":"string","description":"The deleted group's id."}}},"SecurityGroupDetail":{"allOf":[{"$ref":"#/components/schemas/SecurityGroupRead","description":"The group itself."},{"type":"object","required":["rules","attachments"],"properties":{"attachments":{"type":"array","items":{"$ref":"#/components/schemas/SecurityGroupAttachmentRead"},"description":"The interfaces it governs."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/SecurityGroupRuleRead"},"description":"Its rules, oldest first — the order the compiler reads them in."}}}],"description":"A group with everything attached to it — what a single-group read\nreturns, so an operator sees the whole control rather than a name."},"SecurityGroupListResponse":{"type":"object","description":"Response envelope for `GET /platform/security-groups`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SecurityGroupRead"},"description":"Page contents — newest first, capped at the request's `limit`."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or `null` when no rows remain."}}},"SecurityGroupPatch":{"type":"object","description":"Request DTO. Absent fields are left as they are.","properties":{"description":{"type":["string","null"],"description":"New description."},"name":{"type":["string","null"],"description":"New name, unique within the owner scope."}}},"SecurityGroupRead":{"type":"object","description":"One security group as read.","required":["id","name","description","owner_scope","seeded","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339."},"description":{"type":"string","description":"Free text; may be empty."},"id":{"type":"string","description":"UUIDv7."},"name":{"type":"string","description":"Unique within its owner scope."},"owner_org_id":{"type":["string","null"],"description":"The owning org for `owner_scope = \"org\"`, else `null`."},"owner_scope":{"type":"string","description":"`\"platform\" | \"org\"`."},"seeded":{"type":"boolean","description":"True for a group the platform creates and relies on — a per-resource\nclass default. Deleting one would leave that class with no default,\nso the delete path refuses."},"updated_at":{"type":"string","description":"RFC3339."}}},"SecurityGroupRuleRead":{"type":"object","description":"One rule as read.","required":["id","direction","protocol","peer_kind","reason","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339."},"direction":{"type":"string","description":"`\"ingress\" | \"egress\"`."},"id":{"type":"string","description":"UUIDv7."},"peer_kind":{"type":"string","description":"`\"any\" | \"cidr\" | \"group\"`."},"peer_value":{"type":["string","null"],"description":"A CIDR or address for `cidr`, a group id for `group`, else `null`."},"port_hi":{"type":["integer","null"],"format":"int32","description":"Inclusive high port, or `null` for every port.","minimum":0},"port_lo":{"type":["integer","null"],"format":"int32","description":"Inclusive low port, or `null` for every port.","minimum":0},"protocol":{"type":"string","description":"`\"any\" | \"tcp\" | \"udp\" | \"icmp\"`."},"reason":{"type":"string","description":"Why the rule exists. Required — a port with no reason is a port\nnobody can safely remove later."}}},"SecuritySettingsRead":{"type":"object","description":"Read shape for `GET /settings/security` and the\n`PATCH /settings/security` 200 response. One field per\n`security_settings` column the platform uses, with the wire naming\npreserved 1:1.\n\nLazy-row contract (same as every prior settings slice): the row\nat `id = 1` is seeded by migration 0009 itself, so a GET against a\nfreshly migrated deployment surfaces the stored values. The\nmatching handler is responsible for the lazy-default\nprojection.\n\n`updated_at` is RFC3339 UTC. It is server-stamped on every PATCH\nand read-only — absent from the matching\n[`SecuritySettingsUpdate`] type.","required":["lockout_threshold_soft","lockout_window_soft_seconds","lockout_threshold_medium","lockout_window_medium_seconds","lockout_threshold_hard","lockout_window_hard_seconds","rate_limit_anon_max","rate_limit_anon_window_seconds","rate_limit_principal_max","rate_limit_principal_window_seconds","rate_limit_leads_max","rate_limit_leads_window_seconds","rate_limit_auth_max","rate_limit_auth_window_seconds","rate_limit_device_link_max","rate_limit_device_link_window_seconds","human_check_enabled","updated_at"],"properties":{"human_check_enabled":{"type":"boolean","description":"Logging in by email asks for the human check. Backed by\n`human_check_login_enabled`. Switch it off only to let people in\nwhile the check itself is broken."},"lockout_threshold_hard":{"type":"integer","format":"int64","description":"Per-account failure count at which the **hard** escalating\nlockout fires (also the count that emails the holder + audits).\nDefault 20. Backed by `lockout_threshold_hard` (`> 0`)."},"lockout_threshold_medium":{"type":"integer","format":"int64","description":"Per-account failure count at which the **medium** escalating\nlockout fires. Default 10. Backed by `lockout_threshold_medium`\n(`> 0`)."},"lockout_threshold_soft":{"type":"integer","format":"int64","description":"Per-account failure count at which the **soft** escalating\nlockout fires. Default 5. Backed by `lockout_threshold_soft`\n(migration 0169, `> 0`). Consumed by `account_lockout.rs`."},"lockout_window_hard_seconds":{"type":"integer","format":"int64","description":"Hard-lockout duration in seconds. Default 86400 (24 h). Backed by\n`lockout_window_hard_seconds` (`> 0`)."},"lockout_window_medium_seconds":{"type":"integer","format":"int64","description":"Medium-lockout duration in seconds. Default 900 (15 min). Backed\nby `lockout_window_medium_seconds` (`> 0`)."},"lockout_window_soft_seconds":{"type":"integer","format":"int64","description":"Soft-lockout duration in seconds. Default 60 (1 min). Backed by\n`lockout_window_soft_seconds` (`> 0`)."},"rate_limit_anon_max":{"type":"integer","format":"int64","description":"Max anonymous catalog requests per IP within the anon window.\nDefault 120. Backed by `rate_limit_anon_max` (migration 0170,\n`> 0`). Consumed by `rate_limit::guard`."},"rate_limit_anon_window_seconds":{"type":"integer","format":"int64","description":"Anonymous per-IP rate-limit window in seconds. Default 60. Backed\nby `rate_limit_anon_window_seconds` (`> 0`)."},"rate_limit_auth_max":{"type":"integer","format":"int64","description":"Max anonymous auth requests (login / signup / password-reset)\nper IP within the auth window. Default 100. Backed by\n`rate_limit_auth_max` (`> 0`). Consumed by\n`rate_limit::guard_auth`."},"rate_limit_auth_window_seconds":{"type":"integer","format":"int64","description":"Anonymous-auth per-IP rate-limit window in seconds. Default 60.\nBacked by `rate_limit_auth_window_seconds` (`> 0`)."},"rate_limit_device_link_max":{"type":"integer","format":"int64","description":"Max device-link requests (start + verify) per IP within\nthe device-link window. Default 10. Backed by\n`rate_limit_device_link_max` (`> 0`). Consumed by\n`rate_limit::guard_device_link`."},"rate_limit_device_link_window_seconds":{"type":"integer","format":"int64","description":"Device-link per-IP rate-limit window in seconds. Default 3600\n(1 h). Backed by `rate_limit_device_link_window_seconds` (`> 0`)."},"rate_limit_leads_max":{"type":"integer","format":"int64","description":"Max lead submissions per IP within the leads window. Default 5.\nBacked by `rate_limit_leads_max` (`> 0`). Consumed by\n`rate_limit::guard_leads`."},"rate_limit_leads_window_seconds":{"type":"integer","format":"int64","description":"Lead-submission per-IP rate-limit window in seconds. Default 3600\n(1 h). Backed by `rate_limit_leads_window_seconds` (`> 0`)."},"rate_limit_principal_max":{"type":"integer","format":"int64","description":"Max per-principal requests within the principal window. Default\n12. Backed by `rate_limit_principal_max` (`> 0`). Consumed by\n`rate_limit::guard_per_principal`."},"rate_limit_principal_window_seconds":{"type":"integer","format":"int64","description":"Per-principal rate-limit window in seconds. Default 60. Backed by\n`rate_limit_principal_window_seconds` (`> 0`)."},"updated_at":{"type":"string","description":"RFC3339 UTC timestamp of the last write. Server-stamped on\nevery PATCH; on a fresh deployment the schema's seed row\nsurfaces `\"1970-01-01T00:00:00Z\"` so the wire shape stays\nnon-optional."}}},"SecuritySettingsUpdate":{"type":"object","description":"Request body for `PATCH /settings/security`. Every field is\n`Option<T>` so a JSON object that omits a key leaves the column\nunchanged. An empty-object PATCH (`{}`) is a no-op at the column\nlevel — only `updated_at` advances (the handler mirrors the\nno-op semantics).\n\nThe integer knobs use `Option<i64>` with the schema's range\nconstraints. `None` (omitted key) leaves the column unchanged; the\noperator disables throttling via `login_throttle_enabled = false`,\nnot by zeroing the knobs.\n\n`garde` constraints fire only when the field is `Some(_)`.\n\n`updated_at` is server-stamped on every PATCH and is\nintentionally absent from this type — the wire cannot override\nthe timestamp.","properties":{"human_check_enabled":{"type":["boolean","null"],"description":"Switch the human check on logging in by email on or off."},"lockout_threshold_hard":{"type":["integer","null"],"format":"int64","description":"New hard-lockout failure threshold. Schema CHECK pins `> 0`."},"lockout_threshold_medium":{"type":["integer","null"],"format":"int64","description":"New medium-lockout failure threshold. Schema CHECK pins `> 0`."},"lockout_threshold_soft":{"type":["integer","null"],"format":"int64","description":"New soft-lockout failure threshold. Schema CHECK pins `> 0`."},"lockout_window_hard_seconds":{"type":["integer","null"],"format":"int64","description":"New hard-lockout window in seconds. Schema CHECK pins `> 0`."},"lockout_window_medium_seconds":{"type":["integer","null"],"format":"int64","description":"New medium-lockout window in seconds. Schema CHECK pins `> 0`."},"lockout_window_soft_seconds":{"type":["integer","null"],"format":"int64","description":"New soft-lockout window in seconds. Schema CHECK pins `> 0`."},"rate_limit_anon_max":{"type":["integer","null"],"format":"int64","description":"New anonymous per-IP request cap. Schema CHECK pins `> 0`."},"rate_limit_anon_window_seconds":{"type":["integer","null"],"format":"int64","description":"New anonymous per-IP window in seconds. Schema CHECK pins `> 0`."},"rate_limit_auth_max":{"type":["integer","null"],"format":"int64","description":"New per-IP anonymous-auth cap. Schema CHECK pins `> 0`."},"rate_limit_auth_window_seconds":{"type":["integer","null"],"format":"int64","description":"New per-IP anonymous-auth window in seconds. Schema CHECK pins `> 0`."},"rate_limit_device_link_max":{"type":["integer","null"],"format":"int64","description":"New per-IP device-link cap. Schema CHECK pins `> 0`."},"rate_limit_device_link_window_seconds":{"type":["integer","null"],"format":"int64","description":"New per-IP device-link window in seconds. Schema CHECK pins `> 0`."},"rate_limit_leads_max":{"type":["integer","null"],"format":"int64","description":"New per-IP lead-submission cap. Schema CHECK pins `> 0`."},"rate_limit_leads_window_seconds":{"type":["integer","null"],"format":"int64","description":"New per-IP lead-submission window in seconds. Schema CHECK pins `> 0`."},"rate_limit_principal_max":{"type":["integer","null"],"format":"int64","description":"New per-principal request cap. Schema CHECK pins `> 0`."},"rate_limit_principal_window_seconds":{"type":["integer","null"],"format":"int64","description":"New per-principal window in seconds. Schema CHECK pins `> 0`."}}},"SendMagicLinkRequest":{"type":"object","description":"Request body of `POST /auth/send_magic_link`.","required":["email_address"],"properties":{"client_attestation":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ClientAttestation","description":"The solved human-check challenge (`POST /auth/challenge`)."}]},"email_address":{"type":"string","description":"Address to log in or sign up with."},"redirect":{"type":["string","null"],"description":"Path on this site to open after logging in."}}},"SendMagicLinkResponse":{"type":"object","description":"Response of `POST /auth/send_magic_link`. The same for every address.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true`."},"sso_url":{"type":["string","null"],"description":"For an account that logs in through its organization's provider:\nwhere to go instead. No mail is sent to it."}}},"ServerHeartbeatRequest":{"type":"object","description":"Request body for `POST /server/heartbeat`. The agent's\n`agt_` bearer identifies the caller; the body carries only\nthe per-tick observable state of the server itself. No\n`server_id` is sent — identity is the bearer hash alone, so a\ncompromised or misconfigured agent cannot beat for a server\nit is not attached to (the cross-server guarantee is\nstructural).","required":["reported_version"],"properties":{"bytes_in":{"type":["integer","null"],"format":"int64","description":"Cumulative bytes received by the server since process\nstart. Per-tunnel rollup lives in `tunnel_traffic_samples`\n(L PR1); this is the server-wide aggregate for the\ndashboard."},"bytes_out":{"type":["integer","null"],"format":"int64","description":"Cumulative bytes sent by the server since process start."},"handshakes_5min":{"type":["integer","null"],"format":"int64","description":"Successful WG handshakes observed in the previous 5 min\nwindow. Informational telemetry."},"hostname":{"type":["string","null"],"description":"`gethostname()` at agent start, free-form. Stored only\ninside the rolling telemetry blob; not used for routing."},"peer_count":{"type":["integer","null"],"format":"int64","description":"Number of WG peers the server currently has installed in\nits kernel `wg` table. Read by the dashboard's per-server\nutilisation widget; informational only — `current_users`\nstays the canonical billing-facing field (L PR3 updates\nthat one)."},"reported_version":{"type":"string","description":"The `appsynergy-agent` build version the caller is\nrunning (e.g. `\"0.4.0\"`). Persisted to\n`servers.reported_version` so the operator dashboard can\nsurface fleet-wide drift against the pinned target."},"started_at":{"type":["string","null"],"format":"date-time","description":"RFC3339 UTC timestamp of when the agent process started.\nLets the operator dashboard surface uptime without a\nsecond round-trip."}}},"ServerHeartbeatResponse":{"type":"object","description":"Response body for `POST /server/heartbeat`. Acknowledges the\nbeat; the agent does not need any payload back today (the\nexpected-version push happens via the unified\n`POST /agents/heartbeat` surface). A future revision can\nappend fields without breaking deployed agents.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"`true` on a successful beat. Always `true` on a `200` —\nthe field exists so an agent's JSON parser can branch on\nshape rather than status code if that is more convenient\nfor the language binding."}}},"ServerPeerStatusRequest":{"type":"object","description":"Request body for `POST /server/peer-status`. Batch of per-peer\nreports — per-peer acceptance is independent; one bad report\ndoes NOT block the rest.","required":["peers"],"properties":{"peers":{"type":"array","items":{"$ref":"#/components/schemas/WgPeerStatus"},"description":"One or more per-peer reports. Validator recurses via `dive`."}}},"ServerPeerStatusResponse":{"type":"object","description":"Response body for `POST /server/peer-status`.","required":["accepted_count","rejected_count","results"],"properties":{"accepted_count":{"type":"integer","format":"int64","description":"Total peers whose row was updated."},"rejected_count":{"type":"integer","format":"int64","description":"Total peers whose report was rejected per-peer."},"results":{"type":"array","items":{"$ref":"#/components/schemas/ServerPeerStatusResult"},"description":"Per-peer outcomes in request order."}}},"ServerPeerStatusResult":{"type":"object","description":"Per-peer outcome on the wire.","required":["public_key","accepted","code"],"properties":{"accepted":{"type":"boolean","description":"`true` when the matched `wireguard_tunnels` row was updated\n(and any byte delta credited to the billing pipeline)."},"code":{"type":"string","description":"Stable rejection slug when `accepted == false`. Possible\nvalues: `\"peer_not_found\"` (no WireGuard tunnel on the\ncaller's server carries this public key — e.g. a peer whose\ntunnel was just deleted). Empty on acceptance."},"public_key":{"type":"string","description":"Echo of the input `public_key` so the agent can correlate\nwithout relying on positional order."}}},"ServerSubscribersResponse":{"type":"object","description":"Response body for `GET /server/subscribers`. A flat list —\nno cursor pagination today (one server typically hosts\nO(100..1000) peers, well below the cap a WG config can\nrealistically render in one syscall). If a server's roster\never grows past that, this becomes the obvious place to add\ncursor pagination.","required":["server_id","subscribers","removed_public_keys"],"properties":{"removed_public_keys":{"type":"array","items":{"type":"string"},"description":"Keys this server no longer serves on purpose: tunnels that are no\nlonger active, were deleted or moved away, and keys that were\nreplaced. A peer missing from `subscribers` and absent here went\nmissing without the control plane meaning it to."},"server_id":{"type":"string","description":"The server row this roster was built for. The agent pins it and\nrefuses a roster built for a different row."},"server_public_ip":{"type":["string","null"],"description":"Host part of this server's own `servers.endpoint` — the\naddress a peer with no static IP must egress as. The agent\ninstalls it only after confirming the address is configured\non its uplink inside its own namespace, so a stale value\nhere costs those peers their egress rather than leaking\nanother identity. `None` when the row carries no parseable\nIPv4 endpoint host."},"subscribers":{"type":"array","items":{"$ref":"#/components/schemas/WgSubscriber"},"description":"Peer entries in stable order (sorted by `tunnel_id`)."}}},"ServerTrafficRequest":{"type":"object","description":"Request body for `POST /server/traffic`. A single batch of\nsamples; the handler processes them atomically — every sample\ncommits or none does. The batch cap (`max=1000`) bounds the\nper-call cost so a misbehaving agent can't tie up the WAL\nwriter.","required":["samples"],"properties":{"samples":{"type":"array","items":{"$ref":"#/components/schemas/ServerTrafficSample"},"description":"One or more samples to ingest. Validator recurses into\neach via `nested`."}}},"ServerTrafficResponse":{"type":"object","description":"Response body for `POST /server/traffic`. Per-sample results\nplus aggregate counters so an agent sees both the granular\noutcome and the headline number (`accepted_count` /\n`rejected_count`).","required":["accepted_count","rejected_count","results"],"properties":{"accepted_count":{"type":"integer","format":"int64","description":"Total samples accepted (upserted + quota-applied)."},"rejected_count":{"type":"integer","format":"int64","description":"Total samples rejected. Sum of `accepted_count +\nrejected_count` equals `samples.len()` on the request\nwhen the call succeeded as a whole."},"results":{"type":"array","items":{"$ref":"#/components/schemas/ServerTrafficSampleResult"},"description":"Per-sample outcomes in the same order the request sent\nthem. The agent reads `accepted == false` rows and\nstops re-sending those samples."}}},"ServerTrafficSample":{"type":"object","description":"One per-tunnel sample from a WG infra agent. `protocol` /\n`dest_cidr` are optional — the current agent rev fills neither\n(the schema's UNIQUE wraps them in COALESCE so a `NULL/NULL`\nretry collapses to a single row exactly like a concrete\n`(tcp,0.0.0.0/0)` repeat would). The bytes-since-epoch\ncounters are absolute window totals, not deltas: an agent\nre-posting the same `(tunnel_id, period_start)` overwrites\nrather than accumulates. `bandwidth_quotas` rolls forward by\nthe **delta** between the previous-stored sample row and the\nnew one so a duplicate ingest does not double-count.","required":["tunnel_id","period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Absolute total bytes received by the server in the window\nfor this tunnel. Counters are `>= 0` at the wire (the\nschema's CHECK is the durable gate; this is the boundary\nguard so a negative reaches no further than this DTO)."},"bytes_out":{"type":"integer","format":"int64","description":"Absolute total bytes sent by the server in the window\nfor this tunnel."},"dest_cidr":{"type":["string","null"],"description":"Optional destination CIDR the bytes correspond to.\nFormat-validated only on length here; the column is\nopaque to the rest of the schema."},"period_end":{"type":"string","description":"RFC3339 UTC timestamp of the end of the sample window.\nMust be `>= period_start` (validator enforces shape;\nhandler enforces ordering)."},"period_start":{"type":"string","description":"RFC3339 UTC timestamp of the start of the sample window.\nCombined with `period_end`, defines the half-open\n`[period_start, period_end)` window the totals apply to."},"protocol":{"type":["string","null"],"description":"Optional protocol slice the bytes correspond to (`tcp` /\n`udp` / `icmp` / future). Today's agents do not split;\nthe column stays `NULL`. Future per-protocol classifiers\nfill it without a schema migration."},"tunnel_id":{"type":"string","description":"`tunnels.id` (UUIDv7) the sample belongs to. The handler\nrejects a sample whose tunnel is not hosted on the\ncaller's `server.agent_id`-resolved server."}}},"ServerTrafficSampleResult":{"type":"object","description":"Per-sample outcome on the wire. Either `accepted` (the row\nupserted and any subscription quota delta applied) or\n`rejected` with a stable `code` the agent can branch on\nwithout parsing prose. The agent does NOT auto-retry rejects\n— `tunnel_not_owned_by_caller` and `invalid_window` are\nconfiguration-class errors, and a retry would just re-fail.","required":["tunnel_id","period_start","accepted","code"],"properties":{"accepted":{"type":"boolean","description":"`true` when the sample was upserted into\n`tunnel_traffic_samples` and any subscription delta was\napplied; `false` when one of the documented `code`\nreasons fired."},"code":{"type":"string","description":"Stable rejection slug when `accepted == false`. Possible\nvalues: `\"tunnel_not_owned_by_caller\"`,\n`\"tunnel_not_found\"`, `\"invalid_window\"`. Empty on\nacceptance."},"period_start":{"type":"string","description":"Echo of the input sample's `period_start`."},"tunnel_id":{"type":"string","description":"Echo of the input sample's `tunnel_id` so the agent can\ncorrelate without relying on positional ordering."}}},"ServerUsageRequest":{"type":"object","description":"Request body for `POST /server/usage`. One field today — the\ncurrent count of connected peers the server has in its\nactive WG peer set. Bounded `>= 0` (a negative count is a\nmalformed agent).","required":["current_users"],"properties":{"current_users":{"type":"integer","format":"int64","description":"Current number of active WG peers on the server, as the\nagent sees it. Observational only: `servers.current_users`\nis derived from the server's live tunnels, so this value is\nlogged when it differs and never stored."}}},"ServerUsageResponse":{"type":"object","description":"Response body for `POST /server/usage`. Acknowledges the\nupdate; the agent does not need any payload back.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"`true` on a successful update."}}},"ServiceAccountCreateRequest":{"type":"object","description":"Request body for `POST /iam/orgs/{org_id}/service-accounts`.\nTwo required fields — `name` (the human display name) and\n`role_name` (the system role slug the new service account holds in\nthe org). The owning org is bound from the URL path's `{org_id}`\ncapture, never from the body — preventing a malicious payload from\nsteering the row into a different org than the path's `Enforce`\ngate authorized.\n\n`name` is bounded `min = 1, max = 200` to mirror\n`ServiceAccountUpdateRequest::name`; the lower bound refuses an\nempty-string insert because `service_accounts.name` is\n`NOT NULL`, and the upper bound matches `OrgUpdateRequest::name`\n/ `SignupRequest::name` for symmetry across the IAM area.\n\n`role_name` is bounded `min = 1, max = 64` — the same wire-layer\nshape as `MemberRoleAssignRequest::role_name`. The role-catalog\nmembership check (must be in [`CUSTOMER_ASSIGNABLE_ROLES`]) runs\nin the handler so platform-only and service-only roles cannot be\nslipped through this customer-facing surface even by a\n`platform_admin` caller, matching `member_role_patch.rs`\nprecedent.","required":["name","role_name"],"properties":{"name":{"type":"string","description":"Human display name for the new service account. Bounded\n`1 ≤ len ≤ 200`; the lower bound refuses empty-string inserts\nbecause `service_accounts.name` is `NOT NULL`."},"role_name":{"type":"string","description":"System role slug the new service account holds within its\norg. Required; must be one of [`CUSTOMER_ASSIGNABLE_ROLES`]\n(the role-catalog membership check runs in the handler).\nLength-bounded `1 ≤ len ≤ 64` at the wire layer."}}},"ServiceAccountDeleteResponse":{"type":"object","description":"Wire response for `DELETE /iam/service-accounts/{service_account_id}`.\nOne-field envelope mirroring `OrgDeleteResponse` /\n`OrgMemberRemoveResponse`. 200 OK on every success path, including\nthe idempotent re-call where the row is already disabled\n(RFC 9110 — DELETE is idempotent at the transport layer).\nSurfaces failure paths (gate-deny 403, missing-row 404) through\n`ApiError` only. Reserved for future structured fields (e.g.,\n`tokens_revoked`) without contract churn; the audit row is the\ncanonical record of cascade detail today.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path (state-change and idempotent\nre-call alike). Present for forward-compatible envelope shape\nrather than as a status flag."}}},"ServiceAccountListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/service-accounts`.\nA bare object with a single `service_accounts` array —\nkeeps the door open to add envelope-level fields (`total`,\n`has_more`, future cursor) without breaking clients that already\nparse the array shape, mirroring `OrgMemberListResponse` /\n`ApiTokenListResponse`. Each item reuses [`ServiceAccountRead`]\n(shipped with the PATCH handler) so the list shape and the\nread-projection shape never drift.","required":["service_accounts"],"properties":{"service_accounts":{"type":"array","items":{"$ref":"#/components/schemas/ServiceAccountRead"},"description":"Service accounts owned by the resolved org, ordered by\n`(created_at DESC, id DESC)` — newest first, with the\n`id DESC` tie-breaker keeping rows ordered when two seeds\nland in the same RFC3339 second. Both active and disabled\n(soft-deleted via `disabled_at`) rows are present; clients\nfilter on the per-row `disabled_at` field."}}},"ServiceAccountRead":{"type":"object","description":"Read-projection of a `service_accounts` row returned by\n`PATCH /iam/service-accounts/{service_account_id}`.\n\nMirrors the column shape of `0001_iam_init.sql`'s `service_accounts`\ntable. The `service_accounts` table has no `updated_at` column —\nthe audit row emitted on every successful PATCH is the canonical\nrecord of \"when this service account changed.\"","required":["id","org_id","name","role_name","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 timestamp the row was created."},"disabled_at":{"type":["string","null"],"description":"RFC3339 timestamp the service account was disabled, or `null`\nwhile active. PATCH never flips this column; the future\n`DELETE /iam/service-accounts/{id}` handler is the disable\npath."},"id":{"type":"string","description":"UUIDv7 identifier of the service account (matches\n`service_accounts.id`)."},"name":{"type":"string","description":"Human display name (matches `service_accounts.name`)."},"org_id":{"type":"string","description":"UUIDv7 identifier of the owning org (matches\n`service_accounts.org_id`). Constant across the row's lifetime\n— service accounts cannot be moved between orgs."},"role_name":{"type":"string","description":"System role slug the service account holds within its org\n(matches `service_accounts.role_name`)."}}},"ServiceAccountUpdateRequest":{"type":"object","description":"Request body for `PATCH /iam/service-accounts/{service_account_id}`.\nCurrently scopes to one mutable field — `name`. The struct\nis shaped as an envelope of optional fields so adding future\nPATCH-able columns extends the wire contract without breaking\nalready-shipped clients: an absent field leaves the column\nunchanged.\n\n`name` is bounded `min = 1, max = 200`. The lower bound refuses an\nempty-string clear because the schema declares\n`service_accounts.name TEXT NOT NULL` — a NULL would violate the\nconstraint and emerge as a 500 from sqlx; the validator-derived\n422 is the boundary check that keeps that shape from reaching the\ncolumn. The upper bound mirrors `OrgUpdateRequest::name` for\nsymmetry.","properties":{"name":{"type":["string","null"],"description":"Replacement display name. Absent (`None`) ⇒ no-op for this\nfield; present ⇒ overwrites `service_accounts.name`. Bounded\n`1 ≤ len ≤ 200`; the lower bound refuses empty-string clears\nbecause `service_accounts.name` is `NOT NULL`."}}},"ServiceListResponse":{"type":"object","description":"Response body for `GET /platform/services`.","required":["services"],"properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/ServiceRead"},"description":"All registered services, ordered by `name ASC`."}}},"ServiceRead":{"type":"object","description":"One service entry in the capability registry.","required":["name","display_name","available"],"properties":{"available":{"type":"boolean","description":"Whether this service is currently available for new subscriptions.\n`false` when all plans offering it are inactive or when the\nadmin has disabled the product globally."},"display_name":{"type":"string","description":"Human-readable display label."},"name":{"type":"string","description":"URL-safe service name used in deep links and `{name}` path\nlookups (e.g. `\"vpn\"`, `\"static_ips\"`, `\"dns\"`)."}}},"SessionListResponse":{"type":"object","description":"Response body for `GET /auth/sessions`. Plain wrapper around\nthe projected `SessionSummary` rows ordered `last_active_at DESC`.","required":["sessions"],"properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/SessionSummary"},"description":"The principal's currently-valid sessions, newest activity first."}}},"SessionRevokeResponse":{"type":"object","description":"Response body for `DELETE /auth/sessions/{id}`. `current`\nsignals whether the revoked row was the caller's own session — the\nUI follows up by clearing its own credential when so.","required":["ok","current"],"properties":{"current":{"type":"boolean","description":"`true` when the revoked session's `jti` matches the caller's\nown JWT — the UI uses this to clear its credential."},"ok":{"type":"boolean","description":"Always `true` on the success path. Reserved for future\nstructured fields without changing the contract."}}},"SessionRow":{"type":"object","description":"One live session.","required":["id","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation."},"device_name":{"type":["string","null"],"description":"Device name derived from the User-Agent."},"id":{"type":"string","description":"Session id."},"ip_address":{"type":["string","null"],"description":"Address it signed in from."},"last_active_at":{"type":["string","null"],"description":"RFC3339 last activity."}}},"SessionSummary":{"type":"object","description":"One row of a user's session list (`GET /auth/sessions`). Mirrors\nthe `sessions` row introduced in `0002_platform_users.sql`\nprojected onto the wire. `id` is the customer-visible session id —\nthe JWT's `jti` is intentionally not surfaced; the two are 1:1\ninternally but the URL space keys on `sessions.id`.","required":["id","device_name","device_type","created_at","last_active_at","expires_at","current"],"properties":{"created_at":{"type":"string","description":"RFC3339 timestamp the session row was inserted."},"current":{"type":"boolean","description":"`true` for the row whose `jti` matches the request's JWT — the\ndashboard uses this to flag \"this device\" without a second\nroundtrip."},"device_name":{"type":"string","description":"\"Browser on OS\" label parsed from the request's `User-Agent`\n(\"Safari on iOS\"); `\"Unknown device\"` when the header was absent."},"device_type":{"type":"string","description":"One of `'desktop' | 'mobile' | 'tablet' | 'unknown'`."},"expires_at":{"type":"string","description":"RFC3339 timestamp the session JWT's `exp` lands on. Sessions\npast this point are filtered out of the list response."},"id":{"type":"string","description":"`sessions.id` — UUIDv7 of the session row. The path parameter\nfor `DELETE /auth/sessions/{id}` and the wire identifier the\ndashboard renders against."},"ip_address":{"type":["string","null"],"description":"First entry of the request's `X-Forwarded-For` chain at session\ncreation. `None` when the header was absent / malformed."},"last_active_at":{"type":"string","description":"RFC3339 timestamp of the most recent request made with this\nsession, to within a minute (writes are throttled)."},"location":{"type":["string","null"],"description":"Coarse location, when a geolocation source filled it. `None`\notherwise; the console hides the column when no row has one."},"user_agent":{"type":["string","null"],"description":"Verbatim `User-Agent` header at session creation. Served to\nplatform staff only; `None` for everyone else and when the header\nwas absent."}}},"SessionsTerminateAllResponse":{"type":"object","description":"Response body for `POST /auth/sessions/terminate-all`. The\ncaller's own session is included in the count — the customer\ncontract is \"log me out everywhere, this device included.\"","required":["ok","revoked_count"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Reserved for future\nstructured fields without changing the contract."},"revoked_count":{"type":"integer","format":"int64","description":"Number of `sessions` rows the call deleted — equivalently, the\nnumber of `revoked_jtis` rows it inserted."}}},"SetActiveOrgRequest":{"type":"object","description":"Request body for `POST /auth/me/active-org` — switch the caller's\nactive org. `org_id` must be an org the caller is a current member\nof; a non-member or unknown id is rejected (the handler returns 404\nso membership is not enumerable to non-members).","required":["org_id"],"properties":{"org_id":{"type":"string","description":"`orgs.id` (UUIDv7) to make active. Bounded at the boundary; the\nhandler additionally parses it as a UUID and checks membership."}}},"SignInMethods":{"type":"object","description":"How the account can sign in.","required":["password","passkeys","passkey_only","totp","recovery_codes_left"],"properties":{"passkey_only":{"type":"boolean","description":"Passkey-only sign-in enforced."},"passkeys":{"type":"integer","format":"int64","description":"Registered passkeys."},"password":{"type":"boolean","description":"A password is set."},"recovery_codes_left":{"type":"integer","format":"int64","description":"Unused recovery codes."},"sso_org_id":{"type":["string","null"],"description":"The org whose SSO created the account, if any."},"totp":{"type":"boolean","description":"A confirmed authenticator app (TOTP)."}}},"Signals":{"type":"object","description":"What the page observed while the challenge was being solved. Reported\nby the browser, so never proof of anything; used only to ask more.","properties":{"automation":{"type":"array","items":{"type":"string"},"description":"Traces of automation tools found in the page."},"confirm_trusted":{"type":["boolean","null"],"description":"The puzzle dialog was confirmed with a real pointer or key."},"input":{"type":"string","description":"Pointer, keyboard or tap placement."},"native":{"type":"boolean","description":"The browser's built-in functions are its own (not replaced)."},"press_trusted":{"type":["boolean","null"],"description":"The button that sent the request was pressed with a real pointer or\nkey (the event's `isTrusted`)."},"trail":{"type":"array","items":{"type":"array","items":{"type":"integer","format":"int32"}},"description":"Bounded movement trail; discarded after calculating summary features."},"traits":{"$ref":"#/components/schemas/Traits","description":"Coarse browser attributes, used only for abuse prevention."},"webdriver":{"type":"boolean","description":"`navigator.webdriver`."}}},"SplitTunnelRead":{"type":"object","description":"Response body for `GET`/`PATCH /vpn/tunnels/{id}/split-tunnel`.","required":["tunnel_id","mode","cidrs","kill_switch","allowed_ips","kill_switch_allow_cidrs"],"properties":{"allowed_ips":{"type":"string","description":"The resolved `[Peer] AllowedIPs =` value the generated `.conf`\ncarries for this tunnel (see `resolve_allowed_ips`)."},"cidrs":{"type":"array","items":{"type":"string"},"description":"The configured CIDR list. Empty when `mode = \"off\"`."},"kill_switch":{"type":"boolean","description":"When `true`, the client's firewall should permit egress only to\n[`Self::kill_switch_allow_cidrs`] — a tunnel outage never leaks\ntraffic outside the configured routes."},"kill_switch_allow_cidrs":{"type":"array","items":{"type":"string"},"description":"The CIDR allow-list the client's firewall should enforce while\n[`Self::kill_switch`] is set (see `resolve_kill_switch_allow_cidrs`).\nMeaningful only when `kill_switch = true`; still populated\notherwise so the caller never has to special-case it."},"mode":{"type":"string","description":"One of [`ALLOWED_SPLIT_TUNNEL_MODES`]."},"tunnel_id":{"type":"string","description":"`wireguard_tunnels.tunnel_id` (echoed for correlation)."}}},"SplitTunnelUpdateRequest":{"type":"object","description":"Request body for `PATCH /vpn/tunnels/{id}/split-tunnel`. Every field\nis optional; an absent field keeps its current value (COALESCE\nsemantics, mirrors `DevicePatchRequest`). `mode` is validated\nagainst [`ALLOWED_SPLIT_TUNNEL_MODES`] and each `cidrs` entry\nagainst `is_valid_cidr` in the handler — cross-field validation\n(mode requiring a non-empty CIDR list) needs the merged old+new\nstate, which `garde` cannot express on a partial-update DTO.","properties":{"cidrs":{"type":["array","null"],"items":{"type":"string"},"description":"Replacement CIDR list. Absent ⇒ keep the current list. An empty\narray is valid only when the resulting mode is `\"off\"`."},"kill_switch":{"type":["boolean","null"],"description":"Absent ⇒ keep the current killswitch flag."},"mode":{"type":["string","null"],"description":"One of [`ALLOWED_SPLIT_TUNNEL_MODES`]. Absent ⇒ keep the current mode."}},"additionalProperties":false},"SsoCallbackQuery":{"type":"object","description":"Query string for the OIDC callback. The success branch carries\n`code` + `state`; the IdP-error branch carries `error` + `state`.","properties":{"code":{"type":["string","null"],"description":"OAuth2 authorization code on the success branch."},"error":{"type":["string","null"],"description":"OAuth2 error code if the IdP rejected the request."},"error_description":{"type":["string","null"],"description":"Human-readable description the IdP optionally sent with\n`error`. Carried into audit metadata only, never the wire."},"state":{"type":["string","null"],"description":"CSRF token previously persisted by the redirect handler;\nechoed back by the IdP."}}},"SsoProviderListResponse":{"type":"object","description":"Wire response for `GET /iam/orgs/{org_id}/sso-providers`.\nA bare object with a single `providers` array — keeps the door\nopen to add envelope-level fields (`total`, `has_more`, future\ncursor) without breaking clients that already parse the array\nshape, mirroring `PolicyConditionListResponse` /\n`ResourceGrantListResponse` / `OrgCustomRoleListResponse` /\n`OrgMemberListResponse` / `ApiTokenListResponse`. Each item\nreuses [`SsoProviderSummary`] so a future schema addition cannot\ndrift the list shape away from the per-row projection.","required":["providers"],"properties":{"providers":{"type":"array","items":{"$ref":"#/components/schemas/SsoProviderSummary"},"description":"SSO providers configured for the resolved org, ordered by\n`(created_at DESC, id DESC)` — newest first, with the\n`id DESC` tie-breaker keeping rows ordered when two seeds\nland in the same RFC3339 second."}}},"SsoProviderSummary":{"type":"object","description":"Per-row summary projected by `GET /iam/orgs/{org_id}/sso-providers`\n(the foundation slice). One row per\n`org_sso_providers` table entry, scoped to the path-resolved org.\n\n`client_secret_ct` is structurally absent — the list endpoint's\nSELECT does not project the column and the wire type does not\ncarry the field. Customers managing the IdP configuration see\nevery operational field except the AEAD ciphertext at rest.","required":["id","org_id","provider_kind","display_name","issuer_url","client_id","discovery_url","scopes","auto_provision","default_role_name","created_at","updated_at"],"properties":{"auto_provision":{"type":"boolean","description":"Whether a successful callback resolving to an unknown\nuser should auto-create the member. Stored as 0/1 in the\n`INTEGER NOT NULL CHECK (... IN (0,1))` column; projected\nas a bool on the wire."},"client_id":{"type":"string","description":"OAuth2 / OIDC `client_id` (or SAML2 entity id), public by\ndefinition. Echoed verbatim on the read surface so an\norg_admin can reconcile the IdP-side config without\nre-opening the dashboard's edit form."},"created_at":{"type":"string","description":"RFC3339 timestamp the row was created (matches\n`org_sso_providers.created_at`)."},"default_role_name":{"type":"string","description":"Role name applied to an auto-provisioned member. The\ncreate handler validates the value against the system\nrole catalog (custom-role grants for SSO are deferred\nuntil the later slices); this read surface projects\nthe column verbatim."},"discovery_url":{"type":"string","description":"OIDC discovery document URL (typically `<issuer>/.well-known/openid-configuration`)\nor SAML2 metadata URL. The callback handler resolves\nJWKS keys via this endpoint at verify time."},"display_name":{"type":"string","description":"Human-readable label rendered in the dashboard's IdP picker\nand on the corporate-login button. The create handler\nvalidates length at the wire boundary; this read surface\nprojects the column verbatim."},"id":{"type":"string","description":"UUIDv7 identifier of the provider row (matches\n`org_sso_providers.id`). Stable across the row's lifetime."},"issuer_url":{"type":"string","description":"IdP issuer URL — the value the OIDC discovery doc and\nSAML2 entity descriptor identify themselves as. The\n`(org_id, provider_kind, issuer_url)` UNIQUE tuple keeps\nduplicates out within an org."},"org_id":{"type":"string","description":"UUIDv7 of the owning org (matches\n`org_sso_providers.org_id`). Constant across the row's\nlifetime — providers cannot move between orgs."},"provider_kind":{"type":"string","description":"Bounded protocol kind. One of `oidc`, `saml2` — the same\nset as the schema-level `CHECK (provider_kind IN (...))`\nconstraint."},"scopes":{"type":"string","description":"Space-separated OAuth2 scope list. Defaults to\n`openid email profile` per the schema-level DEFAULT."},"updated_at":{"type":"string","description":"RFC3339 timestamp the row was last updated (matches\n`org_sso_providers.updated_at`). Equal to `created_at`\nuntil the first PATCH lands."}}},"StaffCloseReason":{"type":"string","description":"Why staff delete an account in standard mode.","enum":["user_asked","abuse","fraud","legal"]},"StaffDeleteMode":{"type":"string","description":"How staff delete an account.","enum":["standard","spam"]},"StaticIpQuotaRead":{"type":"object","description":"Response body for `GET /static-ips/quota` — the caller's static-IP\nallowance and current usage for one subscription (flow-1 step 3c made\nvisible). `allowance` = `plan.static_ip_count` + Σ active `static_ip`\naddon quantities; `used` counts owned IPs (`reserved` + `in_use`, the\nsame slots the claim gate counts — an unbound-but-reserved IP still\noccupies one); `available` = `max(0, allowance - used)`.","required":["subscription_id","allowance","used","available"],"properties":{"allowance":{"type":"integer","format":"int64","description":"Total static IPs this subscription may own (plan + active addons)."},"available":{"type":"integer","format":"int64","description":"Remaining claimable slots (`max(0, allowance - used)`)."},"subscription_id":{"type":"string","description":"The subscription the quota is reported for."},"used":{"type":"integer","format":"int64","description":"IPs currently owned (`reserved` + `in_use`)."}}},"StatusPatchRequest":{"type":"object","description":"Request body for `PATCH /router/bindings/{id}/status`. The\nagent reports the outcome of its local nft work + echoes the\n`(public_ip, destination_ip)` tuple it received from the\nreads so the handler's tuple-validator can reject a\nvalue-blind status finalisation.\n\nThe `error_message` field is `Option<String>`: required when\n[`Self::status`] is [`BindingPatchStatus::Failed`], NULL on the\nsuccess transitions. The handler enforces this beyond\n`Validate` (the validator derive cannot express \"field X\nrequired iff field Y is variant Z\" cross-field constraints\ncleanly).","required":["status","public_ip","destination_ip"],"properties":{"destination_ip":{"type":"string","description":"Internal target the binding forwarded to, echoed back from\nthe agent's read of the row. The other half of\nthe tuple validated against `bindings.destination_ip`."},"error_message":{"type":["string","null"],"description":"Failure reason. Populated on\n[`BindingPatchStatus::Failed`] transitions; NULL on the\nsuccess transitions. The handler refuses\n`422 validation_failed` when this is None on a `failed`\ntransition. Stored verbatim on `bindings.last_error`."},"public_ip":{"type":"string","description":"Public-facing IP the binding routed, echoed back from the\nagent's read of the row. Half of the\n`(public_ip, destination_ip)` tuple the handler\nvalidates against the binding's current DB row before\napplying the status transition — refusal is `409\ntuple_mismatch`. This is the structural fix for\nthe legacy value-blind-delete disaster."},"status":{"$ref":"#/components/schemas/BindingPatchStatus","description":"Terminal status the agent is reporting. One of `\"active\"`,\n`\"failed\"`, `\"removed\"`. The schema's `'pending'` /\n`'removing'` values are server-side-only and are not\nadmitted on this surface."}}},"StatusPatchResponse":{"type":"object","description":"Response shape for `PATCH /router/bindings/{id}/status`. Echoes\nthe canonical post-write row so the agent can confirm the\nserver's view of the transition without a second GET round-trip.\n\n`applied_at` is populated on the `pending → active` path\n(NULL on `pending → failed`); `removed_at` is populated on the\n`removing → removed` path (NULL on `removing → failed`). A\n`failed` row carries neither timestamp.","required":["id","status"],"properties":{"applied_at":{"type":["string","null"],"format":"date-time","description":"`bindings.applied_at` post-write. Set when the agent\ntransitioned the row to `\"active\"`; NULL on the `failed` /\n`removed` paths."},"id":{"type":"string","description":"Binding row id. Echoed verbatim from the path parameter so\nthe agent's per-row state machine can key on a single\nfield."},"removed_at":{"type":["string","null"],"format":"date-time","description":"`bindings.removed_at` post-write. Set when the agent\ntransitioned the row to `\"removed\"`; NULL on the `failed` /\n`active` paths."},"status":{"$ref":"#/components/schemas/BindingPatchStatus","description":"Terminal status after the transition. One of `\"active\"`,\n`\"failed\"`, `\"removed\"`."}}},"StatusSummaryResponse":{"type":"object","description":"Response envelope for `GET /api/v1/status/summary`.","required":["overall_status","status_page_url"],"properties":{"overall_status":{"type":"string","description":"Aggregate health as published upstream: `operational`,\n`degraded`, or `outage`."},"status_page_url":{"type":"string","description":"Canonical status-page URL, so every surface that quotes the\nnumber links to the source of truth without hard-coding it in\nthe frontend."},"uptime_90d":{"type":["number","null"],"format":"double","description":"The headline 90-day uptime: the WORST uptime among components\nthat have one, because a claim about the platform is only as\ngood as its weakest monitored part. `null` when no component\npublishes a figure — upstream reports none without observations,\nand no claim is made on no evidence."}}},"StripeCheckoutRead":{"type":"object","description":"Response body — the new session id + the hosted-checkout URL the\nfrontend redirects to.","required":["session_id","session_url","resumed"],"properties":{"resumed":{"type":"boolean","description":"`true` when this is the org's checkout already in progress rather\nthan a new one; its plan and cycle may differ from the request."},"session_id":{"type":"string","description":"Stripe's session id (`cs_test_...` or `cs_live_...`)."},"session_url":{"type":"string","description":"The hosted-checkout URL Stripe expects the customer to be\nredirected to."}}},"StripeCheckoutRequest":{"type":"object","description":"Request body for `POST /billing/checkout/stripe`.","required":["plan_id","billing_cycle","success_url","cancel_url"],"properties":{"billing_cycle":{"type":"string","description":"One of `monthly` / `biweekly` / `annual`."},"cancel_url":{"type":"string","description":"URL Stripe redirects to on cancel."},"org_id":{"type":["string","null"],"format":"uuid","description":"The org the subscription is for (the console's workspace). Defaults\nto the caller's personal org."},"plan_id":{"type":"string","format":"uuid","description":"UUIDv7 of the target plan."},"success_url":{"type":"string","description":"URL Stripe redirects to on success."},"trial":{"type":"boolean","description":"Start the plan's free trial: no charge for the trial's days, then\nthe card is charged unless the subscription is cancelled. Once per\nperson and once per card; only on a trial-eligible paid plan."}}},"StripePendingOp":{"type":"object","description":"One Stripe follow-up.","required":["id","kind","target_id","org_id","state","attempts","created_at"],"properties":{"alerted_at":{"type":["string","null"]},"attempts":{"type":"integer","format":"int64"},"created_at":{"type":"string"},"dismissed_by":{"type":["string","null"]},"done_at":{"type":["string","null"]},"id":{"type":"string"},"kind":{"type":"string","description":"`release_schedule` or `void_invoice`."},"last_error":{"type":["string","null"]},"next_attempt_at":{"type":["string","null"]},"note":{"type":["string","null"]},"org_id":{"type":"string"},"org_name":{"type":["string","null"]},"result":{"type":["string","null"],"description":"What the last attempt found."},"state":{"type":"string","description":"`open`, `done`, `gave_up`, `failed` or `dismissed`."},"stripe_subscription_id":{"type":["string","null"]},"target_id":{"type":"string","description":"The Stripe schedule or invoice it acts on."}}},"StripePendingOpDismiss":{"type":"object","description":"Why a follow-up is dismissed.","required":["note"],"properties":{"note":{"type":"string","description":"What staff did about it."}}},"StripePendingOpList":{"type":"object","description":"The follow-ups list.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StripePendingOp"}}}},"StripeSettingsRead":{"type":"object","description":"Read shape for `GET /settings/stripe` and the\n`PATCH /settings/stripe` 200 response. One field per\n`stripe_settings` column with the wire naming preserved 1:1,\nexcept the two `*_ct` BLOB columns project onto\n[`SecretPresence`] markers instead of leaking ciphertext or\nplaintext.\n\nLazy-row contract (same as `SystemSettingsRead`): the row at\n`id = 1` is created lazily by the first writer (comment in\n0008). A GET against an empty `stripe_settings` table surfaces\nthe column DEFAULTs (`enabled = false`, `publishable_key = None`,\n`secret_key = SecretPresence::Unset`, `webhook_secret =\nSecretPresence::Unset`, `updated_at = \"1970-01-01T00:00:00Z\"`)\nso the wire shape stays uniform regardless of whether a write\nhas happened yet. The matching handler is responsible for\nthe lazy-default projection.\n\n`publishable_key` is `Option<String>` because the schema column\nis nullable TEXT; the value is the Stripe-issued\n`pk_live_…` / `pk_test_…` string, which is non-secret by Stripe's\nown contract (it ships embedded in browser bundles) so it\nround-trips plainly on the wire.\n\n`updated_at` is RFC3339 UTC. It is server-stamped on every PATCH\n(via `state.clock.now()`) and read-only — absent from the\nmatching [`StripeSettingsUpdate`] type.","required":["enabled","secret_key","webhook_secret","updated_at"],"properties":{"enabled":{"type":"boolean","description":"`true` when Stripe processing is enabled. Backed by the\nschema's `enabled INTEGER NOT NULL DEFAULT 0 CHECK\n(enabled IN (0, 1))` column; the wire form is a plain bool\nand the handlers do the int↔bool conversion."},"publishable_key":{"type":["string","null"],"description":"Stripe publishable key (the `pk_live_…` / `pk_test_…`\nstring). Nullable TEXT in the schema — `None` is\nwire-equivalent to \"operator has not set one yet\".\nNon-secret by Stripe's contract, so it round-trips plainly."},"secret_key":{"$ref":"#/components/schemas/SecretPresence","description":"Presence marker for the AEAD-encrypted `secret_key_ct` BLOB.\nWire form is the literal token `\"<set>\"` / `\"<unset>\"`. The\nplaintext is never echoed on read."},"updated_at":{"type":"string","description":"RFC3339 UTC timestamp of the last write. Server-stamped on\nevery PATCH; on a fresh deployment with no write yet, the\nhandler surfaces `\"1970-01-01T00:00:00Z\"` so the wire\nshape stays non-optional."},"webhook_secret":{"$ref":"#/components/schemas/SecretPresence","description":"Presence marker for the AEAD-encrypted `webhook_secret_ct`\nBLOB. Same wire and read contract as `secret_key`."}}},"StripeSettingsUpdate":{"type":"object","description":"Request body for `PATCH /settings/stripe`. Every field is\n`Option<T>` so a JSON object that omits a key leaves the column\nunchanged. An empty-object PATCH (`{}`) is a no-op at the\ncolumn level — only `updated_at` advances (the handler\nmirrors the no-op semantics).\n\nThe nullable text column (`publishable_key`) and the two\nsecret-input fields (`secret_key`, `webhook_secret`) use\n`Option<String>`. The matching handler treats an explicit\nempty string as \"clear to NULL\" (i.e. `{\"secret_key\": \"\"}` sets\n`secret_key_ct` to NULL); a non-empty string sets the column —\nfor the two secret-input fields, the plaintext is encrypted\nvia `platform::settings::crypto::aead_encrypt` before storage.\nDistinguishing \"omit\" from \"explicit null\" without that\nconvention requires an `Option<Option<T>>` double-option\npattern; the empty-string-clears convention is strictly simpler\nand matches how the dashboard's text inputs already round-trip.\n\n`garde` constraints fire only when the field is `Some(_)`;\n`None` is skipped automatically by the `garde` crate's\n`Option` semantics. The `length(max = 200)` cap on the three\nfree-text fields is well above Stripe's actual key length\n(`pk_live_…` / `sk_live_…` / `whsec_…` strings sit around\n100–110 chars) so a typo lands the validator rather than the\ndatabase. The cap also blocks an operator from accidentally\npasting a multi-line key block.\n\n`updated_at` is server-stamped on every PATCH and is\nintentionally absent from this type — the wire cannot override\nthe timestamp.","properties":{"enabled":{"type":["boolean","null"],"description":"New `enabled` flag. Plain bool on the wire; the handler\nconverts to the schema's `0` / `1` storage form."},"publishable_key":{"type":["string","null"],"description":"New `publishable_key`. Capped at 200 chars. Empty string\nclears the column to NULL (handler convention)."},"secret_key":{"type":["string","null"],"description":"New `secret_key` plaintext. Capped at 200 chars. Empty\nstring clears the underlying `secret_key_ct` BLOB to NULL;\nany non-empty value is AEAD-encrypted by the handler\nbefore storage. The response (`StripeSettingsRead`) never\nechoes the plaintext — only the [`SecretPresence`] marker\nderived from post-write column NULL-ness surfaces."},"webhook_secret":{"type":["string","null"],"description":"New `webhook_secret` plaintext. Same semantics as\n`secret_key`: capped at 200 chars, empty clears, non-empty\nis AEAD-encrypted by the handler before storage, the\nplaintext is never echoed on read."}}},"SubscribeFrame":{"type":"object","description":"Inbound subscribe frame sent once by the client after upgrade. The\n`subscribe` array lists every topic the client wants to receive.","required":["subscribe"],"properties":{"subscribe":{"type":"array","items":{"type":"string"},"description":"Topic strings to subscribe to (e.g. `topology:org:<uuid>`,\n`flows:org:<uuid>`, `topology:fleet`, `flows:fleet`)."}}},"SubscriptionCreateRequest":{"type":"object","description":"Request body for `POST /billing/subscriptions`.","required":["plan_id","billing_cycle"],"properties":{"billing_cycle":{"type":"string","description":"One of `monthly`, `biweekly`, `annual`."},"org_id":{"type":["string","null"],"format":"uuid","description":"The org the subscription is for. Defaults to the caller's\npersonal org."},"plan_id":{"type":"string","format":"uuid","description":"UUIDv7 of the target plan."}}},"SubscriptionImpact":{"type":"object","description":"One subscription that ends with the account.","required":["id","org_id","org_name","status","billing_cycle","refund_estimate","refund_basis"],"properties":{"billing_cycle":{"type":"string","description":"`monthly`, `biweekly`, `annual`."},"currency":{"type":["string","null"],"description":"Its currency."},"current_period_end":{"type":["string","null"],"description":"End of the period paid for."},"id":{"type":"string","description":"Its id."},"org_id":{"type":"string","description":"The organization paying for it."},"org_name":{"type":"string","description":"The organization's name."},"payment_method":{"type":["string","null"],"description":"`card`, `crypto`, `complimentary`, `free`, or none."},"plan_name":{"type":["string","null"],"description":"The plan's name."},"refund_basis":{"type":"string","description":"Why that amount: `prorated_by_day`, `annual_past_window`,\n`nothing_paid`, `outside_period`, `invoice_not_found`."},"refund_estimate":{"type":"integer","format":"int64","description":"What would be refunded if it ended now (minor units)."},"status":{"type":"string","description":"`active`, `grace`, `suspended`."}}},"SubscriptionListResponse":{"type":"object","description":"Wire response for `GET /billing/subscriptions`. One-array\nenvelope plus an opaque `next_cursor` token. Mirrors the\n`audit::types::AuditEventListResponse` precedent at\n`app/src/platform/audit/types.rs` line 49-61.\n\n`next_cursor` is `None` on the last page (the page returned\nfewer than `limit` rows); a non-null cursor MUST be passed back\nverbatim on the follow-up call. The cursor codec ships with the\nmatching list handler (the sub-goal); at this layer only\nthe wire shape is fixed so frontends consuming the response\nalready see the field.","required":["subscriptions"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque base64url-encoded cursor for the next page; `null`\nwhen the current page is the last."},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionRead"},"description":"Subscriptions for the orgs the caller is a member of, in\nthe server-determined order. The handler PR pins the\nordering (`(created_at DESC, id DESC)` per the\n`audit_events_list` precedent); the type carries no\nordering guarantee on its own — frontends MUST render in\nvector order."}}},"SubscriptionOverageGate":{"type":"object","description":"Response for `PATCH /billing/subscriptions/{id}/overages`.\nThe post-write gate state so the dashboard reflects the\ntoggle without a follow-up GET — the\n`subscriptions_self_cancel` \"return the post-state row\"\nprecedent, minimised to the one field this endpoint owns\n(returning the full `SubscriptionRead` would couple BB to the\nC-area row shape for no caller benefit).","required":["subscription_id","allow_overages"],"properties":{"allow_overages":{"type":"boolean","description":"`subscriptions.allow_overages` *after* the write — the new\neffective gate. Equals the request's `allow_overages` on\nsuccess (the handler never coerces it; the field is the\nauthoritative post-write value the agent enforces against)."},"subscription_id":{"type":"string","description":"The subscription whose gate was set (echoes the path\n`{subscription_id}`; UUIDv7 string)."}}},"SubscriptionOverageUpdateRequest":{"type":"object","description":"Request body for `PATCH /billing/subscriptions/{id}/overages`\n(the first customer-facing write).\nThe single customer-controlled knob over the path-tier system:\n`subscriptions.allow_overages`. The body is\nverbatim — `{ allow_overages: bool }`.\n\n`false` (the schema default) ⇒ traffic on a tier past its\n`included_gb_per_month` is rejected at the routing agent until\nthe next period; `true` ⇒ the routing agent admits overage\ntraffic and the metered `overage_cost_cents_per_gb` accrues.\nThe customer flips this; no admin involvement (the roster\nread surfaces the current value).\n\nDerives `Validate` for the boundary contract (every\nJSON request body type derives `garde::Validate`) even\nthough a lone `bool` carries no range/format constraint —\n`validate()` is `Ok` for any value, and the uniform\n`req.validate()?` first line in the handler is preserved\n(mirrors the `Validate`-derive-without-rules posture of other\nsingle-scalar request DTOs).","required":["allow_overages"],"properties":{"allow_overages":{"type":"boolean","description":"New value for `subscriptions.allow_overages`. `true` opens\nthe metered-overage gate for every path tier the\nsubscription's plan grants; `false` closes it (traffic past\na tier's bundled allowance is dropped at the agent)."}}},"SubscriptionPathTierEntry":{"type":"object","description":"One row of `GET /billing/subscriptions/{id}/path-tiers` —\na tier the caller's subscription has access to (via\n`plan_path_tiers`) joined with that tier's usage in the current\n`subscription_path_usage` period. These are the exact\nper-tier shape: `{ tier, included, overage_limit_gb_per_month,\nused_gb, included_remaining_gb, overage_used_gb,\noverage_charged_cents }`.\n\n`tier` reuses [`PathTierCatalogEntry`] — the same\n`network_path_tiers` projection the public catalog emits —\nso the dashboard renders one tier shape everywhere (name,\npricing, `included_gb_per_month`, `capabilities`). The plan grant\nis reported verbatim: a plan-granted tier is listed regardless of\n`visible` / `active`, because the customer already has access to\nit (visibility gates the *public picker*, not an existing grant)\n— hiding a tier the subscription is billed against would be a\nsilent omission, not a safety win.\n\nByte counters convert to whole GB at the decimal `10^9`\nboundary (matching `overage_cost_cents_per_gb`'s per-GB billing\nunit), floored — partial GB does not round up into a billable\nGB. `used_gb = floor((bytes_in + bytes_out) / 10^9)` over the\nactive-period `subscription_path_usage` row, `0` when the\nrollover worker has not created that row yet (lazy creation, the\n`protocol_usage_list` precedent).\n\nResponse-only (no `Validate`): an org-scoped GET with no client\nbody.","required":["tier","included","used_gb","overage_used_gb","overage_charged_cents"],"properties":{"included":{"type":"boolean","description":"`plan_path_tiers.included` — `true` when the tier is bundled\nin the plan (no overage opt-in needed), `false` when it is\navailable only as an overage-gated extra."},"included_remaining_gb":{"type":["integer","null"],"format":"int64","description":"GB still inside the tier's bundled allowance —\n`max(0, network_path_tiers.included_gb_per_month - used_gb)`,\nor `None` when the tier is unmetered\n(`included_gb_per_month` is NULL — no bundled cap, so\n\"remaining\" is undefined)."},"overage_charged_cents":{"type":"integer","format":"int64","description":"`subscription_path_usage.overage_charged_cents` for the\nactive period — the metered overage already billed for this\ntier this period, in cents (`>= 0`, schema CHECK). `0` when\nno usage row exists yet."},"overage_limit_gb_per_month":{"type":["integer","null"],"format":"int64","description":"`plan_path_tiers.overage_limit_gb_per_month` — the per-month\nGB ceiling the plan places on overage usage of this tier, or\n`None` for no plan-imposed overage ceiling (the column is\nnullable; `>= 0` when set)."},"overage_used_gb":{"type":"integer","format":"int64","description":"GB used beyond the tier's bundled allowance —\n`max(0, used_gb - network_path_tiers.included_gb_per_month)`,\nor `0` for an unmetered tier (no cap ⇒ no overage notion)."},"tier":{"$ref":"#/components/schemas/PathTierCatalogEntry","description":"The granted tier, the same `network_path_tiers` projection the\npublic catalog emits ([`PathTierCatalogEntry`])."},"used_gb":{"type":"integer","format":"int64","description":"Whole GB used on this tier in the active period —\n`floor((bytes_in + bytes_out) / 10^9)` over the\n`subscription_path_usage` row. `0` when no usage row exists\nyet for the active period."}}},"SubscriptionPathTiersResponse":{"type":"object","description":"Response envelope for `GET /billing/subscriptions/{id}/path-tiers`.\nCarries the subscription-level overage state alongside the\nper-tier roster so the dashboard renders \"overages are off and\nthis tier is at its cap\" without a second request. No\n`next_cursor`: the roster is bounded by the plan's curated\n`plan_path_tiers` set (admin-curated, same rationale as the\ncatalogs — cursor pagination, is for\nunbounded-growth lists).","required":["allow_overages","path_tiers"],"properties":{"allow_overages":{"type":"boolean","description":"`subscriptions.allow_overages` — the customer-controlled\noverage gate. `false` (the schema default) ⇒ traffic on a\ntier past its `included_gb_per_month` is rejected at the\nrouting agent until the next period or until the customer\nflips this on (owns the write path)."},"path_tiers":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionPathTierEntry"},"description":"One entry per tier the subscription's plan grants, ordered\n`network_path_tiers.display_order ASC, id ASC`. `[]` when the\nplan grants no path tiers."}}},"SubscriptionRead":{"type":"object","description":"One row of `GET /billing/subscriptions` and the body of\n`GET /billing/subscriptions/{subscription_id}`.\nMirrors every customer-relevant column of the\n`subscriptions` table (migration 0003 `0003_billing_init.sql`)\nprojected to the wire.\n\nExcluded by design:\n- `stripe_invoice_id` — internal billing detail; the customer's\n  invoice record surfaces through the unified payments list,\n  not the subscription read.\n- `crypto_tx_hash` — the canonical reference lives on the\n  matching `crypto_payments` row, surfaced by the crypto-checkout\n  read endpoints.\n\nIncluded although stored externally:\n- `stripe_subscription_id` and `stripe_customer_id` — the same\n  identifiers the customer sees in their Stripe portal; not\n  secrets. Binds only on column names matching\n  `*_password|*_secret|*_token|api_key|...`; Stripe ids are\n  public-by-design correlation handles.\n\n`cancel_at_period_end` is projected to `bool` on the wire; the\nschema column is `INTEGER NOT NULL CHECK IN (0,1)`.","required":["id","org_id","plan_id","billing_cycle","status","started_at","cancel_at_period_end","created_at","updated_at"],"properties":{"billing_cycle":{"type":"string","description":"One of `monthly` / `biweekly` / `annual`\n(`subscriptions.billing_cycle`). The schema CHECK constraint\nguarantees the value is one of those three; the wire keeps\nthe canonical lower-case spelling."},"cancel_at_period_end":{"type":"boolean","description":"`subscriptions.cancel_at_period_end` projected to `bool`.\n`true` after the customer issues\n`DELETE /billing/subscriptions/{id}`; the lifecycle worker\nflips `status` to `expired` when `current_period_end` passes."},"cancelled_at":{"type":["string","null"],"description":"RFC3339 UTC timestamp the customer issued the cancel-at-\nperiod-end action (`subscriptions.cancelled_at`). NULL for\nsubscriptions that have never been cancelled."},"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp (`subscriptions.created_at`)."},"current_period_end":{"type":["string","null"],"description":"RFC3339 UTC timestamp of the current billing period's end\n(`subscriptions.current_period_end`). NULL until the first\npaid invoice ratifies the period boundary."},"grace_until":{"type":["string","null"],"description":"RFC3339 UTC end of the grace window after a payment failure\n(`subscriptions.grace_until`). NULL outside grace."},"id":{"type":"string","description":"UUIDv7 primary key (`subscriptions.id`). RFC4122 string form\non the wire — matches the rest of the IAM read shapes."},"org_id":{"type":"string","description":"Owning org (`subscriptions.org_id`). The caller's principal\nmust hold `billing:subscription:read` against this org for\nthe row to surface."},"payment_method":{"type":["string","null"],"description":"Last-used payment method identifier\n(`subscriptions.payment_method`). NULL for a freshly-created\nsubscription that has not yet seen a successful invoice."},"plan_id":{"type":"string","description":"Plan the subscription is on (`subscriptions.plan_id`).\nJoins to `plans.id`; the catalog read endpoint resolves the\nplan's customer-visible name and price."},"scheduled_change":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ScheduledPlanChange","description":"A plan or cycle change Stripe has scheduled for the end of the\ncurrent period (downgrades and cycle changes). `None` when nothing\nis scheduled."}]},"started_at":{"type":"string","description":"RFC3339 UTC timestamp of subscription start\n(`subscriptions.started_at`). Always populated by the\ncreation path."},"status":{"type":"string","description":"One of `active` / `cancelled` / `expired` / `grace`\n(`subscriptions.status`). The lifecycle worker advances\n`active → grace → expired` on `current_period_end` /\n`grace_until` boundaries; customer-driven cancel sets\n`cancelled` (with `cancel_at_period_end=1`)."},"stripe_customer_id":{"type":["string","null"],"description":"Stripe customer identifier\n(`subscriptions.stripe_customer_id`). NULL for a\ncrypto-payment-only subscription."},"stripe_subscription_id":{"type":["string","null"],"description":"Stripe subscription identifier when the subscription is\nStripe-managed (`subscriptions.stripe_subscription_id`).\nVisible to the customer in their Stripe portal anyway;\nsurfaced here for support correlation."},"updated_at":{"type":"string","description":"RFC3339 UTC last-modified timestamp\n(`subscriptions.updated_at`). The lifecycle worker updates\nthis on every status transition."}}},"SubscriptionSummary":{"type":"object","description":"One subscription of an org the user administers (read-only summary).","required":["id","org_id","status"],"properties":{"id":{"type":"string","description":"Subscription id."},"org_id":{"type":"string","description":"Org id."},"plan":{"type":["string","null"],"description":"Plan name."},"status":{"type":"string","description":"Status."},"stripe_subscription_id":{"type":["string","null"],"description":"Stripe subscription id, when billed through Stripe."}}},"SubscriptionUsageRead":{"type":"object","description":"Wire response for\n`GET /billing/subscriptions/{subscription_id}/usage`.\nPure derived projection — two `UsageCounts`\nblocks plus a bandwidth slice that may be NULL when no\n`bandwidth_quotas` row exists for the subscription. Read-only;\nno audit emit on the GET path.","required":["tunnels","static_ips"],"properties":{"bandwidth":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/BandwidthUsage","description":"Bandwidth usage for the active period. NULL when no\n`bandwidth_quotas` row exists yet for the subscription."}]},"static_ips":{"$ref":"#/components/schemas/UsageCounts","description":"Static IP slot accounting derived from `plans.static_ip_count`,\n`subscription_addons` (type='static_ip', status='active'), and\n`public_ips` row count for `status IN ('reserved','in_use')`."},"tunnels":{"$ref":"#/components/schemas/UsageCounts","description":"Tunnel slot accounting derived from `plans.profile_count`,\n`subscription_addons` (type='tunnel', status='active'), and\n`tunnels` row count."}}},"SuccessorChoice":{"type":"object","description":"A successor chosen for a team (`team_successors` in a deletion\nrequest).","required":["org_id","user_id"],"properties":{"org_id":{"type":"string","format":"uuid","description":"The team."},"user_id":{"type":"string","format":"uuid","description":"The member who becomes its administrator."}}},"SuspendRequest":{"type":"object","description":"Body of `POST /platform/users/{id}/suspend`: suspend the account, and\noptionally its email address, its domain and the addresses it used.","required":["reason"],"properties":{"expires_at":{"type":["string","null"],"format":"date-time","description":"Optional expiry of the email / domain / network suspensions placed\nwith it (staff see it; the person never does). The account\nsuspension itself stays until lifted."},"reason":{"type":"string","description":"Why (shown to staff only)."},"suspend_domain":{"type":"boolean","description":"Also suspend the email's domain (refused for shared mail providers)."},"suspend_email":{"type":"boolean","description":"Also suspend the account's email address (every spelling of it), so\nit cannot sign up again."},"suspend_recent_addresses":{"type":"boolean","description":"Also suspend up to five addresses the account signed in or asked\nfor a reset from in the past week (exempt networks skipped)."}}},"SuspensionCreateRequest":{"type":"object","description":"Body of `POST /platform/suspensions`.","required":["kind","value","reason"],"properties":{"expires_at":{"type":["string","null"],"format":"date-time","description":"Optional expiry; absent = until lifted."},"kind":{"type":"string","description":"`email`, `domain` or `network`."},"reason":{"type":"string","description":"Why (shown to staff only)."},"value":{"type":"string","description":"The address, domain, or network (IP / CIDR)."}}},"SuspensionListItem":{"allOf":[{"$ref":"#/components/schemas/SuspensionRead","description":"The row."},{"type":"object","required":["active"],"properties":{"active":{"type":"boolean","description":"In force now."}}}],"description":"One suspension with its computed state."},"SuspensionListResponse":{"type":"object","description":"`GET /platform/suspensions` response.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SuspensionListItem"},"description":"Suspensions, newest first."},"next_cursor":{"type":["string","null"],"description":"Cursor of the next page; `None` on the last one."}}},"SuspensionRead":{"type":"object","description":"One `abuse_suspensions` row as staff see it.","required":["id","kind","value","reason","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation instant."},"created_by":{"type":["string","null"],"description":"Staff user who placed it."},"expires_at":{"type":["string","null"],"description":"RFC3339 expiry; `None` = until lifted."},"id":{"type":"string","description":"Suspension id (UUIDv7)."},"kind":{"type":"string","description":"`email`, `domain` or `network`."},"reason":{"type":"string","description":"Why it was placed (staff only)."},"revoked_at":{"type":["string","null"],"description":"RFC3339 instant it was lifted, if it was."},"user_id":{"type":["string","null"],"description":"The account it was placed from, when staff suspended a user."},"value":{"type":"string","description":"Normalised email, lowercased domain, or canonical CIDR."}}},"SyncStripeReport":{"type":"object","description":"Response — the per-pass reconciliation counts. The four outcome\ncounts (`updated`, `unchanged`, `not_found_in_stripe`, `errors`) are\ndisjoint and sum to `checked`.","required":["checked","updated","unchanged","not_found_in_stripe","errors","truncated"],"properties":{"checked":{"type":"integer","description":"Stripe-backed subscriptions a Stripe call was attempted for.","minimum":0},"errors":{"type":"integer","description":"Rows whose Stripe call failed (transport fault or non-404 API\nstatus); left untouched and surfaced for operator follow-up.","minimum":0},"not_found_in_stripe":{"type":"integer","description":"Rows Stripe answered `404` for. Left as they are: a wrong key or a\ntest/live mix-up answers the same, so staff check them.","minimum":0},"truncated":{"type":"boolean","description":"`true` ⇒ more than `SYNC_LIMIT` Stripe-backed subscriptions\nexist; only the newest `SYNC_LIMIT` were reconciled this pass."},"unchanged":{"type":"integer","description":"Rows Stripe reported but that already matched locally.","minimum":0},"updated":{"type":"integer","description":"Rows whose status / period-end / cancel-flag / customer changed\nto match Stripe's authoritative state.","minimum":0}}},"SystemSettingsRead":{"type":"object","description":"Read shape for `GET /settings/system` and the `PATCH /settings/system`\n200 response. One field per `system_settings` column with the wire\nnaming preserved 1:1.\n\nLazy-row contract: the row at `id = 1` is created lazily by the\nfirst writer (comment in 0008). A GET against an empty\n`system_settings` table surfaces the column DEFAULTs\n(`maintenance_mode = false`, `signup_enabled = true`,\n`audit_retention_days = 180`, all nullable text fields = `None`,\n`updated_at = \"1970-01-01T00:00:00Z\"`) so the wire shape stays\nuniform regardless of whether a write has happened yet. The\nmatching handler is responsible for the lazy-default\nprojection.\n\n`support_email` is `Option<String>` because the schema column is\nnullable TEXT. Every other column is `NOT NULL` and surfaces as a\nnon-optional field.\n\nThe `site_name` and `public_url` columns are not on the wire: the\nbrand name is fixed, and absolute links are built from\n`Config::passkey_rp_origin`, which must equal the browser origin\nfor passkeys anyway. A second, database-held origin would only be\nable to disagree with it.\n\n`updated_at` is RFC3339 UTC. It is server-stamped on every PATCH\n(via `state.clock.now()`) and read-only — absent from the\nmatching [`SystemSettingsUpdate`] type.","required":["maintenance_mode","signup_enabled","audit_retention_days","analytics_retention_days","bandwidth_sample_retention_days","dns_query_log_retention_days","changelog_webhook_url","updated_at"],"properties":{"agent_release_base_url":{"type":["string","null"],"description":"Base URL of the cosign-signed agent self-update release host.\nNullable TEXT in the schema — `None` means the binary's\ncompiled-in default (`AGENT_RELEASE_CHANNEL`) is used. The\n`agents_binary` handler appends `/<version>/appsynergy-agent-<triple>`."},"analytics_retention_days":{"type":"integer","format":"int64","description":"Analytics retention window in days (`analytics_events` +\n`analytics_sessions` prune cutoff, \"Analytics\nretention\"). Schema CHECK is `>= 1`; the update validator\ncaps at 36500."},"audit_retention_days":{"type":"integer","format":"int64","description":"Audit-event retention window in days. Schema CHECK is\n`audit_retention_days >= 1`; the [`SystemSettingsUpdate`]\nvalidator additionally caps at 36500 (100 years) so a typo\ncan never silently land an absurd retention."},"bandwidth_sample_retention_days":{"type":"integer","format":"int64","description":"Traffic-sample retention window in days\n(`tunnel_traffic_samples` prune cutoff,\n\"Traffic-sample retention\"). Older period totals survive in\n`bandwidth_period_history`. Schema CHECK is `>= 1`."},"changelog_webhook_url":{"$ref":"#/components/schemas/SecretPresence","description":"Presence marker for the changelog-webhook bot URL\n(`changelog_webhook_url_ct`). The URL itself is a bearer-capable\ncredential and is never read back — `set` / `unset`\nis the whole read surface."},"dns_query_log_retention_days":{"type":"integer","format":"int64","description":"DNS query-log retention window in days (`dns_query_logs`\nprune cutoff, \"DNS query-log retention\"). Schema\nCHECK is `>= 1`."},"lead_free_email_domains":{"type":["string","null"],"description":"Operator denylist of free-email provider domains rejected on the\n`/public/leads/enterprise` form, as newline/comma/whitespace-\nseparated domains. Nullable TEXT — `None` means the binary's\ncompiled-in `FREE_EMAIL_DOMAINS` list is used."},"maintenance_mode":{"type":"boolean","description":"`true` when the platform is in maintenance mode. Backed by\nthe schema's `maintenance_mode INTEGER NOT NULL DEFAULT 0\nCHECK (maintenance_mode IN (0, 1))` column; the wire form is\na plain bool and the handlers do the int↔bool\nconversion."},"signup_enabled":{"type":"boolean","description":"`true` when end-user signup is enabled. Backed by the schema's\n`signup_enabled INTEGER NOT NULL DEFAULT 1 CHECK\n(signup_enabled IN (0, 1))` column."},"support_email":{"type":["string","null"],"description":"Customer-facing support email. Nullable TEXT in the schema.\nWhen set, notification emails show it in the footer as the\naddress to write to.\nValidated by [`SystemSettingsUpdate`] when the operator sets\nit; this read-side type carries no validator on the column\nbecause the wire is a projection of server-stored state, not\ncustomer-supplied input."},"updated_at":{"type":"string","description":"RFC3339 UTC timestamp of the last write. Server-stamped on\nevery PATCH; on a fresh deployment with no write yet, the\nhandler surfaces `\"1970-01-01T00:00:00Z\"` so the wire\nshape stays non-optional."}}},"SystemSettingsUpdate":{"type":"object","description":"Request body for `PATCH /settings/system`. Every field is\n`Option<T>` so a JSON object that omits a key leaves the column\nunchanged. An empty-object PATCH (`{}`) is a no-op at the\ncolumn level — only `updated_at` advances.\n\nNullable text columns use `Option<String>`. The matching\nhandler treats an explicit empty string as \"clear to NULL\"\n(i.e. `{\"support_email\": \"\"}` clears `support_email` to NULL); a non-empty\nstring sets the column. Distinguishing \"omit\" from \"explicit\nnull\" without that convention requires an `Option<Option<T>>`\ndouble-option pattern; the empty-string-clears convention is\nstrictly simpler and matches how the dashboard's text inputs\nalready round-trip.\n\n`garde` constraints fire only when the field is `Some(_)` —\n`None` is skipped automatically by the `garde` crate's\n`Option` semantics. So a PATCH that omits `support_email`\ndoes NOT have to pass the `email` constraint.\n\n`updated_at` is server-stamped on every PATCH and is intentionally\nabsent from this type — the wire cannot override the timestamp.","properties":{"agent_release_base_url":{"type":["string","null"],"description":"New `agent_release_base_url`. Validated by `garde`'s `url`\nconstraint when present and non-empty. Empty string clears the\ncolumn to NULL (handler convention) so the handler falls\nback to the compiled-in default."},"analytics_retention_days":{"type":["integer","null"],"format":"int64","description":"New `analytics_retention_days`. Same `1..=36500` envelope as\nthe audit window."},"audit_retention_days":{"type":["integer","null"],"format":"int64","description":"New `audit_retention_days`. Schema CHECK pins `>= 1`; the\nvalidator additionally caps at 36500 (100 years) so a typo\ncan never silently land an absurd retention."},"bandwidth_sample_retention_days":{"type":["integer","null"],"format":"int64","description":"New `bandwidth_sample_retention_days`. Same `1..=36500`\nenvelope as the audit window."},"changelog_webhook_url":{"type":["string","null"],"description":"New changelog-webhook bot URL, plaintext on the wire,\nAEAD-encrypted at rest (`changelog_webhook_url_ct`). Validated\nas a URL when present and non-empty; empty string clears the\ncolumn (bot off). Never echoed back — the read side carries\nonly a [`SecretPresence`] marker."},"dns_query_log_retention_days":{"type":["integer","null"],"format":"int64","description":"New `dns_query_log_retention_days`. Same `1..=36500` envelope\nas the audit window."},"lead_free_email_domains":{"type":["string","null"],"description":"New `lead_free_email_domains` denylist (newline/comma/whitespace-\nseparated domains). Capped at 10000 chars — well above any\nrealistic list. Empty string clears the column to NULL\n(handler convention) so the handler falls back to the compiled-in\nlist."},"maintenance_mode":{"type":["boolean","null"],"description":"New `maintenance_mode` flag. Plain bool on the wire; the\nhandler converts to the schema's `0` / `1` storage form."},"signup_enabled":{"type":["boolean","null"],"description":"New `signup_enabled` flag. Plain bool on the wire."},"support_email":{"type":["string","null"],"description":"New `support_email`. Validated by `garde`'s `email`\nconstraint when present and non-empty. The handler treats an\nexplicit empty string as \"clear to NULL\"; the validator's\n`email` rule rejects empty strings, so the handler's clear\npath runs BEFORE validate (the matching handler PR pins\nthe order)."}}},"TeamOutcome":{"type":"string","description":"What happens to one team.","enum":["leave","transfer","dissolve"]},"TeamPlan":{"type":"object","description":"One team the account belongs to.","required":["org_id","name","role","outcome","candidates"],"properties":{"candidates":{"type":"array","items":{"$ref":"#/components/schemas/Member"},"description":"`transfer` only: who may take it over, longest-standing first."},"name":{"type":"string","description":"Its name."},"org_id":{"type":"string","description":"The team's org id."},"outcome":{"$ref":"#/components/schemas/TeamOutcome","description":"What deleting the account does to it."},"role":{"type":"string","description":"The person's role in it."},"successor":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Member","description":"`transfer` only: who takes it over unless another is chosen."}]}}},"TokenRevokeResponse":{"type":"object","description":"Wire response for `DELETE /iam/tokens/{token_id}`. One-field\nenvelope mirroring `ServiceAccountDeleteResponse` / `OrgDeleteResponse`\n/ `OrgMemberRemoveResponse`. 200 OK on every success path, including\nthe idempotent re-call where the row is already revoked\n(RFC 9110 — DELETE is idempotent at the transport layer).\nSurfaces failure paths (gate-deny 403, missing-row 404) through\n`ApiError` only. Reserved for future structured fields (e.g.,\n`revoked_at`) without contract churn; the audit row is the\ncanonical record of the revoke today.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path (state-change and idempotent\nre-call alike). Present for forward-compatible envelope shape\nrather than as a status flag."}}},"TokenRotateResponse":{"type":"object","description":"Wire response for `POST /iam/tokens/{token_id}/rotate`.\nTwo-field envelope: the unchanged `id` and the freshly minted\nopaque `plaintext` (with the canonical `apk_` prefix from\n`credential::TOKEN_PREFIX_API`). The plaintext is surfaced\nexactly once on this response and never re-exposed on any list /\nread endpoint — `token_list` deliberately omits the\n`token_hash` column from its projection. The audit row never\ncarries the plaintext either; this envelope is the one-and-only\ncarrier from the server.\n\n`id` is intentionally identical to the path's `{token_id}`: the\nrow identity is preserved across rotation, only the secret\nmaterial changes. Returning it makes the caller's read-after-\nrotate one round-trip-free.","required":["id","plaintext"],"properties":{"id":{"type":"string","description":"UUIDv7 identifier of the rotated token row (matches\n`api_tokens.id`). Unchanged from the request path —\nrotation is an in-place secret swap on the existing row."},"plaintext":{"type":"string","description":"The freshly minted opaque API-token plaintext, prefixed\nwith `apk_`. Shown to the caller exactly once; no list /\nread endpoint ever exposes the secret material again."}}},"TopologyDevice":{"type":"object","description":"One device row in a topology snapshot. Projected from\n`client_devices`.","required":["id","device_name","org_id","status"],"properties":{"device_name":{"type":"string","description":"Customer-supplied device name."},"id":{"type":"string","description":"UUIDv7 primary key (`client_devices.id`)."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 timestamp of the device's last heartbeat, if any."},"org_id":{"type":"string","description":"Owning org id."},"status":{"type":"string","description":"`joined`, `paused`, or `revoked`."}}},"TopologyMapAgent":{"type":"object","description":"One fleet agent (system agent) as the map draws it.","required":["id","name","capabilities","status"],"properties":{"capabilities":{"type":"array","items":{"type":"string"},"description":"Declared capability slugs (parsed from the registry row;\nempty when the row predates capability reporting)."},"hostname":{"type":["string","null"],"description":"Reported hostname, if any."},"id":{"type":"string","description":"UUIDv7 `agents.id`."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 of the last heartbeat."},"name":{"type":"string","description":"Operator-assigned agent name."},"reported_version":{"type":["string","null"],"description":"Version the agent last reported."},"status":{"type":"string","description":"`joined` / `paused` / `retired`."}}},"TopologyMapDevice":{"type":"object","description":"One registered client device (mesh/device registry node).","required":["id","org_id","device_name","status"],"properties":{"device_name":{"type":"string","description":"Customer-facing device name."},"id":{"type":"string","description":"UUIDv7 `client_devices.id`."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 of the device's last heartbeat."},"org_id":{"type":"string","description":"Owning org."},"status":{"type":"string","description":"Device lifecycle status."}}},"TopologyMapOrg":{"type":"object","description":"One customer org node with its current-period usage rollup.","required":["id","name","period_bytes_in","period_bytes_out"],"properties":{"id":{"type":"string","description":"UUIDv7 `orgs.id`."},"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"Σ of the org's non-NULL monthly caps; NULL when every\nsubscription is unlimited."},"name":{"type":"string","description":"Org display name."},"period_bytes_in":{"type":"integer","format":"int64","description":"Σ `bandwidth_quotas.bytes_in` across the org's subscriptions\nfor the current billing period."},"period_bytes_out":{"type":"integer","format":"int64","description":"Σ `bandwidth_quotas.bytes_out` across the org's subscriptions\nfor the current billing period."}}},"TopologyMapServer":{"type":"object","description":"One infra server node (WG / QUIC / routing) as the map draws it.","required":["id","name","server_type","location","status","endpoint","mode_mismatch"],"properties":{"agent_id":{"type":["string","null"],"description":"FK to `agents.id` when a unified agent owns this server."},"backend_tier":{"type":["string","null"],"description":"Agent-observed QUIC data-plane tier from the last heartbeat\nthat reported it (`servers.backend_tier`); `None` for non-QUIC\nservers or before the first reporting heartbeat."},"endpoint":{"type":"string","description":"Public endpoint (`host:port`) customers connect to."},"id":{"type":"string","description":"UUIDv7 `servers.id`."},"last_seen_at":{"type":["string","null"],"description":"RFC3339 of the last agent heartbeat that touched this row."},"location":{"type":"string","description":"Operator-facing location label."},"mode_mismatch":{"type":"boolean","description":"Derived target-vs-observed drift: `true` when [`Self::quic_mode`]\nand [`Self::backend_tier`] are both known and disagree — the\nmap's warning-chip signal that a `kernel`-pinned server is\nactually serving the userspace fallback. Always `false` for\nnon-QUIC servers and while the observed tier is still unknown\n(see `platform::quic_server::platform_quic_server_config_types::\nquic_mode_mismatch`)."},"name":{"type":"string","description":"Operator-facing server name."},"pop_id":{"type":["string","null"],"description":"FK to `points_of_presence.id`; `None` on a server seeded\nbefore multi-PoP topology shipped."},"pop_location":{"type":["string","null"],"description":"Hosting PoP's operator-facing location label."},"pop_slug":{"type":["string","null"],"description":"Hosting PoP's stable slug (e.g. `pop-east-1`)."},"quic_mode":{"type":["string","null"],"description":"Operator-pinned QUIC backend target (`servers.quic_mode`,\n`kernel` / `userspace`); `None` for non-QUIC servers."},"server_type":{"type":"string","description":"`servers.type` — `wireguard` / `quic` / routing kinds."},"status":{"type":"string","description":"`online` / `offline` / `error` / `maintenance`."}}},"TopologyMapTunnel":{"type":"object","description":"One customer tunnel edge (device/profile → hosting server).","required":["id","org_id","tunnel_type","status"],"properties":{"allocated_ip":{"type":["string","null"],"description":"Overlay address inside the hosting server's pool."},"datagrams_in":{"type":["integer","null"],"format":"int64","description":"Most recent client-reported inbound QUIC datagram count\n(`None` for WireGuard tunnels, which have no datagram concept)."},"datagrams_out":{"type":["integer","null"],"format":"int64","description":"Most recent client-reported outbound QUIC datagram count."},"id":{"type":"string","description":"UUIDv7 `tunnels.id`."},"last_bytes_in":{"type":["integer","null"],"format":"int64","description":"Lifetime kernel bytes received from the peer at the last\npeer-status beat; rate = Δ across snapshots."},"last_bytes_out":{"type":["integer","null"],"format":"int64","description":"Lifetime kernel bytes sent to the peer at the last\npeer-status beat; rate = Δ across snapshots."},"last_handshake":{"type":["string","null"],"description":"RFC3339 of the most recent WG handshake — the map's\nconnected-right-now signal (fresh = handshake < 3 min)."},"org_id":{"type":"string","description":"Owning org (map groups tunnels under their customer)."},"packet_loss_pct":{"type":["number","null"],"format":"double","description":"Most recent client-reported packet-loss percentage from the\ntunnel's newest `client_connections` row."},"platform":{"type":["string","null"],"description":"Customer-supplied platform label (`linux` / `ios` / …)."},"pq_negotiated":{"type":["boolean","null"],"description":"Whether the last QUIC handshake negotiated the post-quantum\nhybrid KEM; `None` for WireGuard tunnels or a QUIC tunnel with\nno observed handshake yet."},"profile_name":{"type":["string","null"],"description":"Customer-supplied profile name, if any."},"rtt_ms":{"type":["integer","null"],"format":"int64","description":"Most recent client-reported round-trip time (ms) from the\ntunnel's newest `client_connections` row."},"server_id":{"type":["string","null"],"description":"Hosting server; NULL when not yet pinned."},"status":{"type":"string","description":"`active` / `inactive` / `pending`."},"streams_open":{"type":["integer","null"],"format":"int64","description":"Most recent client-reported open-QUIC-stream count."},"tunnel_type":{"type":"string","description":"`wireguard` / `quic`."}}},"TotpChallengeRequest":{"type":"object","description":"`POST /auth/2fa/challenge` request — completes a login whose\npassword leg passed but which was gated by a confirmed TOTP\nenrollment. `challenge_id` is the opaque continuation handed back\nby `/auth/login`.","required":["challenge_id","code"],"properties":{"challenge_id":{"type":"string","description":"The `totp_challenges` row id returned by `/auth/login`."},"code":{"type":"string","description":"6-digit TOTP code."}}},"TotpDisableResponse":{"type":"object","description":"`POST /auth/2fa/disable` 200 body.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on success; failure paths surface as `ApiError`."}}},"TotpEnrollResponse":{"type":"object","description":"`POST /auth/2fa/enroll` 200 body — the data a client needs to\nrender the QR and offer a manual-entry fallback. The secret is\nshown exactly once here (enrollment); it is never echoed again.","required":["otpauth_url","secret","qr_svg"],"properties":{"otpauth_url":{"type":"string","description":"`otpauth://totp/...` provisioning URI for the QR code."},"qr_svg":{"type":"string","description":"The `otpauth_url` as a self-contained SVG QR code, so the console\nrenders it without a client-side QR library or a third party."},"secret":{"type":"string","description":"Base32 secret for manual entry (authenticator \"enter a key\")."}}},"TotpVerifyEnrollmentRequest":{"type":"object","description":"`POST /auth/2fa/verify-enrollment` request — the 6-digit code from\nthe authenticator app, confirming the QR was scanned.","required":["code"],"properties":{"code":{"type":"string","description":"6-digit TOTP code. Length-bounded at the boundary;\nnon-numeric / wrong codes fail verification, not validation."}}},"TotpVerifyEnrollmentResponse":{"type":"object","description":"`POST /auth/2fa/verify-enrollment` 200 body.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on success; failure paths surface as `ApiError`."}}},"Traits":{"type":"object","description":"What the browser reports about itself. Every field is optional on the\nwire: an absent one reads as empty or zero.","properties":{"cores":{"type":"integer","format":"int32","description":"`navigator.hardwareConcurrency`.","minimum":0},"dpr":{"type":"integer","format":"int32","description":"`devicePixelRatio` times 100.","minimum":0},"languages":{"type":"string","description":"`navigator.languages`, comma separated."},"platform":{"type":"string","description":"`navigator.platform`."},"screen_h":{"type":"integer","format":"int32","description":"`screen.height`, CSS pixels.","minimum":0},"screen_w":{"type":"integer","format":"int32","description":"`screen.width`, CSS pixels.","minimum":0},"touch":{"type":"integer","format":"int32","description":"`navigator.maxTouchPoints`.","minimum":0},"tz_offset":{"type":"integer","format":"int32","description":"Minutes west of UTC (`Date.prototype.getTimezoneOffset`)."}}},"TunnelBandwidthOverride":{"type":"object","description":"Wire response for\n`GET /vpn/tunnels/{tunnel_id}/bandwidth-override`\n(the customer read-side surface\n\"Per-tunnel bandwidth overrides\"). Mirrors one row of\n`tunnel_bandwidth_overrides` (migration 0063). 404 is\nthe wire shape when no override row exists for the tunnel —\nthe handler body returns no envelope in that case.\n\n`monthly_limit_bytes` is `Option<i64>` because the schema\ncolumn is nullable (NULL = unlimited; a row exists but sets no\nceiling of its own — meaningful only when paired with\n`included_at_subscription_level = 0` to carve the tunnel out\nof the team pool). The wire serialises NULL as JSON `null` so\nfrontends distinguish \"uncapped override row\" from \"0-byte\noverride\" (the latter would be a non-null `0`).\n\n`included_at_subscription_level` ships as `i64` rather than\n`bool` to match the schema column verbatim; the column carries\na CHECK IN (0, 1) constraint so callers can interpret 0 / 1\ndirectly. Mirrors the `bytes_used` / `monthly_limit_bytes`\ninteger-shape precedent in `ProtocolUsageItem`.","required":["tunnel_id","included_at_subscription_level","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 timestamp of when this override row was created."},"included_at_subscription_level":{"type":"integer","format":"int64","description":"Double-counting flag\n(`tunnel_bandwidth_overrides.included_at_subscription_level`).\n`1` ⇒ this tunnel's bytes also accrue against the parent\nsubscription's `bandwidth_quotas` counters (override adds\na tighter ceiling without carving the tunnel out of the\nteam pool). `0` ⇒ this tunnel's bytes count ONLY against\nits own override (carved out from the subscription pool)."},"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"Cap on total bytes for this tunnel within its\nsubscription's active period\n(`tunnel_bandwidth_overrides.monthly_limit_bytes`). NULL =\nunlimited; the evaluator worker does not emit a\ndrop rule for a NULL row regardless of bytes accrued."},"tunnel_id":{"type":"string","description":"UUIDv7 string of the tunnel this override row applies to\n(`tunnel_bandwidth_overrides.tunnel_id`). Echoes the\n`{tunnel_id}` path parameter back to the caller for\nfrontend correlation."},"updated_at":{"type":"string","description":"RFC3339 timestamp of when this override row was last\nmodified by the matching admin PATCH."}}},"TunnelBandwidthOverrideDeleteResponse":{"type":"object","description":"Wire response for\n`DELETE /vpn/tunnels/{tunnel_id}/bandwidth-override`\n(the customer-tier off-switch slice\n\"Per-tunnel bandwidth overrides\"). One-field envelope `{ ok:\ntrue }` mirroring `OrgAssumeGrantDeleteResponse` /\n`OrgResourceGrantDeleteResponse` /\n`OrgCustomRoleDeleteResponse` /\n`OrgSsoProviderDeleteResponse` /\n`OrgPolicyConditionDeleteResponse` precedent. 200 OK on the\nsuccess path; surfaces failure paths (gate-deny 403,\nmissing-row 404, unauth 401) through `ApiError` only.\nReserved for forward-compatible structured fields without\ncontract churn — the audit row carries the full removed shape.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path. Present for\nforward-compatible envelope shape rather than as a status\nflag."}}},"TunnelBandwidthOverrideUpdateRequest":{"type":"object","description":"Wire request body for\n`PATCH /vpn/tunnels/{tunnel_id}/bandwidth-override`\n(the customer-tier upserter slice\n\"Per-tunnel bandwidth overrides\"). Sets\n`tunnel_bandwidth_overrides.monthly_limit_bytes` +\n`tunnel_bandwidth_overrides.included_at_subscription_level`\non the per-tunnel override row, inserting one if absent.\n\nBoth fields are required in the request body — PATCH\nsemantics here are full-row replace on upsert (the row\ncarries only two state columns and the upsert path needs\nvalues for both anyway). Mirrors `ProtocolQuotaUpdateRequest`'s\none-shot replace shape rather than a partial/merge PATCH.\n\n`monthly_limit_bytes` is `Option<i64>` to mirror the schema\ncolumn (NULLable). `None` ⇒ the row's column becomes NULL\n(unlimited; the evaluator worker emits no drop rule for\na NULL row regardless of bytes accrued). `Some(n)` ⇒ that cap.\nThe validator forbids negative values (a negative cap is\nmeaningless and would produce a permanently-tripped quota —\nreject at the wire boundary). `0` is admitted (\"drop all\ntraffic on this tunnel\") so the org_admin can quarantine a\ntunnel without deleting the row, mirroring\n`ProtocolQuotaUpdateRequest`'s precedent.\n\n`included_at_subscription_level` is `i64` (not `bool`) to\nmatch the schema column verbatim. The validator pins it to\n`0..=1` so 422 short-circuits before the DB round trip — the\nschema CHECK exists as a structural guard against direct\nwrites, not as the validation entry point.","required":["included_at_subscription_level"],"properties":{"included_at_subscription_level":{"type":"integer","format":"int64","description":"Double-counting flag. `1` ⇒ this tunnel's bytes also\naccrue against the parent subscription's\n`bandwidth_quotas` counters (override adds a tighter\nceiling without carving the tunnel out of the team pool).\n`0` ⇒ this tunnel's bytes count ONLY against its own\noverride (carved out from the subscription pool). Pinned\nto `0..=1` at the wire boundary to mirror the schema's\nCHECK constraint."},"monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"New cap on monthly bytes for this tunnel within its\nsubscription's active period. `null` sets the column to\nNULL (unlimited); a non-negative integer sets that cap.\n`0` is admitted (drops all traffic on this tunnel) so the\norg_admin can quarantine a tunnel without deleting the\nrow."}}},"TunnelCreateRequest":{"type":"object","description":"Request body for `POST /vpn/tunnels`. The server generates the WireGuard\nkey pair, allocates an internal IP, and creates both the `tunnels` and\n`wireguard_tunnels` rows inside one transaction.","required":["subscription_id"],"properties":{"path_tier_id":{"type":["string","null"],"description":"Optional network-path tier the customer intends to use for this\ntunnel. When present it must be a UUIDv7\n(`invalid_path_tier_id` → 400) and is checked for eligibility\nagainst the subscription's plan via `plan_path_tiers` plus the\n`subscriptions.allow_overages` gate: a tier the plan does not\ngrant returns 422 `tier_not_in_plan`; an overage-available tier\nwhen overages are off returns 422 `overages_not_enabled`. This\nis a fail-fast eligibility check only — a bare WireGuard tunnel\nhas no `bindings` row, so nothing is persisted here; the durable\nper-binding tier selection happens at `POST /static-ips/{id}/bind`\nand `PATCH /static-ips/{id}`. No validator attr — the UUID parse\nhappens in the handler, mirroring `subscription_id` / `server_id`."},"platform":{"type":["string","null"],"description":"OS / platform tag (e.g. \"macos\", \"linux\", \"windows\", \"ios\",\n\"android\"). Max 64 characters; free-form."},"preset_slug":{"type":["string","null"],"description":"Optional preset slug (the customer-facing 5-button picker).\nThe server resolves the slug to its underlying tier via\n`network_path_tier_presets` (unknown/inactive ⇒ 422\n`preset_not_found`) and runs the same plan/overage eligibility\ncontract as `path_tier_id` on the expanded tier. Mutually\nexclusive with `path_tier_id` (both present ⇒ 400\n`tier_and_preset_exclusive`). This is a fail-fast eligibility gate\nonly: a bare WireGuard tunnel has no `bindings` row, so nothing is\npersisted — no `preset_slug`, no `qos_rules`, no default-`simple`\n(the default applies only to binding creation at\n`POST /static-ips/{id}/bind`). The durable preset selection\nhappens there. No validator attr — slug lookup is in the handler."},"profile_name":{"type":["string","null"],"description":"Human-readable label for this tunnel (e.g. \"Work Laptop\").\nMax 128 characters. Stored in `wireguard_tunnels.profile_name`."},"server_id":{"type":["string","null"],"description":"WireGuard server to provision on. When absent, the handler picks\nthe server with the lowest load that `allow_static_ips = 1` for\nthe subscription's plan (or the highest-capacity server\notherwise). Must be `status = 'online'` if specified."},"subscription_id":{"type":"string","description":"Subscription to create the tunnel under. Must be owned by the\ncaller's org. The subscription's `bandwidth_quotas` row is\nchecked for soft enforcement before the row is written\n(409 `bandwidth_exhausted` when over the monthly limit)."},"use_case":{"type":["string","null"],"description":"Usage-category tag (e.g. \"personal\", \"work\"). Max 64 characters;\nfree-form."}}},"TunnelDeleteResponse":{"type":"object","description":"Response body for `DELETE /vpn/tunnels/{id}`. Returns `{ ok: true }`\non success (mirrors the pattern used by other delete endpoints in the\nplatform). Any active binding is soft-transitioned to `removing`\n(the routing agent will remove the nft rule); the bound public IP\nremains `status = 'reserved'` until explicitly released.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the 200 success path."}}},"TunnelListResponse":{"type":"object","description":"Response body for `GET /vpn/tunnels`.","required":["tunnels"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor token for the next page. `null` when this is the\nlast page."},"tunnels":{"type":"array","items":{"$ref":"#/components/schemas/TunnelRead"},"description":"Page of tunnel records, ordered by `created_at DESC, id DESC`."}}},"TunnelQrRead":{"type":"object","description":"Response body for `GET /vpn/tunnels/{id}/qr`. A PNG image of the\nWireGuard config encoded as a QR code, base64-encoded for JSON\ntransport. The caller can render it as `<img src=\"data:image/png;\nbase64,<png_base64>\">`.","required":["png_base64"],"properties":{"png_base64":{"type":"string","description":"Base64-standard-encoded PNG image of the WireGuard config QR code."}}},"TunnelRead":{"type":"object","description":"Wire response for `GET /vpn/tunnels` (list items) and\n`GET /vpn/tunnels/{id}` (single fetch). Mirrors the JOIN of\n`tunnels` + `wireguard_tunnels` + an optional active-binding lookup\nfor the bound public IP + an optional `dns_assignments` lookup for\nthe assigned DNS server.","required":["id","org_id","subscription_id","tunnel_type","profile_number","status","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation timestamp."},"dns_server":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/DnsServerRef","description":"DNS server assigned to this tunnel (most specific) or its parent\nsubscription (less specific). `null` when both are unset and the\ntunnel uses the system-default resolver."}]},"id":{"type":"string","description":"UUIDv7 primary key (`tunnels.id`)."},"org_id":{"type":"string","description":"Owning org (`tunnels.org_id`)."},"profile_number":{"type":"integer","format":"int64","description":"Monotonically increasing slot index within the subscription\n(`tunnels.profile_number`). Unique per subscription."},"public_ip":{"type":["string","null"],"description":"Currently bound public IP address. `null` when no active binding\nexists (the tunnel is unbound or the binding is still `pending`)."},"server_id":{"type":["string","null"],"description":"WireGuard/QUIC server this tunnel is provisioned on\n(`tunnels.server_id`). `null` when the server row was deleted\n(ON DELETE SET NULL)."},"status":{"type":"string","description":"Lifecycle status (`tunnels.status`). Values:\n`\"active\"`, `\"inactive\"`, `\"pending\"`."},"subscription_id":{"type":"string","description":"Parent subscription (`tunnels.subscription_id`)."},"tunnel_type":{"type":"string","description":"Tunnel protocol (`tunnels.type`). `\"wireguard\"` or `\"quic\"`."},"updated_at":{"type":"string","description":"RFC3339 last-updated timestamp."},"wireguard":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/WireguardDetails","description":"WireGuard-specific fields. `null` for QUIC tunnels."}]}}},"TunnelRegenerateResponse":{"type":"object","description":"Response body for `POST /vpn/tunnels/{id}/regenerate`. Returns the\nnew public key and the (unchanged) allocated IP so the caller can\nre-download the config or display the new public key without a\nseparate GET.","required":["id","public_key","allocated_ip"],"properties":{"allocated_ip":{"type":"string","description":"Internal IP (unchanged by regeneration — the IP stays allocated)."},"id":{"type":"string","description":"UUIDv7 id of the tunnel (echoed for correlation)."},"public_key":{"type":"string","description":"New WireGuard public key after key rotation."}}},"TunnelUsageHistoryItem":{"type":"object","description":"One daily bucket in `GET /vpn/tunnels/{id}/usage/history`.\nSourced from `tunnel_traffic_samples` rows for this tunnel,\nordered by `period_start DESC`.","required":["period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Bytes received in this period."},"bytes_out":{"type":"integer","format":"int64","description":"Bytes sent in this period."},"period_end":{"type":"string","description":"RFC3339 end of this sample period."},"period_start":{"type":"string","description":"RFC3339 start of this sample period."}}},"TunnelUsageHistoryResponse":{"type":"object","description":"Response body for `GET /vpn/tunnels/{id}/usage/history`.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TunnelUsageHistoryItem"},"description":"Ordered by `period_start DESC` (newest first)."},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` on the last page."}}},"TunnelUsageRead":{"type":"object","description":"Response body for `GET /vpn/tunnels/{id}/usage`. Returns the\ncurrent-period byte counters for this tunnel plus the parent\nsubscription's monthly cap for context.","required":["period_start","period_end","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Bytes received by the tunnel in the current period\n(`tunnel_traffic_samples.bytes_in` sum)."},"bytes_out":{"type":"integer","format":"int64","description":"Bytes sent by the tunnel in the current period\n(`tunnel_traffic_samples.bytes_out` sum)."},"period_end":{"type":"string","description":"RFC3339 end of the active quota period."},"period_start":{"type":"string","description":"RFC3339 start of the active quota period."},"subscription_monthly_limit_bytes":{"type":["integer","null"],"format":"int64","description":"Subscription-level monthly cap from `bandwidth_quotas\n.monthly_limit_bytes`. `null` means unlimited."}}},"TwoFactorRequiredResponse":{"type":"object","description":"`/auth/login` 200 body when the user has a confirmed TOTP\nenrollment: no session is minted yet — the client must call\n`/auth/2fa/challenge` with `challenge_id` + a code.","required":["twofa_required","challenge_id"],"properties":{"challenge_id":{"type":"string","description":"Opaque `totp_challenges` row id to present to\n`/auth/2fa/challenge`."},"twofa_required":{"type":"boolean","description":"Always `true` — discriminates this body from `LoginResponse`."}}},"UpdateNotificationPreferencesRequest":{"type":"object","description":"`PATCH /auth/notifications/preferences` request. A sparse list:\nonly the kinds the caller wants to change need appear; absent kinds\nkeep their current stored (or default) value. An unknown `kind`\nslug is rejected `400 bad_request` by the handler (the typed shape\nalone cannot express \"must be one of the 14\", so the check is in\nthe handler, not a `garde` derive).","required":["preferences"],"properties":{"preferences":{"type":"array","items":{"$ref":"#/components/schemas/KindPref"},"description":"Kinds to update. May be empty (accepted as a 200 no-op so the\nshape is uniform with the empty-PATCH idiom elsewhere)."}}},"UpdateUserProfileRequest":{"type":"object","description":"Request body for `PATCH /auth/me`. Both fields optional;\nabsent fields leave the column unchanged (no implicit clear). A\nrequest with neither field set is accepted as a no-op 200 — the\nshape is uniform with the empty-body PATCHes elsewhere in the\ncodebase.","properties":{"avatar":{"type":["string","null"],"description":"Replacement avatar: a key from the built-in library\n([`crate::platform::auth::avatars::AVATAR_KEYS`]); anything else\nis rejected with `invalid_avatar`. `Some(\"\")` clears it back to\nthe initials default."},"name":{"type":["string","null"],"description":"Replacement display name; `Some(\"\")` rewrites to NULL (clears\nthe column). The non-empty form bounds at 200 chars to match\nsignup's `name` cap (`SignupRequest::name`)."}}},"UsageCounts":{"type":"object","description":"One usage-counter block in [`SubscriptionUsageRead`] — the\n`{plan, addon, total, used, available}` quintuple shared between\nthe `tunnels` and `static_ips` views. All\ncounters are signed `i64`: `available` MAY be negative when the\ncaller has overshot their allotment (e.g. an admin manually\ngranted an addon then revoked it while the slots stayed in use).\nSurfacing the negative value rather than clamping to 0 lets the\nfrontend draw an explicit \"over-allocated\" warning instead of\nsilently rendering as \"0 available.\"\n\nField semantics:\n- `plan` — the per-subscription cap baked into the catalog plan\n  (`plans.profile_count` for tunnels, `plans.static_ip_count`\n  for static IPs).\n- `addon` — the sum of `subscription_addons.quantity` across\n  active addons of the matching `type`. Cancelled addons do NOT\n  count.\n- `total` — `plan + addon`.\n- `used` — count of active rows in the underlying product table\n  currently consuming a slot (`tunnels` rows for the subscription;\n  `public_ips` rows in `reserved` or `in_use`).\n- `available` — `total - used`. Signed; see above.","required":["plan","addon","total","used","available"],"properties":{"addon":{"type":"integer","format":"int64","description":"Sum of active addon quantities of the matching type."},"available":{"type":"integer","format":"int64","description":"`total - used`. Signed: surfaces over-allocation as a negative\nnumber rather than clamping to zero."},"plan":{"type":"integer","format":"int64","description":"Per-subscription cap baked into the catalog plan."},"total":{"type":"integer","format":"int64","description":"`plan + addon`."},"used":{"type":"integer","format":"int64","description":"Slots currently consumed."}}},"UserIdentity":{"type":"object","description":"Identity and status.","required":["id","email","created_at"],"properties":{"closed_at":{"type":["string","null"],"description":"Deletion (closing) instant, if deleted and not yet erased."},"closed_reason":{"type":["string","null"],"description":"Why it was deleted."},"created_at":{"type":"string","description":"RFC3339 sign-up instant."},"deleted_at":{"type":["string","null"],"description":"Deletion instant, if deleted."},"email":{"type":"string","description":"Login email."},"email_norm":{"type":["string","null"],"description":"Normalised mailbox (abuse comparisons)."},"id":{"type":"string","description":"User id."},"last_sign_in_at":{"type":["string","null"],"description":"Last interactive sign-in."},"name":{"type":["string","null"],"description":"Display name."},"purge_after":{"type":["string","null"],"description":"When a deleted account is erased."},"suspended_at":{"type":["string","null"],"description":"Account suspension instant, if suspended."},"suspended_reason":{"type":["string","null"],"description":"Staff's reason for the suspension."}}},"UserOverview":{"type":"object","description":"`GET /platform/users/{id}/overview`.","required":["identity","holds_platform_role","live_paid_subscription","orgs","subscriptions","sessions","devices","sign_in","events","suspensions"],"properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/DeviceRow"},"description":"Client devices."},"events":{"type":"array","items":{"$ref":"#/components/schemas/SecurityEvent"},"description":"Recent security events, newest first."},"holds_platform_role":{"type":"boolean","description":"Account holds a platform role."},"identity":{"$ref":"#/components/schemas/UserIdentity","description":"Identity and status."},"live_paid_subscription":{"type":"boolean","description":"An org it administers holds a live Stripe subscription."},"orgs":{"type":"array","items":{"$ref":"#/components/schemas/OrgRole"},"description":"Organisations and roles."},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/SessionRow"},"description":"Live sessions."},"sign_in":{"$ref":"#/components/schemas/SignInMethods","description":"Sign-in methods."},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionSummary"},"description":"Subscriptions of orgs it administers."},"suspensions":{"type":"array","items":{"$ref":"#/components/schemas/SuspensionRead"},"description":"Email / domain / network suspensions placed from this account,\nnewest first (history included)."}}},"UserProfile":{"type":"object","description":"Response body for `GET /auth/me`. Projects the resolved\nprincipal's `users` row onto the wire shape the dashboard renders\nagainst. Cross-user isolation is structural — the SELECT keys on the\nresolved principal's `user_id`; a soft-deleted row collapses\nto 401 (`Unauthorized`) at the handler so the caller's stale credential\nis invalidated cleanly.","required":["id","email","passkey_enabled","enforce_passkey","default_org_id","is_platform_admin","two_factor_enabled"],"properties":{"avatar":{"type":["string","null"],"description":"`users.avatar` — a key from the built-in avatar library\n([`crate::platform::auth::avatars::AVATAR_KEYS`]). `None` when\nunset: the console draws initials on a colour from the user id."},"default_org_id":{"type":"string","description":"The principal's currently active org, resolved per-request as\nthe user's explicit pick (`users.selected_org_id`, set via\n`POST /auth/me/active-org`) when it is still a current\nmembership, else the earliest membership (the personal org from\nthe `users_create_personal_org` trigger). The workspace switcher\nlists choices via `GET /auth/me/orgs`."},"email":{"type":"string","description":"`users.email` — RFC 5322 address. Read-only on this surface;\nre-verification flow lives once the change handler ships."},"enforce_passkey":{"type":"boolean","description":"`users.enforce_passkey` — toggled by `PATCH /auth/passkey/settings`.\nWhen true, password-only login is rejected."},"id":{"type":"string","description":"`users.id` — UUIDv7 of the user row."},"is_platform_admin":{"type":"boolean","description":"True when the user holds the cross-org `platform_admin` role.\nThe customer chrome reveals the Platform (staff) nav entry on\nthis flag; every platform API call is still authorized\nserver-side, so the boolean is a UI affordance, not an\nenforcement point. Computed per-request via\n[`crate::platform::iam::require::user_is_platform_admin`]."},"name":{"type":["string","null"],"description":"`users.name` — optional display name. `None` when the column is\nNULL (signup without a `name` body, never written since)."},"passkey_enabled":{"type":"boolean","description":"`users.passkey_enabled` — flips when the registration handler\ninserts the user's first credential and back when the\ndelete handler removes the last."},"two_factor_enabled":{"type":"boolean","description":"True when the user has a confirmed authenticator-app (TOTP)\nenrollment, so sign-in asks for a code after the password."}}},"Value":{},"VerifyMagicLinkRequest":{"type":"object","description":"Request body of `POST /auth/verify_magic_link`.","required":["credentials"],"properties":{"client_attestation":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ClientAttestation","description":"The solved human-check challenge (`POST /auth/challenge`)."}]},"credentials":{"$ref":"#/components/schemas/MagicLinkCredentials","description":"The link or the code."}}},"VerifyMagicLinkResponse":{"type":"object","description":"Response of `POST /auth/verify_magic_link`.","required":["status"],"properties":{"challenge_id":{"type":["string","null"],"description":"Second-factor challenge to complete."},"redirect":{"type":["string","null"],"description":"Path to open after logging in."},"status":{"type":"string","description":"`logged_in`: the session cookie is set. `two_factor`: continue with\n`POST /auth/2fa/challenge` and `challenge_id`."}}},"VpnServerListResponse":{"type":"object","description":"Response body for `GET /vpn/servers`.","required":["servers"],"properties":{"servers":{"type":"array","items":{"$ref":"#/components/schemas/VpnServerRead"},"description":"All non-offline servers ordered by `location ASC, id ASC`."}}},"VpnServerRead":{"type":"object","description":"One WireGuard server row as returned by the anonymous public catalog.","required":["id","name","location","status","allow_static_ips"],"properties":{"allow_static_ips":{"type":"boolean","description":"Whether static IPs can be bound to tunnels on this server."},"id":{"type":"string","description":"Server primary key."},"location":{"type":"string","description":"City / data-centre location label (e.g. `\"Amsterdam, NL\"`)."},"name":{"type":"string","description":"Human-readable server display name."},"region":{"type":["string","null"],"description":"Optional continent / region label (e.g. `\"Europe\"`)."},"status":{"type":"string","description":"Operational status: `\"online\"`, `\"offline\"`, `\"error\"`,\nor `\"maintenance\"`."}}},"WebhookAck":{"type":"object","description":"Standard 200 response emitted by both webhook handlers. Stripe and most\ncrypto processors expect any 2xx to acknowledge receipt; the body is\ninformational only.","required":["received"],"properties":{"received":{"type":"boolean","description":"Always `true` in a successful acknowledgement."}}},"WebhookCreateRequest":{"type":"object","description":"`POST /webhooks` body.","required":["url","kinds"],"properties":{"kinds":{"type":"array","items":{"type":"string"},"description":"Event kinds to deliver. Non-empty; each must be in\n[`ALLOWED_WEBHOOK_KINDS`] (checked in the handler)."},"org_id":{"type":["string","null"],"format":"uuid","description":"The org the endpoint belongs to. Omit to use the caller's\nselected workspace (an API token's or service account's own org)."},"url":{"type":"string","description":"Destination — must be an `https://` URL (plaintext HTTP is\nrejected: a signed payload over cleartext defeats the point)."}}},"WebhookCreateResponse":{"allOf":[{"$ref":"#/components/schemas/WebhookRead","description":"The created endpoint."},{"type":"object","required":["secret"],"properties":{"secret":{"type":"string","description":"HMAC signing secret — shown once, stored AEAD-encrypted, never\nreturned again."}}}],"description":"`POST /webhooks` response — the **only** time the signing secret\nis on the wire. The customer stores it to verify the\n`X-Appsynergy-Signature: t=<unix>,v1=<hex>` HMAC on each delivery\n(HMAC-SHA256 over `\"<t>.<body>\"`; refuse a stale `t`)."},"WebhookDeleteResponse":{"type":"object","description":"`DELETE /webhooks/{id}` response.","required":["ok"],"properties":{"ok":{"type":"boolean","description":"Always `true` on the success path."}}},"WebhookListResponse":{"type":"object","description":"`GET /webhooks` envelope (single-array; this has no pagination\nrequirement — an org's webhook count is operationally tiny).","required":["webhooks"],"properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookRead"},"description":"The caller-org's webhook endpoints."}}},"WebhookRead":{"type":"object","description":"Read projection — never includes the secret.","required":["id","org_id","url","url_redacted","kinds","status","created_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 creation instant."},"id":{"type":"string","description":"`customer_webhooks.id` (UUIDv7)."},"kinds":{"type":"array","items":{"type":"string"},"description":"Subscribed event kinds."},"last_dispatched_at":{"type":["string","null"],"description":"RFC3339 of the last successful delivery, or null."},"org_id":{"type":"string","description":"The org the endpoint belongs to."},"status":{"type":"string","description":"`active` | `disabled`."},"url":{"type":"string","description":"Destination URL. Shown in full only to a caller who may update\nthe endpoint (`webhooks:endpoint:update`); anyone else sees\nscheme and host with the rest replaced by `…`, because webhook\nURLs often carry a secret in the path or query."},"url_redacted":{"type":"boolean","description":"`true` when `url` was shortened for a read-only caller."}}},"WebhookUpdateRequest":{"type":"object","description":"`PATCH /webhooks/{id}` body — every field optional (partial\nupdate). `status` is `active` | `disabled`.","properties":{"kinds":{"type":["array","null"],"items":{"type":"string"},"description":"Replacement kind set, or omit to leave unchanged."},"status":{"type":["string","null"],"description":"`active` | `disabled`, or omit to leave unchanged."},"url":{"type":["string","null"],"description":"New destination URL, or omit to leave unchanged."}}},"WgPeerStatus":{"type":"object","description":"One per-peer report from the WG agent — a parsed\n`wg show <iface> dump` peer line.","required":["public_key","bytes_in","bytes_out"],"properties":{"bytes_in":{"type":"integer","format":"int64","description":"Absolute bytes received from this peer since its kernel\nentry was created (`wg` dump `transfer-rx`)."},"bytes_out":{"type":"integer","format":"int64","description":"Absolute bytes sent to this peer since its kernel entry\nwas created (`wg` dump `transfer-tx`)."},"last_handshake_at":{"type":["string","null"],"format":"date-time","description":"RFC3339 UTC timestamp of the peer's most recent handshake.\n`None` when the kernel reports no handshake yet (dump\ncolumn `0`); the stored value keeps its prior state."},"public_key":{"type":"string","description":"The peer's full base64 WireGuard public key, matched\nexactly against `wireguard_tunnels.public_key` for tunnels\nhosted on the caller's server."}}},"WgSubscriber":{"type":"object","description":"One peer entry in the subscriber list. The agent renders\nthese into its `wg syncconf` config; ordering is stable so a\nno-op re-fetch produces a byte-identical config (idempotent\n`wg syncconf`).","required":["public_key","allowed_ips","overlay_ip","static_public_ips"],"properties":{"allowed_ips":{"type":"array","items":{"type":"string"},"description":"CIDRs this peer is allowed to send/receive. Today this\nis the single `<allocated_ip>/32`; future per-tunnel\nsubnet routes append additional entries here without a\nschema migration on the wire type."},"overlay_ip":{"type":"string","description":"The peer's own overlay address, sent explicitly because\n`allowed_ips` also carries device overlay addresses and\napproved subnet routes — position in that list is not\nidentity. The agent keys its NAT rules on this."},"public_key":{"type":"string","description":"The peer's WG public key. The same value the customer\npasted into the client `.conf`."},"static_public_ips":{"type":"array","items":{"type":"string"},"description":"Public addresses bound to this peer's tunnel, sorted. Each\none makes the peer egress as that address rather than as\nthe server's own (see the agent's `capabilities::wg_nat`).\nEmpty ⇒ a NAT peer, which egresses as the server."}}},"WireguardConfigRead":{"type":"object","description":"Response body for `GET /vpn/tunnels/{id}/config`. The `config` field\ncontains the WireGuard INI-style config ready to write to a `.conf`\nfile or pipe to `wg-quick up`. The private key IS included here\n(this is the only endpoint that surfaces it — the caller must\ntransport this securely). Returns `404` when the tunnel has no\nserver assignment.","required":["config","filename"],"properties":{"config":{"type":"string","description":"Full WireGuard config text (`[Interface] / [Peer]` sections)."},"filename":{"type":"string","description":"Filename hint for the download dialog. Typically\n`\"appsynergy-<profile_name>.conf\"` or `\"appsynergy-<id>.conf\"`."}}},"WireguardDetails":{"type":"object","description":"WireGuard-specific fields nested inside [`TunnelRead`] when\n`tunnel.type = 'wireguard'`. Absent (`null`) for QUIC tunnels.\nThe `private_key` column of `wireguard_tunnels` is **never**\nincluded in any response — callers download the full WG config via\n`GET /vpn/tunnels/{id}/config`.","required":["public_key","allocated_ip","key_origin"],"properties":{"allocated_ip":{"type":"string","description":"Internal IP allocated to this tunnel (`/32` within the server's\nVPN subnet). This is the `destination_ip` field in bindings."},"key_origin":{"type":"string","description":"Which side generated the keypair (`wireguard_tunnels.key_origin`,\nmigration 0214). `\"server\"` — the server holds the private key and\nthe customer downloads a config / QR for stock WireGuard.\n`\"device\"` — the appsynergy agent generated the keypair on the\ndevice and holds the private key; the control plane stores only\nthe public key, so there is nothing to download, QR, or regenerate."},"last_handshake":{"type":["string","null"],"description":"RFC3339 timestamp of the last observed WireGuard handshake.\n`null` when no handshake has been seen yet."},"platform":{"type":["string","null"],"description":"OS / platform tag set at tunnel creation (e.g. \"macos\", \"linux\",\n\"windows\", \"ios\", \"android\"). Free-form; stored as-is."},"profile_name":{"type":["string","null"],"description":"Human-readable label for this tunnel (e.g. \"Home MacBook\").\nStored in `wireguard_tunnels.profile_name`."},"public_key":{"type":"string","description":"Server-assigned WireGuard public key for this tunnel.\nBase64-encoded 32-byte X25519 public key."},"use_case":{"type":["string","null"],"description":"Usage-category tag set at tunnel creation (e.g. \"personal\",\n\"work\", \"gaming\"). Free-form; stored as-is."}}},"ZoneAdminListResponse":{"type":"object","description":"Page envelope for `GET /platform/dns/zones`.","required":["zones"],"properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` on the last page."},"zones":{"type":"array","items":{"$ref":"#/components/schemas/ZoneAdminRead"},"description":"The page of zones, ordered `created_at DESC, id DESC`\n(newest first)."}}},"ZoneAdminRead":{"type":"object","description":"One authoritative zone projected for the staff roster. Identity,\nSOA serial, DNSSEC flag, and a record counter — no record values,\nno key material (posture: nothing secret is even selected).","required":["id","org_id","name","serial","dnssec_enabled","record_count","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp."},"dnssec_enabled":{"type":"boolean","description":"Whether DNSSEC is enabled on the zone\n(`dns_zones.dnssec_enabled` projected to a bool)."},"id":{"type":"string","description":"UUIDv7 primary key (`dns_zones.id`)."},"name":{"type":"string","description":"Zone apex, e.g. `example.com` (`dns_zones.name`)."},"org_id":{"type":"string","description":"Owning org (`dns_zones.org_id`) — the cross-org dimension this\nstaff surface exists to expose."},"record_count":{"type":"integer","format":"int64","description":"Number of `dns_records` rows in the zone."},"serial":{"type":"integer","format":"int64","description":"Current SOA serial (`dns_zones.serial`)."},"updated_at":{"type":"string","description":"RFC3339 UTC last-update timestamp."}}},"ZoneCreateRequest":{"type":"object","description":"Request body for `POST /dns/zones`.","required":["name","primary_ns","contact_email"],"properties":{"contact_email":{"type":"string","description":"Hostmaster contact email (`dns_zones.contact_email`)."},"expire":{"type":["integer","null"],"format":"int64","description":"Optional SOA `expire`. Default 1209600."},"minimum_ttl":{"type":["integer","null"],"format":"int64","description":"Optional SOA `minimum_ttl`. Default 300."},"name":{"type":"string","description":"Zone apex (e.g. `example.com`). Lowercase ASCII, no trailing\ndot. Validator enforces non-empty + length cap; SOA-shape\nvalidation lives in the handler."},"org_id":{"type":["string","null"],"format":"uuid","description":"The org the zone belongs to. Omit to use the caller's selected\nworkspace (an API token's or service account's own org)."},"primary_ns":{"type":"string","description":"Primary NS hostname (`dns_zones.primary_ns`)."},"refresh":{"type":["integer","null"],"format":"int64","description":"Optional SOA `refresh` (seconds). Schema default 3600."},"retry":{"type":["integer","null"],"format":"int64","description":"Optional SOA `retry`. Default 600."}}},"ZoneDeleteResponse":{"type":"object","description":"Response body for `DELETE /dns/zones/{id}`. Carries the deleted\nrow's id so callers (audit log readers, dashboard) can confirm\nwhich zone went away. Mirrors the `DnsAssignmentDeleteResponse`\nprecedent in the recursive-resolver sibling module.","required":["id"],"properties":{"id":{"type":"string","description":"The UUIDv7 of the zone that was deleted."}}},"ZoneExportResponse":{"type":"object","description":"Response body for `GET /dns/zones/{zone_id}/export`. The `zonefile`\nfield is the rendered RFC 1035 text including `$ORIGIN`, `$TTL`, and\nthe synthesised SOA line.","required":["zonefile"],"properties":{"zonefile":{"type":"string","description":"RFC 1035 zonefile text."}}},"ZoneImportRequest":{"type":"object","description":"Request body for `POST /dns/zones/{zone_id}/import`. Replace-only:\nthe existing records in the zone are removed before the parsed\nrecords are inserted.","required":["zonefile"],"properties":{"zonefile":{"type":"string","description":"Raw RFC 1035 zonefile text."}}},"ZoneImportResponse":{"type":"object","description":"Response body for `POST /dns/zones/{zone_id}/import`. Counts let the\ncaller verify the import did what they expected.","required":["imported_records","removed_records"],"properties":{"imported_records":{"type":"integer","format":"int64","description":"Number of records inserted from the uploaded zonefile."},"removed_records":{"type":"integer","format":"int64","description":"Number of records removed before the insert ran."}}},"ZoneListResponse":{"type":"object","description":"`GET /dns/zones` response envelope. Cursor pagination.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ZoneRead"},"description":"Zones scoped to the caller's resolved org, ordered\n`(created_at DESC, id DESC)`."},"next_cursor":{"type":["string","null"],"description":"Opaque base64url cursor for the next page; `null` on the last page."}}},"ZonePatchRequest":{"type":"object","description":"Patchable subset of the `dns_zones` row.","properties":{"contact_email":{"type":["string","null"],"description":"New hostmaster contact email."},"expire":{"type":["integer","null"],"format":"int64","description":"New SOA expire seconds."},"minimum_ttl":{"type":["integer","null"],"format":"int64","description":"New SOA minimum TTL."},"primary_ns":{"type":["string","null"],"description":"New primary NS hostname."},"refresh":{"type":["integer","null"],"format":"int64","description":"New SOA refresh seconds."},"retry":{"type":["integer","null"],"format":"int64","description":"New SOA retry seconds."}}},"ZoneRead":{"type":"object","description":"Single `dns_zones` row projected to the wire.","required":["id","org_id","name","serial","refresh","retry","expire","minimum_ttl","primary_ns","contact_email","dnssec_enabled","created_at","updated_at"],"properties":{"contact_email":{"type":"string","description":"Hostmaster contact email (`dns_zones.contact_email`)."},"created_at":{"type":"string","description":"RFC3339 UTC creation timestamp."},"dnssec_enabled":{"type":"boolean","description":"`0` until DNSSEC is enabled via `POST /dns/zones/{id}/dnssec/enable`,\n`1` thereafter."},"expire":{"type":"integer","format":"int64","description":"SOA expire seconds."},"id":{"type":"string","description":"UUIDv7 primary key (`dns_zones.id`)."},"minimum_ttl":{"type":"integer","format":"int64","description":"SOA minimum TTL seconds."},"name":{"type":"string","description":"Zone apex name (`dns_zones.name`); e.g. `example.com`."},"org_id":{"type":"string","description":"Owning org (`dns_zones.org_id`)."},"primary_ns":{"type":"string","description":"Primary NS hostname (`dns_zones.primary_ns`)."},"refresh":{"type":"integer","format":"int64","description":"SOA refresh seconds."},"retry":{"type":"integer","format":"int64","description":"SOA retry seconds."},"serial":{"type":"integer","format":"int64","description":"SOA serial (`dns_zones.serial`). Bumped automatically on every\nrecord change so secondaries see the zone has updated."},"updated_at":{"type":"string","description":"RFC3339 UTC last-update timestamp."}}}}},"tags":[{"name":"AppSynergy","description":"AppSynergy control plane API"}]}