{
  "generatedFrom": "packages/server/tools/public-contract.ts",
  "scopes": [
    "application-accounts:write",
    "application-workspaces:write",
    "tenants:write",
    "principals:write",
    "events:write",
    "events:read",
    "capabilities:write",
    "connections:write",
    "learning:read",
    "learning:write",
    "proposals:write",
    "trials:write",
    "work:read",
    "work:write",
    "edge:register",
    "uncertainty:decide",
    "corrections:write",
    "metrics:read",
    "proposals:read",
    "receipts:read",
    "capabilities:read",
    "webhooks:write",
    "export:read",
    "erase:write"
  ],
  "eventRejectionCodes": [
    "privacy_rejected",
    "tenant_mismatch",
    "schema_invalid",
    "store_failed"
  ],
  "webhookEventTypes": [
    "job.understood",
    "job.eligible",
    "proposal.created",
    "proposal.approved",
    "proposal.declined",
    "proposal.expired",
    "trial.started",
    "trial.exhausted",
    "trial.stopped",
    "trial.completed",
    "work.issued",
    "work.verified",
    "work.failed",
    "work.requires_human",
    "receipt.created",
    "correction.applied",
    "connection.degraded"
  ],
  "routes": [
    {
      "method": "POST",
      "path": "/v1/application-accounts/signup",
      "group": "Application accounts",
      "purpose": "Start email verification for an account in this application and environment.",
      "auth": "application-accounts:write",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-accounts/resend",
      "group": "Application accounts",
      "purpose": "Replace the pending signup code within the email send limit.",
      "auth": "application-accounts:write",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-accounts/verify",
      "group": "Application accounts",
      "purpose": "Verify email and issue a revocable application session.",
      "auth": "application-accounts:write",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-accounts/recovery/start",
      "group": "Application accounts",
      "purpose": "Send a code to recover an existing application account.",
      "auth": "application-accounts:write",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-accounts/recovery/verify",
      "group": "Application accounts",
      "purpose": "Recover the scoped account and issue a recovery session.",
      "auth": "application-accounts:write",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-sessions/sign-in",
      "group": "Application accounts",
      "purpose": "Sign in to this application and environment.",
      "auth": "application-accounts:write",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-sessions/current",
      "group": "Application accounts",
      "purpose": "Read the current application session without returning its secret.",
      "auth": "application-accounts:write + x-munky-application-session",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-sessions/revoke",
      "group": "Application accounts",
      "purpose": "Revoke the current application session.",
      "auth": "application-accounts:write + x-munky-application-session",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-sessions/revoke-all",
      "group": "Application accounts",
      "purpose": "Revoke every session for this account in this application and environment.",
      "auth": "application-accounts:write + x-munky-application-session",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-accounts/password",
      "group": "Application accounts",
      "purpose": "Replace the password and revoke all account sessions.",
      "auth": "application-accounts:write + x-munky-application-session",
      "file": "application-auth.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/application-accounts/current",
      "group": "Application accounts",
      "purpose": "Delete the current application account after password or recent recovery proof; owned workspaces must be erased first.",
      "auth": "application-accounts:write + x-munky-application-session",
      "file": "application-auth.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-mobile-devices",
      "group": "Mobile companion",
      "purpose": "Register a companion installation and rotate its mobile credential.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-mobile.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-mobile-devices",
      "group": "Mobile companion",
      "purpose": "List the account’s companion devices without credentials or push tokens.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-mobile.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-mobile-devices/current",
      "group": "Mobile companion",
      "purpose": "Validate the current application session and mobile credential together.",
      "auth": "application-workspaces:write + x-munky-application-session + x-munky-mobile-device",
      "file": "application-mobile.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/application-mobile-devices/:deviceId",
      "group": "Mobile companion",
      "purpose": "Revoke a companion credential and clear its push token.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-mobile.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-workspaces/:workspaceId/mobile-decisions",
      "group": "Mobile companion",
      "purpose": "Read the latest 50 decisions addressed to this workspace principal.",
      "auth": "application-workspaces:write + x-munky-application-session + x-munky-mobile-device",
      "file": "application-mobile.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-workspaces/:workspaceId/mobile-decisions/:requestId",
      "group": "Mobile companion",
      "purpose": "Read one exact decision; answers use its SMS code or secure link.",
      "auth": "application-workspaces:write + x-munky-application-session + x-munky-mobile-device",
      "file": "application-mobile.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-workspaces/:workspaceId/policy",
      "group": "Application workspaces",
      "purpose": "Read whether new work and device observation are paused.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "PUT",
      "path": "/v1/application-workspaces/:workspaceId/policy",
      "group": "Application workspaces",
      "purpose": "Pause or resume new work leases and device observation as owner or admin.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/application-workspaces/:workspaceId",
      "group": "Application workspaces",
      "purpose": "Erase an owned workspace and revoke its device credentials.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-workspaces",
      "group": "Application workspaces",
      "purpose": "List workspaces where this account has active membership.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-workspaces",
      "group": "Application workspaces",
      "purpose": "Create a personal or business workspace and its isolated engine tenant.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-workspaces/:workspaceId/members",
      "group": "Application workspaces",
      "purpose": "Read the workspace roster as owner or administrator.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-workspaces/:workspaceId/invitations",
      "group": "Application workspaces",
      "purpose": "Create an exact-email invitation; deliver the returned token through your product.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/application-workspaces/:workspaceId/invitations/:invitationId",
      "group": "Application workspaces",
      "purpose": "Revoke a pending invitation.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-invitations/accept",
      "group": "Application workspaces",
      "purpose": "Accept a single-use invitation for this verified account.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/application-workspaces/:workspaceId/members/:accountId",
      "group": "Application workspaces",
      "purpose": "Remove a membership and revoke its devices.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "GET",
      "path": "/v1/application-workspaces/:workspaceId/devices",
      "group": "Application workspaces",
      "purpose": "List devices visible to this workspace member.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "POST",
      "path": "/v1/application-workspaces/:workspaceId/devices",
      "group": "Application workspaces",
      "purpose": "Enroll an installation for the active member; execution requires owner or admin.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/application-workspaces/:workspaceId/devices/:runtimeId",
      "group": "Application workspaces",
      "purpose": "Revoke an authorized workspace device.",
      "auth": "application-workspaces:write + x-munky-application-session",
      "file": "application-workspaces.ts"
    },
    {
      "method": "POST",
      "path": "/v1/capabilities",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Declare or restore a capability",
      "auth": "capabilities:write",
      "file": "capabilities.ts"
    },
    {
      "method": "GET",
      "path": "/v1/capabilities",
      "group": "Capabilities, proposals, and trials",
      "purpose": "List project capabilities",
      "auth": "capabilities:write",
      "file": "capabilities.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/capabilities/:capabilityId",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Withdraw while retaining history",
      "auth": "capabilities:write",
      "file": "capabilities.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/connections",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Register a signed-read connection",
      "auth": "connections:write",
      "file": "connections.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/connections",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Connection summaries",
      "auth": "connections:write",
      "file": "connections.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/corrections",
      "group": "Work, proof, and governance",
      "purpose": "Append a correction and relearn",
      "auth": "corrections:write",
      "file": "corrections.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/corrections",
      "group": "Work, proof, and governance",
      "purpose": "Correction history",
      "auth": "learning:read",
      "file": "corrections.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/mobile-devices",
      "group": "Mobile companion",
      "purpose": "Register a companion installation and rotate its mobile credential.",
      "auth": "configured native application; x-munky-application-session",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/mobile-devices",
      "group": "Mobile companion",
      "purpose": "List the account’s companion devices without credentials or push tokens.",
      "auth": "configured native application; x-munky-application-session",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/mobile-devices/current",
      "group": "Mobile companion",
      "purpose": "Validate the current application session and mobile credential together.",
      "auth": "configured native application; x-munky-application-session + x-munky-mobile-device",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/apps/:appId/mobile-devices/:deviceId",
      "group": "Mobile companion",
      "purpose": "Revoke a companion credential and clear its push token.",
      "auth": "configured native application; x-munky-application-session",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/mobile-decisions",
      "group": "Mobile companion",
      "purpose": "Read the latest 50 decisions addressed to this workspace principal.",
      "auth": "configured native application; x-munky-application-session + x-munky-mobile-device",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/mobile-decisions/:requestId",
      "group": "Mobile companion",
      "purpose": "Read one exact decision; answers use its SMS code or secure link.",
      "auth": "configured native application; x-munky-application-session + x-munky-mobile-device",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/status",
      "group": "Native application gateway",
      "purpose": "Check configured native application availability",
      "auth": "none; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/accounts/signup",
      "group": "Native application gateway",
      "purpose": "Start native application signup",
      "auth": "none; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/accounts/resend",
      "group": "Native application gateway",
      "purpose": "Resend native signup verification",
      "auth": "none; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/accounts/verify",
      "group": "Native application gateway",
      "purpose": "Verify native signup and issue an application session",
      "auth": "none; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/accounts/recovery/start",
      "group": "Native application gateway",
      "purpose": "Start native account recovery",
      "auth": "none; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/accounts/recovery/verify",
      "group": "Native application gateway",
      "purpose": "Verify native account recovery",
      "auth": "none; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/sessions/sign-in",
      "group": "Native application gateway",
      "purpose": "Sign in to the native application",
      "auth": "none; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/sessions/current",
      "group": "Native application gateway",
      "purpose": "Read the current native application session",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/sessions/revoke",
      "group": "Native application gateway",
      "purpose": "Sign out the current native application session",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces",
      "group": "Native application gateway",
      "purpose": "Read native workspace workspace",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/workspaces",
      "group": "Native application gateway",
      "purpose": "Create or submit native workspace workspace",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/policy",
      "group": "Native application gateway",
      "purpose": "Read native workspace policy",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "PUT",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/policy",
      "group": "Native application gateway",
      "purpose": "Update native workspace policy",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/devices",
      "group": "Native application gateway",
      "purpose": "Read native workspace devices",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/devices",
      "group": "Native application gateway",
      "purpose": "Create or submit native workspace devices",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/devices/:runtimeId",
      "group": "Native application gateway",
      "purpose": "Revoke native workspace :runtimeId",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/phone-contact",
      "group": "Native application gateway",
      "purpose": "Read native workspace phone-contact",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/phone-contact",
      "group": "Native application gateway",
      "purpose": "Revoke native workspace phone-contact",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/phone-challenges",
      "group": "Native application gateway",
      "purpose": "Create or submit native workspace phone-challenges",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/phone-challenges/:challengeId/verify",
      "group": "Native application gateway",
      "purpose": "Create or submit native workspace verify",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/interruptions",
      "group": "Native application gateway",
      "purpose": "Read native workspace interruptions",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "GET",
      "path": "/v1/apps/:appId/workspaces/:workspaceId/receipts",
      "group": "Native application gateway",
      "purpose": "Read native workspace receipts",
      "auth": "x-munky-application-session; configured native application",
      "file": "desktop-gateway.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/edge-runtimes",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Register a tenant-bound Edge runtime and return its credential once",
      "auth": "edge:register",
      "file": "edge-runtime.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/edge-runtimes",
      "group": "Edge runtimes and uncertainty",
      "purpose": "List the tenant's registered Edge runtimes",
      "auth": "edge:register",
      "file": "edge-runtime.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/edge-runtimes/:runtimeId",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Revoke an Edge runtime and its credential",
      "auth": "edge:register",
      "file": "edge-runtime.ts"
    },
    {
      "method": "POST",
      "path": "/v1/edge-runtimes/:runtimeId/heartbeat",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Report runtime and adapter health; rotate a near-expiry credential",
      "auth": "runtime key",
      "file": "edge-runtime.ts"
    },
    {
      "method": "POST",
      "path": "/v1/edge-runtimes/:runtimeId/events",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Submit minimized events from a declared observation source",
      "auth": "runtime key",
      "file": "edge-runtime.ts"
    },
    {
      "method": "GET",
      "path": "/v1/edge-runtimes/:runtimeId/work",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Lease work matching the runtime's declared execution adapters",
      "auth": "runtime key",
      "file": "edge-runtime.ts"
    },
    {
      "method": "POST",
      "path": "/v1/edge-runtimes/:runtimeId/work/:workItemId/report",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Report a bounded Edge assignment as performed, refused, or failed",
      "auth": "runtime key",
      "file": "edge-runtime.ts"
    },
    {
      "method": "POST",
      "path": "/v1/edge-runtimes/:runtimeId/work/:workItemId/uncertainties",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Pause an assignment and raise structural uncertainty for a person",
      "auth": "runtime key",
      "file": "edge-runtime.ts"
    },
    {
      "method": "GET",
      "path": "/v1/edge-runtimes/:runtimeId/work-uncertainties",
      "group": "Edge runtimes and uncertainty",
      "purpose": "List uncertainty records visible to this runtime",
      "auth": "runtime key",
      "file": "edge-runtime.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/work-uncertainties",
      "group": "Edge runtime",
      "purpose": "Read a workspace interruption inbox. Query status defaults to open; limit is 1–50; pass nextCursor as cursor for the next page. Requires a trusted backend; no runtime key is needed.",
      "auth": "uncertainty:decide",
      "file": "edge-runtime.ts"
    },
    {
      "method": "POST",
      "path": "/v1/work-uncertainties/:uncertaintyId/resolve",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Resolve uncertainty with an exact delegated-principal decision",
      "auth": "uncertainty:decide",
      "file": "edge-runtime.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/labels",
      "group": "Evidence and learning",
      "purpose": "Human evaluation label",
      "auth": "learning:write",
      "file": "evaluation.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/labels",
      "group": "Evidence and learning",
      "purpose": "Label history",
      "auth": "learning:read",
      "file": "evaluation.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/accuracy",
      "group": "Evidence and learning",
      "purpose": "Label-backed quality gate",
      "auth": "learning:read",
      "file": "evaluation.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/events",
      "group": "Evidence and learning",
      "purpose": "Live event or batch intake (Edge envelopes only)",
      "auth": "events:write",
      "file": "events.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/events/import",
      "group": "Evidence and learning",
      "purpose": "Historical intake without replay proposals",
      "auth": "events:write",
      "file": "events.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/events",
      "group": "Evidence and learning",
      "purpose": "Events, with since (ISO 8601) and limit (1 to 1,000)",
      "auth": "events:read",
      "file": "events.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/events/unmapped",
      "group": "Evidence and learning",
      "purpose": "Unknown event shapes",
      "auth": "events:read",
      "file": "events.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/events/aliases",
      "group": "Evidence and learning",
      "purpose": "Confirm tenant-specific semantics",
      "auth": "events:write",
      "file": "events.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/case-approvals",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Pending and decided sensitive cases",
      "auth": "proposals:read",
      "file": "execution.ts"
    },
    {
      "method": "POST",
      "path": "/v1/case-approvals/:approvalId/approve",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Approve one always-ask case",
      "auth": "trials:write",
      "file": "execution.ts"
    },
    {
      "method": "POST",
      "path": "/v1/case-approvals/:approvalId/decline",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Decline one always-ask case",
      "auth": "trials:write",
      "file": "execution.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/work",
      "group": "Work, proof, and governance",
      "purpose": "Lease an ordered work page",
      "auth": "work:read",
      "file": "execution.ts"
    },
    {
      "method": "GET",
      "path": "/v1/work/:workItemId",
      "group": "Work, proof, and governance",
      "purpose": "One work item",
      "auth": "work:read",
      "file": "execution.ts"
    },
    {
      "method": "POST",
      "path": "/v1/work/:workItemId/report",
      "group": "Work, proof, and governance",
      "purpose": "Report performed, refused, or failed",
      "auth": "work:write",
      "file": "execution.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/receipts",
      "group": "Work, proof, and governance",
      "purpose": "Tenant receipts",
      "auth": "receipts:read",
      "file": "execution.ts"
    },
    {
      "method": "GET",
      "path": "/v1/receipts/:receiptId",
      "group": "Work, proof, and governance",
      "purpose": "One coherent receipt",
      "auth": "receipts:read",
      "file": "execution.ts"
    },
    {
      "method": "POST",
      "path": "/v1/edge-runtimes/:runtimeId/frame-escalations",
      "group": "Edge runtimes and uncertainty",
      "purpose": "Have one redacted frame read by a provider when the runtime's own tier cannot",
      "auth": "runtime key",
      "file": "frame-escalation.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/export",
      "group": "Work, proof, and governance",
      "purpose": "Tenant data and evidence export",
      "auth": "export:read",
      "file": "governance.ts"
    },
    {
      "method": "GET",
      "path": "/v1/audit/export",
      "group": "Work, proof, and governance",
      "purpose": "Security audit and erasure export",
      "auth": "export:read",
      "file": "governance.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/tenants/:tenantId",
      "group": "Work, proof, and governance",
      "purpose": "Idempotent tenant erasure",
      "auth": "erase:write",
      "file": "governance.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants",
      "group": "Identity and tenants",
      "purpose": "Idempotent tenant upsert",
      "auth": "tenants:write",
      "file": "identity.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants",
      "group": "Identity and tenants",
      "purpose": "Project and environment tenant list",
      "auth": "tenants:write",
      "file": "identity.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId",
      "group": "Identity and tenants",
      "purpose": "One tenant mapping",
      "auth": "tenants:write",
      "file": "identity.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/principals",
      "group": "Identity and tenants",
      "purpose": "Principal upsert with permissions",
      "auth": "principals:write",
      "file": "identity.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/principals",
      "group": "Identity and tenants",
      "purpose": "Tenant principal list",
      "auth": "principals:write",
      "file": "identity.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/episodes",
      "group": "Evidence and learning",
      "purpose": "Reconstructed episodes",
      "auth": "learning:read",
      "file": "learning.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/learn",
      "group": "Evidence and learning",
      "purpose": "Run a learning pass",
      "auth": "learning:write",
      "file": "learning.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/learning",
      "group": "Evidence and learning",
      "purpose": "Status and recent passes",
      "auth": "learning:read",
      "file": "learning.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/learning-feedback",
      "group": "Evidence and learning",
      "purpose": "Outcome, correction, drift, and proposal feedback",
      "auth": "learning:read",
      "file": "learning.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/jobs",
      "group": "Evidence and learning",
      "purpose": "Latest job-family summaries",
      "auth": "learning:read",
      "file": "learning.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/jobs/:familyId/versions",
      "group": "Evidence and learning",
      "purpose": "Contract history",
      "auth": "learning:read",
      "file": "learning.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/jobs/:familyId/episodes",
      "group": "Evidence and learning",
      "purpose": "Evidence for one family",
      "auth": "learning:read",
      "file": "learning.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/jobs/:familyId",
      "group": "Evidence and learning",
      "purpose": "Latest versioned job contract",
      "auth": "learning:read",
      "file": "learning.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/metrics",
      "group": "Work, proof, and governance",
      "purpose": "Tenant work metrics",
      "auth": "metrics:read",
      "file": "metrics.ts"
    },
    {
      "method": "GET",
      "path": "/v1/metrics",
      "group": "Work, proof, and governance",
      "purpose": "Project aggregate work metrics",
      "auth": "metrics:read",
      "file": "metrics.ts"
    },
    {
      "method": "GET",
      "path": "/health",
      "group": "System",
      "purpose": "Process liveness. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/ready",
      "group": "System",
      "purpose": "Database readiness. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/docs/integration.md",
      "group": "System",
      "purpose": "Public integration guide and complete API reference",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/docs/INTEGRATION.md",
      "group": "System",
      "purpose": "Read public integration documentation. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/docs/API-REFERENCE.md",
      "group": "System",
      "purpose": "Read public integration documentation. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/docs/LOCAL-RUNTIME.md",
      "group": "System",
      "purpose": "Read public integration documentation. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/docs/public-contract.json",
      "group": "System",
      "purpose": "Read public integration documentation. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.1.0.tgz",
      "group": "System",
      "purpose": "Download the standalone SDK. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.1.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.1.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.2.0.tgz",
      "group": "System",
      "purpose": "Download the standalone SDK. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.2.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.2.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.3.0.tgz",
      "group": "System",
      "purpose": "Download the standalone SDK. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.3.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.3.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.4.0.tgz",
      "group": "System",
      "purpose": "Download the SDK with numbered and Yes/No text decision contracts. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.5.0.tgz",
      "group": "System",
      "purpose": "Download the SDK with verified phone contacts and durable decision delivery APIs. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.4.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.4.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.5.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.5.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.6.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.6.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.7.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.7.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.8.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.8.0.json",
      "group": "System",
      "purpose": "Read the local runtime archive checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.9.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.9.0.json",
      "group": "System",
      "purpose": "Read the local runtime checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.10.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.10.0.json",
      "group": "System",
      "purpose": "Read the local runtime checksum. No key.",
      "auth": "none",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.8.0.tgz",
      "group": "Distribution",
      "purpose": "Download SDK 0.8.0 with companion identity and decision reads. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.7.0.tgz",
      "group": "System",
      "purpose": "Download SDK 0.7.0 with the workspace interruption inbox. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.18.0.tgz",
      "group": "Distribution",
      "purpose": "Download runtime 0.18.0 with the direct SMS decision migration. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.18.0.json",
      "group": "Distribution",
      "purpose": "Read the runtime 0.18.0 checksum. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.17.0.tgz",
      "group": "Distribution",
      "purpose": "Download runtime 0.17.0 tgz release. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.17.0.json",
      "group": "Distribution",
      "purpose": "Download runtime 0.17.0 json release. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.15.0.tgz",
      "group": "System",
      "purpose": "Download runtime 0.15.0 with native application gateway contracts. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.15.0.json",
      "group": "System",
      "purpose": "Read the runtime 0.15.0 checksum. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.14.0.tgz",
      "group": "System",
      "purpose": "Download runtime 0.14.0 with exact-hold retry protection. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.14.0.json",
      "group": "System",
      "purpose": "Read the runtime 0.14.0 checksum. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.13.0.tgz",
      "group": "System",
      "purpose": "Download local runtime 0.13.0. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.13.0.json",
      "group": "System",
      "purpose": "Read the runtime 0.13.0 checksum. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/sdk/munky-sdk-0.6.0.tgz",
      "group": "System",
      "purpose": "Download the public SDK package. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.11.0.tgz",
      "group": "System",
      "purpose": "Download the local runtime package. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/runtime/munky-local-runtime-0.11.0.json",
      "group": "System",
      "purpose": "Read the local runtime checksum. No key.",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/v1/whoami",
      "group": "Identity and tenants",
      "purpose": "Caller, scopes, environment, and available areas",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/v1/usage",
      "group": "Work, proof, and governance",
      "purpose": "Usage and plan records",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/v1/docs",
      "group": "System",
      "purpose": "This reference as Markdown, for a key holder",
      "auth": "project key",
      "file": "system.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/proposals",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Tenant proposals",
      "auth": "proposals:read",
      "file": "takeover.ts"
    },
    {
      "method": "GET",
      "path": "/v1/proposals/:proposalId",
      "group": "Capabilities, proposals, and trials",
      "purpose": "One proposal",
      "auth": "proposals:read",
      "file": "takeover.ts"
    },
    {
      "method": "POST",
      "path": "/v1/proposals/:proposalId/approve",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Approve the exact plan and start a trial",
      "auth": "proposals:write",
      "file": "takeover.ts"
    },
    {
      "method": "POST",
      "path": "/v1/proposals/:proposalId/decline",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Decline with a structured reason",
      "auth": "proposals:write",
      "file": "takeover.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/trials",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Tenant trials",
      "auth": "proposals:read",
      "file": "takeover.ts"
    },
    {
      "method": "GET",
      "path": "/v1/trials/:trialId",
      "group": "Capabilities, proposals, and trials",
      "purpose": "One trial",
      "auth": "proposals:read",
      "file": "takeover.ts"
    },
    {
      "method": "POST",
      "path": "/v1/trials/:trialId/stop",
      "group": "Capabilities, proposals, and trials",
      "purpose": "Stop a trial",
      "auth": "trials:write",
      "file": "takeover.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/text-decisions",
      "group": "Work, proof, and governance",
      "purpose": "Persist an immutable numbered or Yes/No decision request; does not send messages or approve work.",
      "auth": "proposals:write",
      "file": "text-decisions.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/text-decisions/:requestId",
      "group": "Work, proof, and governance",
      "purpose": "Read the exact prompt, delivery state and recorded selection.",
      "auth": "proposals:read",
      "file": "text-decisions.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/text-decisions/:requestId/cancel",
      "group": "Work, proof, and governance",
      "purpose": "Cancel an unanswered decision bound to its displayed prompt.",
      "auth": "proposals:write",
      "file": "text-decisions.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/principals/:principalId/phone-challenges",
      "group": "Text delivery",
      "purpose": "Send a rate-limited phone possession challenge after messaging consent.",
      "auth": "principals:write",
      "file": "text-delivery.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/principals/:principalId/phone-challenges/:challengeId/verify",
      "group": "Text delivery",
      "purpose": "Verify the code and bind the phone to this principal; grants no purchasing authority.",
      "auth": "principals:write",
      "file": "text-delivery.ts"
    },
    {
      "method": "GET",
      "path": "/v1/tenants/:tenantId/principals/:principalId/phone-contact",
      "group": "Text delivery",
      "purpose": "Read verification status and the last four digits only.",
      "auth": "principals:write",
      "file": "text-delivery.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/tenants/:tenantId/principals/:principalId/phone-contact",
      "group": "Text delivery",
      "purpose": "Revoke this phone contact and invalidate its decision links.",
      "auth": "principals:write",
      "file": "text-delivery.ts"
    },
    {
      "method": "POST",
      "path": "/v1/tenants/:tenantId/text-decisions/:requestId/send",
      "group": "Text delivery",
      "purpose": "Queue one SMS decision link for the verified contact.",
      "auth": "proposals:write",
      "file": "text-delivery.ts"
    },
    {
      "method": "GET",
      "path": "/text-decisions/answer",
      "group": "Text delivery",
      "purpose": "Open the decision screen without consuming or answering a request.",
      "auth": "none",
      "file": "text-delivery.ts"
    },
    {
      "method": "POST",
      "path": "/text-decisions/describe",
      "group": "Text delivery",
      "purpose": "Read the exact decision using the private token delivered to a verified phone.",
      "auth": "private phone-delivered token",
      "file": "text-delivery.ts"
    },
    {
      "method": "POST",
      "path": "/text-decisions/answer",
      "group": "Text delivery",
      "purpose": "Record a selection using the phone-delivered token; does not place an order.",
      "auth": "private phone-delivered token and same-origin request",
      "file": "text-delivery.ts"
    },
    {
      "method": "POST",
      "path": "/v1/text-decisions/sms",
      "group": "Text delivery",
      "purpose": "Authenticate Twilio STOP/START/HELP; plain replies never select a purchase.",
      "auth": "Twilio signature, account and destination",
      "file": "text-delivery.ts"
    },
    {
      "method": "POST",
      "path": "/v1/webhooks",
      "group": "Work, proof, and governance",
      "purpose": "Register a signed project webhook; the secret is returned once",
      "auth": "webhooks:write",
      "file": "webhooks.ts"
    },
    {
      "method": "GET",
      "path": "/v1/webhooks",
      "group": "Work, proof, and governance",
      "purpose": "Webhook summaries, secrets omitted",
      "auth": "webhooks:write",
      "file": "webhooks.ts"
    },
    {
      "method": "DELETE",
      "path": "/v1/webhooks/:endpointId",
      "group": "Work, proof, and governance",
      "purpose": "Remove a webhook; delivery history is kept",
      "auth": "webhooks:write",
      "file": "webhooks.ts"
    },
    {
      "method": "GET",
      "path": "/v1/webhooks/deliveries",
      "group": "Work, proof, and governance",
      "purpose": "Recent delivery attempts",
      "auth": "webhooks:write",
      "file": "webhooks.ts"
    },
    {
      "method": "POST",
      "path": "/v1/webhooks/deliveries/:eventId/replay",
      "group": "Work, proof, and governance",
      "purpose": "Replay one eligible delivery by its UUID event id",
      "auth": "webhooks:write",
      "file": "webhooks.ts"
    }
  ],
  "bodies": {
    "POST /v1/application-mobile-devices": {
      "schema": {
        "type": "object",
        "properties": {
          "installationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "platform": {
            "type": "string",
            "const": "ios"
          },
          "appVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "push": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string",
                "pattern": "^(?:[a-fA-F0-9]{2}){32,100}$"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "sandbox",
                  "production"
                ]
              }
            },
            "required": [
              "token",
              "environment"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "installationId",
          "displayName",
          "platform",
          "appVersion"
        ],
        "additionalProperties": false
      },
      "example": {
        "installationId": "324f888c-7f83-4096-a1bd-d2ad46164ecf",
        "displayName": "My iPhone",
        "platform": "ios",
        "appVersion": "0.1.0"
      },
      "notes": [
        "Store the returned mobile token in Keychain. Re-registration rotates it; push delivery is not configured."
      ]
    },
    "POST /v1/apps/:appId/mobile-devices": {
      "schema": {
        "type": "object",
        "properties": {
          "installationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "platform": {
            "type": "string",
            "const": "ios"
          },
          "appVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "push": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string",
                "pattern": "^(?:[a-fA-F0-9]{2}){32,100}$"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "sandbox",
                  "production"
                ]
              }
            },
            "required": [
              "token",
              "environment"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "installationId",
          "displayName",
          "platform",
          "appVersion"
        ],
        "additionalProperties": false
      },
      "example": {
        "installationId": "324f888c-7f83-4096-a1bd-d2ad46164ecf",
        "displayName": "My iPhone",
        "platform": "ios",
        "appVersion": "0.1.0"
      },
      "notes": [
        "Store the returned mobile token in Keychain. Re-registration rotates it; push delivery is not configured."
      ]
    },
    "POST /v1/application-workspaces": {
      "schema": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "personal",
              "business"
            ]
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        },
        "required": [
          "kind",
          "displayName"
        ],
        "additionalProperties": false
      },
      "example": {
        "kind": "personal",
        "displayName": "My work"
      },
      "notes": [
        "Requires a backend project key and the x-munky-application-session header. Never put credentials or invitation tokens in URLs."
      ]
    },
    "POST /v1/application-workspaces/:workspaceId/invitations": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ]
          }
        },
        "required": [
          "email",
          "role"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "colleague@example.com",
        "role": "member"
      },
      "notes": [
        "Requires a backend project key and the x-munky-application-session header. Never put credentials or invitation tokens in URLs."
      ]
    },
    "POST /v1/application-invitations/accept": {
      "schema": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^mai_[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "token"
        ],
        "additionalProperties": false
      },
      "example": {
        "token": "mai_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
      },
      "notes": [
        "Requires a backend project key and the x-munky-application-session header. Never put credentials or invitation tokens in URLs."
      ]
    },
    "POST /v1/application-workspaces/:workspaceId/devices": {
      "schema": {
        "type": "object",
        "properties": {
          "runtimeExternalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "attesko-desktop",
              "customer-edge",
              "server-edge"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "macos",
              "windows",
              "linux",
              "server"
            ]
          },
          "runtimeVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "protocolVersion": {
            "type": "string",
            "const": "attesko.edge.runtime.v1"
          },
          "features": {
            "type": "object",
            "properties": {
              "observations": {
                "type": "boolean"
              },
              "execution": {
                "type": "string",
                "enum": [
                  "none",
                  "adapter"
                ]
              },
              "observationAdapters": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "native-event",
                        "browser-dom",
                        "os-accessibility",
                        "screen-capture"
                      ]
                    },
                    "sourceSystems": {
                      "default": [],
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "pattern": "^[a-z][a-z0-9_.-]*$"
                      }
                    }
                  },
                  "required": [
                    "kind"
                  ]
                }
              },
              "executionAdapters": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "native-api",
                        "mcp",
                        "browser-dom",
                        "os-accessibility"
                      ]
                    },
                    "capabilityIds": {
                      "default": [],
                      "maxItems": 200,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "pattern": "^[a-z][a-z0-9_.-]*$"
                      }
                    },
                    "attendance": {
                      "type": "string",
                      "enum": [
                        "attended"
                      ]
                    }
                  },
                  "required": [
                    "kind"
                  ]
                }
              },
              "uncertaintyChannels": {
                "default": [],
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "local-notification",
                    "sms",
                    "email",
                    "webhook"
                  ]
                }
              }
            },
            "required": [
              "observations",
              "execution"
            ]
          }
        },
        "required": [
          "runtimeExternalId",
          "kind",
          "platform",
          "runtimeVersion",
          "protocolVersion",
          "features"
        ]
      },
      "example": {
        "runtimeExternalId": "installation-1",
        "kind": "customer-edge",
        "platform": "macos",
        "runtimeVersion": "1.0.0",
        "protocolVersion": "attesko.edge.runtime.v1",
        "features": {
          "observations": false,
          "execution": "none",
          "observationAdapters": [],
          "executionAdapters": [],
          "uncertaintyChannels": []
        }
      },
      "notes": [
        "Requires a backend project key and the x-munky-application-session header. Never put credentials or invitation tokens in URLs."
      ]
    },
    "PUT /v1/application-workspaces/:workspaceId/policy": {
      "schema": {
        "type": "object",
        "properties": {
          "paused": {
            "type": "boolean"
          }
        },
        "required": [
          "paused"
        ],
        "additionalProperties": false
      },
      "example": {
        "paused": true
      },
      "notes": [
        "Requires a backend project key and the x-munky-application-session header. Never put credentials or invitation tokens in URLs."
      ]
    },
    "POST /v1/application-accounts/signup": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "password": {
            "type": "string",
            "minLength": 10,
            "maxLength": 1024
          }
        },
        "required": [
          "email",
          "password"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "password": "example-password-long-enough"
      },
      "notes": [
        "Requires a backend project key with application-accounts:write."
      ]
    },
    "POST /v1/application-accounts/resend": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com"
      },
      "notes": [
        "Requires a backend project key with application-accounts:write."
      ]
    },
    "POST /v1/application-accounts/verify": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "email",
          "code"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "code": "123456"
      },
      "notes": [
        "Requires a backend project key with application-accounts:write."
      ]
    },
    "POST /v1/application-accounts/recovery/start": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com"
      },
      "notes": [
        "Requires a backend project key with application-accounts:write."
      ]
    },
    "POST /v1/application-accounts/recovery/verify": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "email",
          "code"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "code": "123456"
      },
      "notes": [
        "Requires a backend project key with application-accounts:write."
      ]
    },
    "POST /v1/application-sessions/sign-in": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "required": [
          "email",
          "password"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "password": "example-password-long-enough"
      },
      "notes": [
        "Requires a backend project key with application-accounts:write."
      ]
    },
    "POST /v1/application-sessions/current": {
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "example": {},
      "notes": [
        "Requires a backend project key with application-accounts:write. Also requires the x-munky-application-session header; never put the token in a URL."
      ]
    },
    "POST /v1/application-sessions/revoke": {
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "example": {},
      "notes": [
        "Requires a backend project key with application-accounts:write. Also requires the x-munky-application-session header; never put the token in a URL."
      ]
    },
    "POST /v1/application-sessions/revoke-all": {
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "example": {},
      "notes": [
        "Requires a backend project key with application-accounts:write. Also requires the x-munky-application-session header; never put the token in a URL."
      ]
    },
    "DELETE /v1/application-accounts/current": {
      "schema": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "additionalProperties": false
      },
      "example": {
        "currentPassword": "example-password-long-enough"
      },
      "notes": [
        "Requires the application session header. Current password may be omitted only within 15 minutes of mailbox recovery. Owned workspaces must be erased first."
      ]
    },
    "POST /v1/application-accounts/password": {
      "schema": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "newPassword": {
            "type": "string",
            "minLength": 10,
            "maxLength": 1024
          }
        },
        "required": [
          "newPassword"
        ],
        "additionalProperties": false
      },
      "example": {
        "currentPassword": "old-example-password",
        "newPassword": "new-example-password"
      },
      "notes": [
        "Requires a backend project key with application-accounts:write. Also requires the x-munky-application-session header; never put the token in a URL."
      ]
    },
    "POST /v1/tenants/:tenantId/principals/:principalId/phone-challenges": {
      "schema": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{7,14}$"
          },
          "consent": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "phone",
          "consent"
        ],
        "additionalProperties": false
      },
      "example": {
        "phone": "+15555550123",
        "consent": true
      },
      "notes": [
        "Only send after the user requests phone setup. At most three challenges per phone per hour; five code guesses per challenge. Codes expire after ten minutes."
      ]
    },
    "POST /v1/tenants/:tenantId/principals/:principalId/phone-challenges/:challengeId/verify": {
      "schema": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      },
      "example": {
        "code": "123456"
      },
      "notes": []
    },
    "POST /v1/tenants/:tenantId/text-decisions/:requestId/send": {
      "schema": {
        "type": "object",
        "properties": {
          "bindingHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "bindingHash"
        ],
        "additionalProperties": false
      },
      "example": {
        "bindingHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      "notes": [
        "Requires an existing verified contact. Returns queue state, not handset delivery. No link token is returned to the project key."
      ]
    },
    "POST /text-decisions/describe": {
      "schema": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "token"
        ],
        "additionalProperties": false
      },
      "example": {
        "token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      "notes": [
        "Token is carried in the SMS URL fragment and POST body, never a query string. This read does not answer the question."
      ]
    },
    "POST /text-decisions/answer": {
      "schema": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "answer": {
            "type": "string",
            "enum": [
              "1",
              "2",
              "3",
              "4",
              "Yes",
              "No"
            ]
          }
        },
        "required": [
          "token",
          "answer"
        ],
        "additionalProperties": false
      },
      "example": {
        "token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "answer": "Yes"
      },
      "notes": [
        "Use the exact displayed choice and configured HTTPS Origin. Recorded selection is not an existing case approval or purchase receipt."
      ]
    },
    "POST /v1/text-decisions/sms": {
      "schema": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "string"
        }
      },
      "example": {
        "AccountSid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "MessageSid": "SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
        "From": "+15555550123",
        "To": "+15555550124",
        "Body": "HELP"
      },
      "notes": [
        "Twilio application/x-www-form-urlencoded request, not JSON. Signature covers the configured public URL and all fields. Duplicate form fields are rejected; provider message IDs are deduplicated."
      ]
    },
    "POST /v1/tenants/:tenantId/text-decisions": {
      "schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "principalId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "conversationId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
          },
          "question": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "context": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "mode": {
            "type": "string",
            "enum": [
              "numbered",
              "yes-no"
            ]
          },
          "options": {
            "minItems": 2,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "consequence": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "intent": {
                  "type": "string",
                  "enum": [
                    "preference",
                    "purchase",
                    "decline"
                  ]
                },
                "planHash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "quote": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 300
                        },
                        "product": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 300
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10000
                        },
                        "currency": {
                          "type": "string",
                          "enum": [
                            "USD",
                            "EUR",
                            "GBP",
                            "CAD",
                            "AUD"
                          ]
                        },
                        "totalDueNowMinor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "tax": {
                          "type": "string",
                          "enum": [
                            "included",
                            "not-applicable",
                            "unknown"
                          ]
                        },
                        "recurring": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "totalMinor": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "interval": {
                                  "type": "string",
                                  "enum": [
                                    "month",
                                    "year"
                                  ]
                                },
                                "startsAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "totalMinor",
                                "interval",
                                "startsAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "terms": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 300
                        },
                        "sourceUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "retrievedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        }
                      },
                      "required": [
                        "provider",
                        "product",
                        "quantity",
                        "currency",
                        "totalDueNowMinor",
                        "tax",
                        "recurring",
                        "terms",
                        "sourceUrl",
                        "retrievedAt",
                        "expiresAt"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "label",
                "consequence",
                "intent",
                "planHash",
                "quote"
              ],
              "additionalProperties": false
            }
          },
          "recommendation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "optionId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  }
                },
                "required": [
                  "optionId",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "requestId",
          "tenantId",
          "principalId",
          "conversationId",
          "question",
          "context",
          "mode",
          "options",
          "recommendation",
          "createdAt",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "example": {
        "requestId": "email-choice-1",
        "tenantId": "8a522c0b-a2b4-4e56-bd77-f9322d4f83a1",
        "principalId": "497f2c2f-9fea-4028-812f-41e2a76e8f08",
        "conversationId": "request-thread-1",
        "question": "Prepare email options?",
        "context": "Your existing email will stay as it is.",
        "mode": "yes-no",
        "recommendation": null,
        "createdAt": "2026-09-06T12:00:00Z",
        "expiresAt": "2026-09-06T12:15:00Z",
        "options": [
          {
            "id": "prepare",
            "label": "Prepare options",
            "consequence": "Compare mailbox providers.",
            "intent": "preference",
            "planHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "quote": null
          },
          {
            "id": "wait",
            "label": "Wait",
            "consequence": "Leave things unchanged.",
            "intent": "decline",
            "planHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
            "quote": null
          }
        ]
      },
      "notes": [
        "Replace the tenant/principal IDs and timestamps with current values. Reuse the exact input for retries.",
        "Creation queues a record only. There is no project-key endpoint that turns a reply into spending authority."
      ]
    },
    "POST /v1/tenants/:tenantId/text-decisions/:requestId/cancel": {
      "schema": {
        "type": "object",
        "properties": {
          "bindingHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "bindingHash"
        ],
        "additionalProperties": false
      },
      "example": {
        "bindingHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      "notes": [
        "Supply the bindingHash returned by create/read; this example hash is illustrative."
      ]
    },
    "POST /v1/tenants": {
      "schema": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "externalId",
          "displayName"
        ]
      },
      "example": {
        "externalId": "customer_2048",
        "displayName": "Northwind Logistics"
      },
      "notes": []
    },
    "POST /v1/tenants/:tenantId/principals": {
      "schema": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "role": {
            "default": "member",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "permissions": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "enum": [
                    "proposal.approve",
                    "proposal.decline",
                    "trial.stop",
                    "case.approve",
                    "case.decline",
                    "correction.apply",
                    "evaluation.label",
                    "uncertainty.resolve",
                    "connector-job.register"
                  ]
                },
                "capabilityIds": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "required": [
                "operation"
              ]
            }
          }
        },
        "required": [
          "externalId",
          "displayName"
        ]
      },
      "example": {
        "externalId": "user_17",
        "displayName": "Ops lead",
        "role": "billing_manager",
        "permissions": [
          {
            "operation": "proposal.approve"
          },
          {
            "operation": "case.approve",
            "capabilityIds": [
              "invoice.send_follow_up"
            ]
          }
        ]
      },
      "notes": [
        "`permissions` is a list of objects, not strings. Each names one `operation`; `capabilityIds` narrows it to an allow-list.",
        "`role` is your own label. Munky authorizes permissions, never role names."
      ]
    },
    "POST /v1/tenants/:tenantId/events": {
      "schema": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "attesko.edge.event.v1"
          },
          "privacy": {
            "type": "object",
            "properties": {
              "pseudonymization": {
                "type": "string",
                "const": "hmac-sha256"
              },
              "keyId": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,99}$"
              },
              "removedFieldCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "pseudonymization",
              "keyId",
              "removedFieldCount"
            ]
          },
          "event": {
            "type": "object",
            "properties": {
              "tenantId": {
                "type": "string",
                "minLength": 1
              },
              "eventId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "principalExternalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "sourceSystem": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "eventType": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "occurredAt": {
                "type": "string",
                "minLength": 1
              },
              "sourceRecordIds": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 400
                }
              },
              "entities": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "externalId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 400
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 400
                    }
                  },
                  "required": [
                    "type",
                    "externalId"
                  ]
                }
              },
              "subjectExternalId": {
                "type": "string",
                "maxLength": 400
              },
              "subjectType": {
                "type": "string",
                "maxLength": 100
              },
              "beforeState": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "afterState": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "changedFields": {
                "maxItems": 200,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "correlationId": {
                "type": "string",
                "maxLength": 400
              },
              "causationId": {
                "type": "string",
                "maxLength": 400
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              "provenance": {
                "type": "string",
                "enum": [
                  "product-reported",
                  "connected-system",
                  "inference",
                  "user-confirmed",
                  "verification-evidence"
                ]
              },
              "sensitivity": {
                "type": "string",
                "enum": [
                  "none",
                  "business",
                  "personal",
                  "financial"
                ]
              },
              "metadata": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "required": [
              "tenantId",
              "sourceSystem",
              "eventType",
              "occurredAt",
              "idempotencyKey"
            ]
          }
        },
        "required": [
          "schemaVersion",
          "privacy",
          "event"
        ]
      },
      "example": {
        "schemaVersion": "attesko.edge.event.v1",
        "privacy": {
          "pseudonymization": "hmac-sha256",
          "keyId": "primary",
          "removedFieldCount": 0
        },
        "event": {
          "tenantId": "8786c412-4591-4a47-bb0a-be5440bd4e09",
          "principalExternalId": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
          "sourceSystem": "billing",
          "eventType": "invoice.updated",
          "occurredAt": "2026-09-02T15:00:00.000Z",
          "sourceRecordIds": [],
          "entities": [],
          "subjectExternalId": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
          "subjectType": "invoice",
          "beforeState": {
            "status": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          },
          "afterState": {
            "status": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          },
          "changedFields": [
            "status"
          ],
          "correlationId": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
          "idempotencyKey": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
        }
      },
      "developerSchema": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "minLength": 1,
            "description": "The Munky tenant id returned by tenants.upsert."
          },
          "source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,99}$",
            "description": "Your product's own name for where the event came from, e.g. billing."
          },
          "type": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,99}(?:\\.[a-z][a-z0-9_-]{0,99})+$",
            "description": "Your native dotted event name, <noun>.<verb>, e.g. invoice.opened."
          },
          "occurredAt": {
            "description": "When it happened, ISO 8601 or a Date. Defaults to now.",
            "anyOf": [
              {
                "type": "string"
              },
              {}
            ]
          },
          "actor": {
            "description": "Who acted, by your own id.",
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              }
            },
            "required": [
              "id"
            ]
          },
          "subject": {
            "description": "The record this event is about, by your own type and id.",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,99}$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              }
            },
            "required": [
              "type",
              "id"
            ]
          },
          "entities": {
            "description": "Other records involved, by your own types and ids.",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_-]{0,99}$"
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 400
                }
              },
              "required": [
                "type",
                "id"
              ]
            }
          },
          "changedFields": {
            "description": "Names of fields that changed. Only allow-listed operational names survive the Edge.",
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200
            }
          },
          "before": {
            "description": "State before, allow-listed fields only survive the Edge.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "after": {
            "description": "State after, allow-listed fields only survive the Edge.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "correlationId": {
            "description": "Your own id for the operation this event belongs to. Groups events into one episode.",
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "causationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "idempotencyKey": {
            "description": "Your once-only key for this event. Defaults to <source>:<type>:<subject id>:<occurredAt>.",
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "metadata": {
            "description": "Extra context. Allow-listed fields only survive the Edge.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "tenantId",
          "source",
          "type"
        ]
      },
      "developerExample": {
        "tenantId": "8786c412-4591-4a47-bb0a-be5440bd4e09",
        "source": "billing",
        "type": "invoice.updated",
        "occurredAt": "2026-09-02T15:00:00.000Z",
        "actor": {
          "id": "user-382"
        },
        "subject": {
          "type": "invoice",
          "id": "invoice-8291"
        },
        "changedFields": [
          "status"
        ],
        "before": {
          "status": "overdue"
        },
        "after": {
          "status": "follow_up_sent"
        },
        "correlationId": "chase-8291"
      },
      "notes": [
        "Send the envelope the Edge SDK produces. Every identifier is a `psn_v1_` pseudonym; state values that are not Munky's own vocabulary are pseudonyms too; only allow-listed field names survive.",
        "One envelope, or `{ \"events\": [ ...envelopes ] }` with 1 to 1,000 items. The route tenant is authoritative.",
        "Per-item rejection codes: `privacy_rejected`, `tenant_mismatch`, `schema_invalid`, `store_failed`. The request succeeds (200) whenever it is well formed; only the request itself being malformed is a 422."
      ]
    },
    "POST /v1/tenants/:tenantId/events/import": {
      "schema": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "attesko.edge.event.v1"
          },
          "privacy": {
            "type": "object",
            "properties": {
              "pseudonymization": {
                "type": "string",
                "const": "hmac-sha256"
              },
              "keyId": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,99}$"
              },
              "removedFieldCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "pseudonymization",
              "keyId",
              "removedFieldCount"
            ]
          },
          "event": {
            "type": "object",
            "properties": {
              "tenantId": {
                "type": "string",
                "minLength": 1
              },
              "eventId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "principalExternalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "sourceSystem": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "eventType": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "occurredAt": {
                "type": "string",
                "minLength": 1
              },
              "sourceRecordIds": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 400
                }
              },
              "entities": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "externalId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 400
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 400
                    }
                  },
                  "required": [
                    "type",
                    "externalId"
                  ]
                }
              },
              "subjectExternalId": {
                "type": "string",
                "maxLength": 400
              },
              "subjectType": {
                "type": "string",
                "maxLength": 100
              },
              "beforeState": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "afterState": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "changedFields": {
                "maxItems": 200,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "correlationId": {
                "type": "string",
                "maxLength": 400
              },
              "causationId": {
                "type": "string",
                "maxLength": 400
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              "provenance": {
                "type": "string",
                "enum": [
                  "product-reported",
                  "connected-system",
                  "inference",
                  "user-confirmed",
                  "verification-evidence"
                ]
              },
              "sensitivity": {
                "type": "string",
                "enum": [
                  "none",
                  "business",
                  "personal",
                  "financial"
                ]
              },
              "metadata": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "required": [
              "tenantId",
              "sourceSystem",
              "eventType",
              "occurredAt",
              "idempotencyKey"
            ]
          }
        },
        "required": [
          "schemaVersion",
          "privacy",
          "event"
        ]
      },
      "example": {
        "schemaVersion": "attesko.edge.event.v1",
        "privacy": {
          "pseudonymization": "hmac-sha256",
          "keyId": "primary",
          "removedFieldCount": 0
        },
        "event": {
          "tenantId": "8786c412-4591-4a47-bb0a-be5440bd4e09",
          "sourceSystem": "billing",
          "eventType": "invoice.sent",
          "occurredAt": "2026-06-01T10:00:00.000Z",
          "sourceRecordIds": [],
          "entities": [],
          "subjectExternalId": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
          "subjectType": "invoice",
          "changedFields": [],
          "idempotencyKey": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
        }
      },
      "developerSchema": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "minLength": 1,
            "description": "The Munky tenant id returned by tenants.upsert."
          },
          "source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,99}$",
            "description": "Your product's own name for where the event came from, e.g. billing."
          },
          "type": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,99}(?:\\.[a-z][a-z0-9_-]{0,99})+$",
            "description": "Your native dotted event name, <noun>.<verb>, e.g. invoice.opened."
          },
          "occurredAt": {
            "description": "When it happened, ISO 8601 or a Date. Defaults to now.",
            "anyOf": [
              {
                "type": "string"
              },
              {}
            ]
          },
          "actor": {
            "description": "Who acted, by your own id.",
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              }
            },
            "required": [
              "id"
            ]
          },
          "subject": {
            "description": "The record this event is about, by your own type and id.",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,99}$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              }
            },
            "required": [
              "type",
              "id"
            ]
          },
          "entities": {
            "description": "Other records involved, by your own types and ids.",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_-]{0,99}$"
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 400
                }
              },
              "required": [
                "type",
                "id"
              ]
            }
          },
          "changedFields": {
            "description": "Names of fields that changed. Only allow-listed operational names survive the Edge.",
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200
            }
          },
          "before": {
            "description": "State before, allow-listed fields only survive the Edge.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "after": {
            "description": "State after, allow-listed fields only survive the Edge.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "correlationId": {
            "description": "Your own id for the operation this event belongs to. Groups events into one episode.",
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "causationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "idempotencyKey": {
            "description": "Your once-only key for this event. Defaults to <source>:<type>:<subject id>:<occurredAt>.",
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "metadata": {
            "description": "Extra context. Allow-listed fields only survive the Edge.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "tenantId",
          "source",
          "type"
        ]
      },
      "notes": [
        "Same body as live intake. Imports are marked historical and never raise a proposal."
      ]
    },
    "POST /v1/tenants/:tenantId/events/aliases": {
      "schema": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "minLength": 1
          },
          "surface": {
            "type": "string",
            "minLength": 1
          },
          "action": {
            "type": "string",
            "minLength": 1
          },
          "confirmedByPrincipalId": {
            "type": "string",
            "minLength": 1
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "eventType",
          "surface",
          "action",
          "confirmedByPrincipalId"
        ]
      },
      "example": {
        "eventType": "invoice.chased",
        "surface": "invoice",
        "action": "submitting-or-sending",
        "confirmedByPrincipalId": "prn_2f1c…",
        "note": "Our word for sending the reminder"
      },
      "notes": [
        "`surface` and `action` are Munky's vocabulary for what the event means; `confirmedByPrincipalId` is the Munky id of the person confirming it (from a principal upsert)."
      ]
    },
    "POST /v1/tenants/:tenantId/learn": {
      "schema": {
        "type": "object",
        "properties": {}
      },
      "example": {},
      "notes": [
        "No body fields. Send `{}`."
      ]
    },
    "POST /v1/tenants/:tenantId/labels": {
      "schema": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "verdict": {
            "type": "string",
            "minLength": 1
          },
          "note": {
            "default": "",
            "type": "string",
            "maxLength": 2000
          },
          "labelledByPrincipalId": {
            "type": "string",
            "minLength": 1
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          }
        },
        "required": [
          "kind",
          "subject",
          "verdict",
          "labelledByPrincipalId",
          "principalAssertion"
        ]
      },
      "example": {
        "kind": "contract-intent",
        "subject": {
          "familyId": "fam_7c2e…",
          "contractVersion": 1
        },
        "verdict": "correct",
        "note": "",
        "labelledByPrincipalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature"
      },
      "notes": [
        "`kind` is one of: `same-family`, `same-variant`, `contract-intent`, `contract-inputs`, `contract-terminal-outcome`, `contract-executor`, `contract-verifier`, `contract-commit-boundary`, `contract-decision-points`, `contract-capability-mapping`, `case-eligibility`, `verifier-correctness`.",
        "Verdicts for `same-family`: `same-family`, `different-family`, `unsure`.",
        "Verdicts for `same-variant`: `same-variant`, `different-variant`, `unsure`.",
        "Verdicts for `contract-intent`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `contract-inputs`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `contract-terminal-outcome`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `contract-executor`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `contract-verifier`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `contract-commit-boundary`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `contract-decision-points`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `contract-capability-mapping`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `case-eligibility`: `correct`, `incorrect`, `unsure`.",
        "Verdicts for `verifier-correctness`: `correct`, `incorrect`, `unsure`.",
        "`subject` names what is being labelled: `{ familyId }` for a contract, `{ familyId, contractVersion }` for a field, `{ episodeIds: [a, b] }` for a pair kind.",
        "`principalAssertion` is a delegated-principal assertion signed with a registered Ed25519 key."
      ]
    },
    "POST /v1/capabilities": {
      "schema": {
        "type": "object",
        "properties": {
          "capabilityId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_\\-.]*$"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "performs": {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "minLength": 1
              },
              "entityType": {
                "type": "string",
                "minLength": 1
              },
              "surface": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "action",
              "entityType"
            ]
          },
          "idempotent": {
            "type": "boolean"
          },
          "customerFacing": {
            "type": "boolean"
          },
          "moneyMoving": {
            "type": "boolean"
          },
          "reversible": {
            "default": false,
            "type": "boolean"
          },
          "argumentSchema": {
            "default": {
              "type": "object"
            },
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "argumentBindings": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "const": "subject.externalId"
                    }
                  },
                  "required": [
                    "from"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "const": "event.afterState"
                    },
                    "field": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "from",
                    "field"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "const": "event.beforeState"
                    },
                    "field": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "from",
                    "field"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "const": "event.metadata"
                    },
                    "field": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "from",
                    "field"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "const": "entity"
                    },
                    "entityType": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "from",
                    "entityType"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "const": "constant"
                    },
                    "value": {}
                  },
                  "required": [
                    "from",
                    "value"
                  ]
                }
              ]
            }
          },
          "verifier": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "PRODUCT_EVENT"
                  },
                  "eventType": {
                    "type": "string",
                    "minLength": 1
                  },
                  "windowMinutes": {
                    "default": 60,
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 1440
                  },
                  "expect": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "minLength": 1
                        },
                        "expect": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "changed"
                            },
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "equals": {}
                              },
                              "required": [
                                "equals"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "equalsArgument": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "equalsArgument"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "field",
                        "expect"
                      ]
                    }
                  }
                },
                "required": [
                  "kind"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "SIGNED_HTTP_READ"
                  },
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "operation": {
                    "type": "string",
                    "minLength": 1
                  },
                  "recordPath": {
                    "type": "string"
                  },
                  "expect": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "minLength": 1
                        },
                        "expect": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "changed"
                            },
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "equals": {}
                              },
                              "required": [
                                "equals"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "equalsArgument": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "equalsArgument"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "field",
                        "expect"
                      ]
                    }
                  }
                },
                "required": [
                  "kind",
                  "connectionId",
                  "operation"
                ]
              }
            ]
          }
        },
        "required": [
          "capabilityId",
          "displayName",
          "performs",
          "idempotent",
          "customerFacing",
          "moneyMoving",
          "verifier"
        ]
      },
      "example": {
        "capabilityId": "invoice.send_follow_up",
        "displayName": "Send an invoice follow-up",
        "performs": {
          "action": "send",
          "entityType": "invoice",
          "surface": "billing"
        },
        "idempotent": true,
        "customerFacing": true,
        "moneyMoving": false,
        "reversible": false,
        "argumentSchema": {
          "type": "object",
          "required": [
            "invoiceId"
          ]
        },
        "argumentBindings": {
          "invoiceId": {
            "from": "subject.externalId"
          }
        },
        "verifier": {
          "kind": "PRODUCT_EVENT",
          "eventType": "invoice.updated",
          "windowMinutes": 60,
          "expect": [
            {
              "field": "status",
              "expect": "changed"
            }
          ]
        }
      },
      "notes": []
    },
    "POST /v1/tenants/:tenantId/connections": {
      "schema": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "provider": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "baseUrl": {
            "type": "string",
            "format": "uri"
          },
          "operations": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "pattern": "^\\/.*"
            }
          },
          "allowedOperations": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "healthPath": {
            "default": "/health",
            "type": "string",
            "pattern": "^\\/.*"
          },
          "signingSecret": {
            "type": "string",
            "minLength": 32
          },
          "scopes": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "externalAccountId": {
            "type": "string"
          },
          "timeoutMs": {
            "default": 10000,
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 120000
          }
        },
        "required": [
          "displayName",
          "provider",
          "baseUrl",
          "operations",
          "allowedOperations",
          "signingSecret"
        ]
      },
      "example": {
        "connectionId": "billing-read",
        "displayName": "Billing read API",
        "provider": "northwind",
        "baseUrl": "https://api.northwind.example",
        "operations": {
          "invoice": "/invoices/{id}"
        },
        "allowedOperations": [
          "invoice"
        ],
        "signingSecret": "a-signing-secret-of-at-least-32-characters"
      },
      "notes": [
        "`signingSecret` is sealed on receipt and never returned."
      ]
    },
    "POST /v1/proposals/:proposalId/approve": {
      "schema": {
        "type": "object",
        "properties": {
          "planHash": {
            "type": "string",
            "minLength": 1
          },
          "principalId": {
            "type": "string",
            "minLength": 1
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "trial": {
            "type": "object",
            "properties": {
              "maxCases": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 1000
              },
              "expiresAt": {
                "type": "string"
              },
              "reviewMinutesPerCase": {
                "default": 0,
                "type": "number",
                "minimum": 0,
                "maximum": 600
              }
            },
            "required": [
              "maxCases"
            ]
          }
        },
        "required": [
          "planHash",
          "principalId",
          "principalAssertion",
          "trial"
        ]
      },
      "example": {
        "planHash": "sha256:9f2c…",
        "principalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature",
        "trial": {
          "maxCases": 20,
          "expiresAt": "2026-09-09T15:00:00.000Z",
          "reviewMinutesPerCase": 1
        }
      },
      "notes": []
    },
    "POST /v1/proposals/:proposalId/decline": {
      "schema": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "minLength": 1
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "reason": {
            "type": "string",
            "enum": [
              "not-this-job",
              "wrong-path",
              "not-safe-yet",
              "wrong-capability",
              "later",
              "other",
              "wrong-job",
              "wrong-normal-path",
              "unsafe",
              "not-valuable",
              "wrong-capability-mapping",
              "wrong-timing",
              "customer-policy",
              "not-ready"
            ]
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "principalId",
          "principalAssertion",
          "reason"
        ]
      },
      "example": {
        "principalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature",
        "reason": "not-safe-yet",
        "note": "Wait for the new verifier"
      },
      "notes": [
        "`reason` is one of: `not-this-job`, `wrong-path`, `not-safe-yet`, `wrong-capability`, `later`, `other`, `wrong-job`, `wrong-normal-path`, `unsafe`, `not-valuable`, `wrong-capability-mapping`, `wrong-timing`, `customer-policy`, `not-ready`."
      ]
    },
    "POST /v1/trials/:trialId/stop": {
      "schema": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "minLength": 1
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "principalId",
          "principalAssertion"
        ]
      },
      "example": {
        "principalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature",
        "note": "Pausing during the audit"
      },
      "notes": []
    },
    "POST /v1/case-approvals/:approvalId/approve": {
      "schema": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "minLength": 1
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "planHash": {
            "type": "string",
            "minLength": 1
          },
          "reviewMinutes": {
            "default": 0,
            "type": "number",
            "minimum": 0
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "principalId",
          "principalAssertion",
          "planHash"
        ]
      },
      "example": {
        "principalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature",
        "planHash": "sha256:9f2c…",
        "reviewMinutes": 2
      },
      "notes": []
    },
    "POST /v1/case-approvals/:approvalId/decline": {
      "schema": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "minLength": 1
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "planHash": {
            "type": "string",
            "minLength": 1
          },
          "reviewMinutes": {
            "default": 0,
            "type": "number",
            "minimum": 0
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "principalId",
          "principalAssertion",
          "planHash"
        ]
      },
      "example": {
        "principalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature",
        "planHash": "sha256:9f2c…",
        "note": "Customer asked us to hold"
      },
      "notes": []
    },
    "POST /v1/tenants/:tenantId/edge-runtimes": {
      "schema": {
        "type": "object",
        "properties": {
          "runtimeExternalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "attesko-desktop",
              "customer-edge",
              "server-edge"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "macos",
              "windows",
              "linux",
              "server"
            ]
          },
          "runtimeVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "protocolVersion": {
            "type": "string",
            "const": "attesko.edge.runtime.v1"
          },
          "features": {
            "type": "object",
            "properties": {
              "observations": {
                "type": "boolean"
              },
              "execution": {
                "type": "string",
                "enum": [
                  "none",
                  "adapter"
                ]
              },
              "observationAdapters": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "native-event",
                        "browser-dom",
                        "os-accessibility",
                        "screen-capture"
                      ]
                    },
                    "sourceSystems": {
                      "default": [],
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "pattern": "^[a-z][a-z0-9_.-]*$"
                      }
                    }
                  },
                  "required": [
                    "kind"
                  ]
                }
              },
              "executionAdapters": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "native-api",
                        "mcp",
                        "browser-dom",
                        "os-accessibility"
                      ]
                    },
                    "capabilityIds": {
                      "default": [],
                      "maxItems": 200,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "pattern": "^[a-z][a-z0-9_.-]*$"
                      }
                    },
                    "attendance": {
                      "type": "string",
                      "enum": [
                        "attended"
                      ]
                    }
                  },
                  "required": [
                    "kind"
                  ]
                }
              },
              "uncertaintyChannels": {
                "default": [],
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "local-notification",
                    "sms",
                    "email",
                    "webhook"
                  ]
                }
              }
            },
            "required": [
              "observations",
              "execution"
            ]
          }
        },
        "required": [
          "runtimeExternalId",
          "kind",
          "platform",
          "runtimeVersion",
          "protocolVersion",
          "features"
        ]
      },
      "example": {
        "runtimeExternalId": "install-6f4d2a",
        "kind": "customer-edge",
        "platform": "macos",
        "runtimeVersion": "1.0.0",
        "protocolVersion": "attesko.edge.runtime.v1",
        "features": {
          "observations": true,
          "execution": "none",
          "observationAdapters": [
            {
              "kind": "native-event",
              "sourceSystems": [
                "billing"
              ]
            }
          ],
          "executionAdapters": [],
          "uncertaintyChannels": [
            "local-notification"
          ]
        }
      },
      "notes": [
        "The response returns a short-lived `attsk_rt_` runtime credential once. Store it only in the runtime's local secret store.",
        "Adapter declarations describe reach; they do not establish that a browser or native actuator exists.",
        "Every declared execution adapter must carry `\"attendance\": \"attended\"`. That is the only value: no rung has earned unattended use, and an adapter that states nothing is refused here and dispatched no work."
      ]
    },
    "POST /v1/edge-runtimes/:runtimeId/heartbeat": {
      "schema": {
        "type": "object",
        "properties": {
          "observedAt": {
            "type": "string"
          },
          "runtimeVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "enum": [
              "online",
              "degraded",
              "paused"
            ]
          },
          "adapterHealth": {
            "default": [],
            "maxItems": 40,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "native-event",
                        "browser-dom",
                        "os-accessibility",
                        "screen-capture"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "native-api",
                        "mcp",
                        "browser-dom",
                        "os-accessibility"
                      ]
                    }
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "ready",
                    "degraded",
                    "unavailable"
                  ]
                },
                "reasonCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "pattern": "^[a-z][a-z0-9_.-]*$"
                }
              },
              "required": [
                "kind",
                "state"
              ],
              "additionalProperties": false
            }
          },
          "activeAssignmentIds": {
            "default": [],
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
            }
          }
        },
        "required": [
          "observedAt",
          "runtimeVersion",
          "state"
        ],
        "additionalProperties": false
      },
      "example": {
        "observedAt": "2026-09-03T15:00:00.000Z",
        "runtimeVersion": "1.0.0",
        "state": "online",
        "adapterHealth": [
          {
            "kind": "native-event",
            "state": "ready"
          }
        ],
        "activeAssignmentIds": []
      },
      "notes": [
        "Authenticate with the runtime credential, not a project key."
      ]
    },
    "POST /v1/edge-runtimes/:runtimeId/events": {
      "schema": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "attesko.edge.event.v1"
          },
          "privacy": {
            "type": "object",
            "properties": {
              "pseudonymization": {
                "type": "string",
                "const": "hmac-sha256"
              },
              "keyId": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,99}$"
              },
              "removedFieldCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "pseudonymization",
              "keyId",
              "removedFieldCount"
            ]
          },
          "event": {
            "type": "object",
            "properties": {
              "tenantId": {
                "type": "string",
                "minLength": 1
              },
              "eventId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "principalExternalId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "sourceSystem": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "eventType": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "occurredAt": {
                "type": "string",
                "minLength": 1
              },
              "sourceRecordIds": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 400
                }
              },
              "entities": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "externalId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 400
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 400
                    }
                  },
                  "required": [
                    "type",
                    "externalId"
                  ]
                }
              },
              "subjectExternalId": {
                "type": "string",
                "maxLength": 400
              },
              "subjectType": {
                "type": "string",
                "maxLength": 100
              },
              "beforeState": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "afterState": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "changedFields": {
                "maxItems": 200,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "correlationId": {
                "type": "string",
                "maxLength": 400
              },
              "causationId": {
                "type": "string",
                "maxLength": 400
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              "provenance": {
                "type": "string",
                "enum": [
                  "product-reported",
                  "connected-system",
                  "inference",
                  "user-confirmed",
                  "verification-evidence"
                ]
              },
              "sensitivity": {
                "type": "string",
                "enum": [
                  "none",
                  "business",
                  "personal",
                  "financial"
                ]
              },
              "metadata": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "required": [
              "tenantId",
              "sourceSystem",
              "eventType",
              "occurredAt",
              "idempotencyKey"
            ]
          }
        },
        "required": [
          "schemaVersion",
          "privacy",
          "event"
        ]
      },
      "example": {
        "schemaVersion": "attesko.edge.event.v1",
        "privacy": {
          "pseudonymization": "hmac-sha256",
          "keyId": "primary",
          "removedFieldCount": 0
        },
        "event": {
          "tenantId": "8786c412-4591-4a47-bb0a-be5440bd4e09",
          "sourceSystem": "billing",
          "eventType": "invoice.updated",
          "occurredAt": "2026-09-03T15:00:00.000Z",
          "sourceRecordIds": [],
          "entities": [],
          "subjectExternalId": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
          "subjectType": "invoice",
          "changedFields": [
            "status"
          ],
          "idempotencyKey": "psn_v1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
        }
      },
      "notes": [
        "Authenticate with the runtime credential. The route tenant is bound by that credential, and the source system must have been declared at registration.",
        "One envelope, or `{ \"events\": [ ...envelopes ] }` with 1 to 1,000 items."
      ]
    },
    "POST /v1/edge-runtimes/:runtimeId/work/:workItemId/report": {
      "schema": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "performed",
              "refused",
              "failed"
            ]
          },
          "reference": {
            "type": "string",
            "maxLength": 400
          },
          "artifact": {
            "type": "string",
            "maxLength": 4000
          },
          "detail": {
            "type": "string",
            "maxLength": 4000
          },
          "performedAt": {
            "type": "string"
          },
          "assignmentId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "bindingHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "outcome",
          "assignmentId",
          "bindingHash"
        ]
      },
      "example": {
        "assignmentId": "assignment-8841",
        "bindingHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "outcome": "performed",
        "reference": "email_8841",
        "artifact": "Reminder sent for invoice 8291",
        "performedAt": "2026-09-03T15:01:12.000Z"
      },
      "notes": [
        "Authenticate with the runtime credential. `performed` is a report, not success; the core verifies independently."
      ]
    },
    "POST /v1/edge-runtimes/:runtimeId/work/:workItemId/uncertainties": {
      "schema": {
        "type": "object",
        "properties": {
          "assignmentId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "bindingHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "reason": {
            "type": "string",
            "enum": [
              "missing-input",
              "target-ambiguous",
              "state-drift",
              "adapter-unavailable",
              "permission-required",
              "policy-blocked",
              "security-signal",
              "checkpoint-mismatch",
              "verification-ambiguous"
            ]
          },
          "reasonCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_.-]*$"
          },
          "context": {
            "default": {
              "requiredFieldNames": [],
              "optionIds": []
            },
            "type": "object",
            "properties": {
              "checkpointId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
              },
              "requiredFieldNames": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "pattern": "^[a-z][a-z0-9_.-]*$"
                }
              },
              "optionIds": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
                }
              },
              "candidateCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              }
            },
            "additionalProperties": false
          },
          "observedAt": {
            "type": "string"
          }
        },
        "required": [
          "assignmentId",
          "bindingHash",
          "reason",
          "reasonCode",
          "observedAt"
        ],
        "additionalProperties": false
      },
      "example": {
        "assignmentId": "assignment-8841",
        "bindingHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "reason": "target-ambiguous",
        "reasonCode": "multiple-matching-records",
        "context": {
          "requiredFieldNames": [],
          "optionIds": [
            "record-1",
            "record-2"
          ],
          "candidateCount": 2
        },
        "observedAt": "2026-09-03T15:01:00.000Z"
      },
      "notes": [
        "Send structural identifiers and reason codes only; do not send screenshots, DOM text, document content, or exception messages."
      ]
    },
    "POST /v1/work-uncertainties/:uncertaintyId/resolve": {
      "schema": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "minLength": 1
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "bindingHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "resolution": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "retry"
                  }
                },
                "required": [
                  "kind"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "cancel"
                  }
                },
                "required": [
                  "kind"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "select-option"
                  },
                  "optionId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
                  }
                },
                "required": [
                  "kind",
                  "optionId"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "principalId",
          "principalAssertion",
          "bindingHash",
          "resolution"
        ]
      },
      "example": {
        "principalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature",
        "bindingHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
        "resolution": {
          "kind": "select-option",
          "optionId": "record-1"
        }
      },
      "notes": [
        "The delegated-principal assertion and `bindingHash` bind the exact uncertainty decision."
      ]
    },
    "POST /v1/work/:workItemId/report": {
      "schema": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "performed",
              "refused",
              "failed"
            ]
          },
          "reference": {
            "type": "string",
            "maxLength": 400
          },
          "artifact": {
            "type": "string",
            "maxLength": 4000
          },
          "detail": {
            "type": "string",
            "maxLength": 4000
          },
          "performedAt": {
            "type": "string"
          }
        },
        "required": [
          "outcome"
        ]
      },
      "example": {
        "outcome": "performed",
        "reference": "email_8841",
        "artifact": "Reminder sent for invoice 8291",
        "performedAt": "2026-09-02T15:01:12.000Z"
      },
      "notes": [
        "`outcome` is `performed`, `refused`, or `failed`. Never report success; Munky verifies."
      ]
    },
    "POST /v1/tenants/:tenantId/corrections": {
      "schema": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "merge-families",
              "split-family",
              "reassign-episode",
              "create-family-from-episodes",
              "alias-equivalent",
              "must-not-share-family",
              "reject-contract",
              "correct-intent",
              "correct-executor-mapping",
              "correct-verifier-mapping",
              "correct-input-fields",
              "correct-terminal-outcome",
              "correct-variant-assignment"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "different-business-outcome",
              "different-target-records",
              "different-side-effects",
              "same-job-different-names",
              "same-job-different-route",
              "wrong-operation-selected",
              "wrong-verification-selected",
              "wrong-inputs-inferred",
              "evidence-was-a-mixture",
              "provider-changed",
              "policy-changed",
              "operator-judgement"
            ]
          },
          "principalId": {
            "type": "string",
            "minLength": 1
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "subject": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "payload": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "principalAssertion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          }
        },
        "required": [
          "kind",
          "reason",
          "principalId",
          "subject",
          "principalAssertion"
        ]
      },
      "example": {
        "kind": "correct-variant-assignment",
        "reason": "same-job-different-route",
        "principalId": "prn_2f1c…",
        "principalAssertion": "eyJhbGciOiJFZERTQSJ9.example.signature",
        "subject": {
          "familyId": "fam_7c2e…",
          "episodeId": "ep_1a9d…"
        },
        "payload": {
          "variantId": "normal"
        }
      },
      "notes": []
    },
    "POST /v1/webhooks": {
      "schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "eventTypes": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "job.understood",
                "job.eligible",
                "proposal.created",
                "proposal.approved",
                "proposal.declined",
                "proposal.expired",
                "trial.started",
                "trial.exhausted",
                "trial.stopped",
                "trial.completed",
                "work.issued",
                "work.verified",
                "work.failed",
                "work.requires_human",
                "receipt.created",
                "correction.applied",
                "connection.degraded"
              ]
            }
          },
          "secret": {
            "type": "string",
            "minLength": 32
          }
        },
        "required": [
          "url",
          "eventTypes"
        ]
      },
      "example": {
        "url": "https://example.com/webhooks/attesko",
        "eventTypes": [
          "proposal.created",
          "work.issued",
          "receipt.created"
        ]
      },
      "notes": [
        "`eventTypes` are from: `job.understood`, `job.eligible`, `proposal.created`, `proposal.approved`, `proposal.declined`, `proposal.expired`, `trial.started`, `trial.exhausted`, `trial.stopped`, `trial.completed`, `work.issued`, `work.verified`, `work.failed`, `work.requires_human`, `receipt.created`, `correction.applied`, `connection.degraded`.",
        "Optional `secret` (32+ characters) to bring your own signing secret; otherwise one is generated and returned once."
      ]
    },
    "POST /v1/webhooks/deliveries/:eventId/replay": {
      "schema": {
        "type": "object",
        "properties": {}
      },
      "example": {},
      "notes": [
        "No body fields. The event id in the path must be a UUID."
      ]
    },
    "POST /v1/edge-runtimes/:runtimeId/frame-escalations": {
      "schema": {
        "type": "object",
        "properties": {
          "promptVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "maxOutputTokens": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "escalationReason": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,40}$"
          },
          "evidence": {
            "type": "object",
            "properties": {
              "recordId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "capturedAt": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "width": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "height": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "frameBase64": {
                "type": "string",
                "minLength": 1,
                "maxLength": 12000000
              },
              "frameEncoding": {
                "type": "string",
                "enum": [
                  "rgba",
                  "png"
                ]
              },
              "redactionVersion": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "activity": {
                "type": "object",
                "properties": {
                  "foregroundApplication": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "windowTitle": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "browserUrl": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "pointerActivity": {
                    "type": "boolean"
                  },
                  "keyboardActivity": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "foregroundApplication",
                  "windowTitle",
                  "browserUrl",
                  "pointerActivity",
                  "keyboardActivity"
                ]
              }
            },
            "required": [
              "recordId",
              "capturedAt",
              "width",
              "height",
              "frameBase64",
              "redactionVersion",
              "activity"
            ]
          }
        },
        "required": [
          "promptVersion",
          "maxOutputTokens",
          "evidence"
        ]
      },
      "example": {
        "promptVersion": "frames-to-events-v8",
        "maxOutputTokens": 4096,
        "escalationReason": "insufficient-history",
        "evidence": {
          "recordId": "capture-8f21",
          "capturedAt": "2026-09-03T09:15:00.000Z",
          "width": 1440,
          "height": 900,
          "frameBase64": "iVBORw0KGgo=",
          "frameEncoding": "png",
          "redactionVersion": "redactor-v4",
          "activity": {
            "foregroundApplication": "Practice Manager",
            "windowTitle": null,
            "browserUrl": null,
            "pointerActivity": true,
            "keyboardActivity": false
          }
        }
      },
      "notes": [
        "For a runtime that runs its own frame tier and met a screen its history cannot answer. The runtime must have declared observation support when it registered; the tenant is the runtime's own and cannot be named in the body.",
        "`promptVersion` names the frame-understanding instruction to answer under. A prompt itself is never sent: Munky renders its own text for the version and refuses a version it does not hold, so a runtime cannot choose what a provider is asked.",
        "`evidence` must be the redactor's output. A `redactionVersion` of `raw`, `none`, `unredacted`, or `passthrough` is refused before any provider is called and before any allowance is spent. `frameEncoding` must be `png` — an escalation carries an encoded frame — and `frameBase64` is at most 2,000,000 characters, which keeps the whole request inside the 2 MiB body ceiling every other `/v1` route lives with.",
        "`escalationReason` is a lower-case slug describing why the local tier could not answer, matching `^[a-z][a-z0-9-]{0,40}$`. It is recorded on the departure notice, so it must never carry a window title, a URL, or anything else read off the screen.",
        "The answer is always 200 and is either `{ \"ok\": true, \"output\": …, \"usage\": … }` or `{ \"ok\": false, \"reason\": …, \"detail\": …, \"retryAfterSeconds\"?: … }`. `reason` is one of `unsupported-prompt-version`, `budget-exhausted`, `evidence-refused`, or `provider-unavailable`; only `provider-unavailable` should be retried with the same frame, and `budget-exhausted` resolves when the tenant's window does.",
        "The per-tenant escalation ceiling is spent when the frame is sent and is never refunded, including when the provider fails: what it bounds is frames leaving a machine, and one that left unanswered still left. A ceiling that cannot be read answers `budget-exhausted` too — see ADR-0043.",
        "Send `x-attesko-idempotency-key` and one frame is one escalation however many times it is sent. A key that has already been answered is answered again with the same `output` and `usage`, at no further cost and against no further allowance; a resend arriving while the first attempt is still running is refused `provider-unavailable` rather than read twice. Omitting the header does not opt out — Munky keys the frame by `evidence.recordId`, which is what the official runtime builds its header from. See ADR-0051."
      ]
    },
    "POST /v1/apps/:appId/accounts/signup": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "password": {
            "type": "string",
            "minLength": 10,
            "maxLength": 1024
          }
        },
        "required": [
          "email",
          "password"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "password": "example-password-long-enough"
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/accounts/resend": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com"
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/accounts/verify": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "email",
          "code"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "code": "123456"
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/accounts/recovery/start": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com"
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/accounts/recovery/verify": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "email",
          "code"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "code": "123456"
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/sessions/sign-in": {
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "required": [
          "email",
          "password"
        ],
        "additionalProperties": false
      },
      "example": {
        "email": "person@example.com",
        "password": "example-password-long-enough"
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/sessions/current": {
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "example": {},
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/sessions/revoke": {
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "example": {},
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/workspaces": {
      "schema": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "displayName"
        ],
        "additionalProperties": false
      },
      "example": {
        "displayName": "My work"
      },
      "notes": [
        "Workspace kind is set by the configured application; MUNKY OS is personal."
      ]
    },
    "PUT /v1/apps/:appId/workspaces/:workspaceId/policy": {
      "schema": {
        "type": "object",
        "properties": {
          "paused": {
            "type": "boolean"
          }
        },
        "required": [
          "paused"
        ],
        "additionalProperties": false
      },
      "example": {
        "paused": true
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/workspaces/:workspaceId/devices": {
      "schema": {
        "type": "object",
        "properties": {
          "runtimeExternalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "attesko-desktop",
              "customer-edge",
              "server-edge"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "macos",
              "windows",
              "linux",
              "server"
            ]
          },
          "runtimeVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "protocolVersion": {
            "type": "string",
            "const": "attesko.edge.runtime.v1"
          },
          "features": {
            "type": "object",
            "properties": {
              "observations": {
                "type": "boolean"
              },
              "execution": {
                "type": "string",
                "enum": [
                  "none",
                  "adapter"
                ]
              },
              "observationAdapters": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "native-event",
                        "browser-dom",
                        "os-accessibility",
                        "screen-capture"
                      ]
                    },
                    "sourceSystems": {
                      "default": [],
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "pattern": "^[a-z][a-z0-9_.-]*$"
                      }
                    }
                  },
                  "required": [
                    "kind"
                  ]
                }
              },
              "executionAdapters": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "native-api",
                        "mcp",
                        "browser-dom",
                        "os-accessibility"
                      ]
                    },
                    "capabilityIds": {
                      "default": [],
                      "maxItems": 200,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "pattern": "^[a-z][a-z0-9_.-]*$"
                      }
                    },
                    "attendance": {
                      "type": "string",
                      "enum": [
                        "attended"
                      ]
                    }
                  },
                  "required": [
                    "kind"
                  ]
                }
              },
              "uncertaintyChannels": {
                "default": [],
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "local-notification",
                    "sms",
                    "email",
                    "webhook"
                  ]
                }
              }
            },
            "required": [
              "observations",
              "execution"
            ]
          }
        },
        "required": [
          "runtimeExternalId",
          "kind",
          "platform",
          "runtimeVersion",
          "protocolVersion",
          "features"
        ]
      },
      "example": {
        "runtimeExternalId": "installation-1",
        "kind": "customer-edge",
        "platform": "macos",
        "runtimeVersion": "1.0.0",
        "protocolVersion": "attesko.edge.runtime.v1",
        "features": {
          "observations": false,
          "execution": "none",
          "observationAdapters": [],
          "executionAdapters": [],
          "uncertaintyChannels": []
        }
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/workspaces/:workspaceId/phone-challenges": {
      "schema": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{7,14}$"
          },
          "consent": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "phone",
          "consent"
        ],
        "additionalProperties": false
      },
      "example": {
        "phone": "+15555550123",
        "consent": true
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    },
    "POST /v1/apps/:appId/workspaces/:workspaceId/phone-challenges/:challengeId/verify": {
      "schema": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      },
      "example": {
        "code": "123456"
      },
      "notes": [
        "Native client sends no project key. Authenticated operations require x-munky-application-session; credentials never belong in URLs."
      ]
    }
  },
  "errors": {
    "application_account_owns_workspace": {
      "status": 409,
      "meaning": "Erase all workspaces owned by this account before deleting the account."
    },
    "application_credentials_invalid": {
      "status": 401,
      "meaning": "Email, password or verification code was not accepted for this application and environment."
    },
    "application_device_not_found": {
      "status": 404,
      "meaning": "The device is not visible to this workspace member."
    },
    "application_executor_admin_required": {
      "status": 403,
      "meaning": "Only a workspace owner or administrator can enroll an execution-capable runtime."
    },
    "application_invitation_invalid": {
      "status": 404,
      "meaning": "The invitation is expired, revoked, consumed or not addressed to this application account."
    },
    "application_mail_unavailable": {
      "status": 503,
      "meaning": "The application cannot deliver verification email."
    },
    "application_member_not_found": {
      "status": 404,
      "meaning": "The requested active workspace member was not found."
    },
    "application_membership_exists": {
      "status": 409,
      "meaning": "This account already has active membership."
    },
    "application_rate_limited": {
      "status": 429,
      "meaning": "This account or application has reached an authentication attempt or email limit. Do not retry immediately."
    },
    "application_session_invalid": {
      "status": 401,
      "meaning": "The application session is missing, expired, revoked or belongs to another application/environment."
    },
    "application_workspace_admin_required": {
      "status": 403,
      "meaning": "Workspace owner or administrator membership is required."
    },
    "application_workspace_not_found": {
      "status": 404,
      "meaning": "No active membership in this application workspace."
    },
    "application_workspace_owner_required": {
      "status": 403,
      "meaning": "Only the workspace owner may perform this operation."
    },
    "assertion_key_exists": {
      "status": 409,
      "meaning": "A key with that id is already registered for the environment."
    },
    "assertion_key_not_found": {
      "status": 404,
      "meaning": "No such delegated-principal key."
    },
    "assertion_key_store_not_configured": {
      "status": 503,
      "meaning": "This deployment has no delegated-principal key store."
    },
    "assignment_expired": {
      "status": 409,
      "meaning": "The Edge assignment lease has expired."
    },
    "assignment_not_found": {
      "status": 404,
      "meaning": "The assignment does not exist or is not bound to this runtime, tenant, and work item."
    },
    "attendance_not_declared": {
      "status": 422,
      "meaning": "An execution adapter did not state the attendance its rung has proved. Every built rung is attended: send `\"attendance\": \"attended\"` on each declared execution adapter."
    },
    "binding_hash_mismatch": {
      "status": 409,
      "meaning": "The supplied binding hash is not the exact current assignment or uncertainty binding."
    },
    "capability_not_declared": {
      "status": 422,
      "meaning": "An execution adapter names a capability that is absent or withdrawn."
    },
    "company_work_paused": {
      "status": 403,
      "meaning": "The connected business has paused new device work. Existing reports and independent verification remain available. This restriction is specific to the first-party business deployment."
    },
    "credential_invalid": {
      "status": 401,
      "meaning": "The key is absent, invalid, revoked, or for another environment. Do not retry unchanged."
    },
    "credentials_invalid": {
      "status": 401,
      "meaning": "The Product email and password pair did not authenticate."
    },
    "delivery_not_replayable": {
      "status": 404,
      "meaning": "No project-owned delivery with that event id is eligible for replay."
    },
    "desktop_gateway_unavailable": {
      "status": 503,
      "meaning": "Native gateway is unconfigured or its server credential is invalid or lacks required scopes."
    },
    "desktop_origin_forbidden": {
      "status": 403,
      "meaning": "This gateway accepts native HTTP requests without a browser Origin only."
    },
    "desktop_request_failed": {
      "status": 502,
      "meaning": "The gateway could not obtain a valid API response."
    },
    "device_credential_invalid": {
      "status": 401,
      "meaning": "The Product installation key is unknown, expired, revoked, or presented by another installation. Enrol the installation again."
    },
    "docs_not_deployed": {
      "status": 503,
      "meaning": "The deployment was built without its docs directory."
    },
    "forbidden": {
      "status": 403,
      "meaning": "The caller may not perform this operation on this resource."
    },
    "internal_error": {
      "status": 500,
      "meaning": "Munky's fault. Retry with the same idempotency key; the incident is logged with the request id."
    },
    "invalid_assertion_key": {
      "status": 400,
      "meaning": "The public key is not a valid Ed25519 SPKI PEM or the key id is malformed."
    },
    "invalid_environment": {
      "status": 400,
      "meaning": "The environment is not development, staging, or production."
    },
    "not_found": {
      "status": 404,
      "meaning": "No such resource in this project and environment."
    },
    "not_ready": {
      "status": 503,
      "meaning": "The database or required application schema is unavailable."
    },
    "observation_not_declared": {
      "status": 403,
      "meaning": "This runtime did not declare observation support when it registered."
    },
    "option_not_offered": {
      "status": 422,
      "meaning": "The resolution selects an option that the uncertainty record did not offer."
    },
    "payload_too_large": {
      "status": 413,
      "meaning": "The JSON body exceeds the route's limit: 2 MiB for events, 256 KiB elsewhere."
    },
    "personal_workspace_single_member": {
      "status": 403,
      "meaning": "Personal workspaces cannot invite other members."
    },
    "principal_assertion_invalid": {
      "status": 401,
      "meaning": "The delegated principal assertion does not verify for this decision, or, on a first-party Product decision route, was not signed under the authenticated installation's own key id. Sign the exact decision again on the machine that holds the key."
    },
    "product_enrollment_failed": {
      "status": 500,
      "meaning": "Product installation enrolment could not be completed. Retry; nothing was issued."
    },
    "registration_invalid": {
      "status": 400,
      "meaning": "First-party Product account creation was refused: the address or password did not meet the account rules."
    },
    "replay_unavailable": {
      "status": 503,
      "meaning": "This deployment cannot replay deliveries."
    },
    "resolution_conflict": {
      "status": 409,
      "meaning": "The uncertainty was already resolved with a different decision."
    },
    "runtime_not_deployed": {
      "status": 503,
      "meaning": "The local runtime release artifact is unavailable."
    },
    "runtime_not_found": {
      "status": 404,
      "meaning": "No such Edge runtime is visible to this caller."
    },
    "runtime_not_ready": {
      "status": 409,
      "meaning": "The runtime is not online or its latest heartbeat is no longer fresh."
    },
    "scope_required": {
      "status": 403,
      "meaning": "The key lacks the route's required scope."
    },
    "sdk_not_deployed": {
      "status": 503,
      "meaning": "The release is missing its SDK artifact; contact the operator."
    },
    "seat_principal_missing": {
      "status": 409,
      "meaning": "This Product seat has no principal yet, so it can decide nothing. Enrol the installation again."
    },
    "seat_revoked": {
      "status": 403,
      "meaning": "This Product seat or installation has been revoked. Nothing it presents will be accepted; sign the person out."
    },
    "source_not_declared": {
      "status": 403,
      "meaning": "The event source is not among this runtime's declared observation sources."
    },
    "stale_heartbeat": {
      "status": 409,
      "meaning": "The heartbeat predates the runtime's latest accepted health state."
    },
    "tenant_forbidden": {
      "status": 403,
      "meaning": "The tenant is outside this project or environment, or has been erased. Treat as an authorization fault."
    },
    "text_decision_conflict": {
      "status": 409,
      "meaning": "The request ID, conversation, binding or delivery state conflicts with stored state. Do not replace the prompt or blindly resend."
    },
    "text_decision_invalid": {
      "status": 422,
      "meaning": "The prompt, principal, tenant, quote or time window is invalid."
    },
    "text_decision_not_found": {
      "status": 404,
      "meaning": "No decision exists in this tenant and project environment."
    },
    "text_delivery_unavailable": {
      "status": 503,
      "meaning": "Verified text delivery is not enabled or its provider is not configured."
    },
    "timestamp_invalid": {
      "status": 422,
      "meaning": "The runtime timestamp is invalid or outside the accepted clock window."
    },
    "too_many_requests": {
      "status": 429,
      "meaning": "Wait for the Retry-After duration before retrying."
    },
    "uncertainty_conflict": {
      "status": 409,
      "meaning": "This assignment already has a different open uncertainty record."
    },
    "uncertainty_expired": {
      "status": 409,
      "meaning": "The uncertainty decision window has expired."
    },
    "validation_failed": {
      "status": 422,
      "meaning": "The request itself is malformed: not JSON, wrong shape, or a parameter outside its documented form. `detail` lists the fields. Correct it before retrying."
    },
    "verification_invalid": {
      "status": 401,
      "meaning": "The emailed Product verification code is wrong, already used, or expired."
    },
    "webhook_delete_unavailable": {
      "status": 503,
      "meaning": "This deployment cannot remove webhooks."
    },
    "work_lease_missing": {
      "status": 409,
      "meaning": "The core could not bind an Edge assignment because the work lease had no expiry."
    }
  }
}
