{"openapi":"3.1.0","info":{"title":"GetAIable API","version":"0.3.1","description":"Asynchronous, deterministic public website agent-readiness scans. Reports are canonical, versioned, and content-hashed."},"servers":[{"url":"http://127.0.0.1:4000","description":"Local development API"}],"tags":[{"name":"scans","description":"Anonymous and owned readiness scans"},{"name":"sites","description":"Owned sites, revisions, and comparisons"},{"name":"account","description":"Passwordless accounts and data ownership"},{"name":"industry-index","description":"Published anonymous industry aggregates"}],"paths":{"/v1/industry-index":{"get":{"operationId":"getIndustryIndex","tags":["industry-index"],"summary":"Read the current industry index by industry or metric","description":"Computed from every stored report and classification, refreshed at most once a minute; the same aggregate the web page and MCP use. Unknown measurements remain unknown; small populations are withheld. No site identities or report evidence are exposed.","parameters":[{"name":"industry","in":"query","schema":{"type":"string"},"description":"Industry identifier in the selected snapshot."},{"name":"metric","in":"query","schema":{"type":"string"},"description":"Measurement identifier/key or check identifier in the selected snapshot."},{"name":"group_by","in":"query","schema":{"type":"string","enum":["industry","metric"],"default":"industry"}}],"responses":{"200":{"description":"Anonymous snapshot aggregates or an explicit empty state","content":{"application/json":{"schema":{"type":"object","required":["snapshot","group_by","groups"],"properties":{"snapshot":{"anyOf":[{"$ref":"#/components/schemas/IndustrySnapshot"},{"type":"null"}]},"group_by":{"type":"string","enum":["industry","metric"]},"groups":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/IndustryGroup"},{"$ref":"#/components/schemas/IndustryMetric"}]}},"check_groups":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IndustryCheck"},{"type":"object","required":["industry","sites"],"properties":{"industry":{"type":"string"},"sites":{"type":"integer","minimum":0}}}]}},"empty":{"type":"boolean"}}}}}},"400":{"description":"Invalid or unsupported filter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Snapshot storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health":{"get":{"operationId":"getHealth","tags":["scans"],"summary":"Service health probe","responses":{"200":{"description":"Service status","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/openapi.json":{"get":{"operationId":"getOpenapi","tags":["scans"],"summary":"This document","responses":{"200":{"description":"OpenAPI 3.1 document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/registry":{"get":{"operationId":"getRegistryInfo","tags":["scans"],"summary":"Registry and methodology versions","responses":{"200":{"description":"Registry pointer","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/scans":{"post":{"operationId":"startReadinessScan","tags":["scans"],"summary":"Queue a readiness scan for a public URL","parameters":[{"name":"idempotency-key","in":"header","required":true,"schema":{"type":"string"},"description":"Client-generated idempotency key; retries with the same key return the same scan."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Public http(s) URL to scan."}}}}}},"responses":{"202":{"description":"Scan queued with access grant","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"INVALID_REQUEST: url is required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target rejected (INVALID_TARGET, UNSUPPORTED_SCHEME, TARGET_UNREACHABLE, ...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scans/{scan_id}":{"get":{"operationId":"getReadinessScan","tags":["scans"],"summary":"Read scan lifecycle and latest or selected historical attempt summary","description":"Omit attempt_id for the latest attempt. Selecting an immutable historical attempt requires the verified owning account; a scan grant alone is not sufficient.","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"grant","in":"query","required":false,"schema":{"type":"string"},"description":"Anonymous scan access grant returned by startReadinessScan."},{"name":"attempt_id","in":"query","required":false,"schema":{"type":"string"},"description":"Immutable historical attempt selector. Requires the verified owning account; omitted uses the latest attempt and may use a scan grant."}],"security":[{"scanGrant":[]},{"accountToken":[]}],"responses":{"200":{"description":"Scan summary and attempt summary","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"GRANT_INVALID or TOKEN_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SCAN_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scans/{scan_id}/events":{"get":{"operationId":"listScanEvents","tags":["scans"],"summary":"Ordered scan events","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"grant","in":"query","required":false,"schema":{"type":"string"},"description":"Anonymous scan access grant returned by startReadinessScan."}],"security":[{"scanGrant":[]},{"accountToken":[]}],"responses":{"200":{"description":"Ordered events","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Scan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scans/{scan_id}/report":{"get":{"operationId":"getReadinessReport","tags":["scans"],"summary":"Read the latest or selected historical canonical readiness report","description":"Selecting an immutable historical report requires the verified owning account; a scan grant alone is not sufficient.","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"grant","in":"query","required":false,"schema":{"type":"string"},"description":"Anonymous scan access grant returned by startReadinessScan."},{"name":"attempt_id","in":"query","required":false,"schema":{"type":"string"},"description":"Immutable historical attempt selector. Requires the verified owning account; omitted uses the latest attempt and may use a scan grant."}],"security":[{"scanGrant":[]},{"accountToken":[]}],"responses":{"200":{"description":"Canonical report.json","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Scan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"REPORT_NOT_READY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scans/{scan_id}/findings":{"get":{"operationId":"listReadinessFindings","tags":["scans"],"summary":"List findings from the latest or selected historical report","description":"Selecting an immutable historical report requires the verified owning account; a scan grant alone is not sufficient.","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"grant","in":"query","required":false,"schema":{"type":"string"},"description":"Anonymous scan access grant returned by startReadinessScan."},{"name":"attempt_id","in":"query","required":false,"schema":{"type":"string"},"description":"Immutable historical attempt selector. Requires the verified owning account; omitted uses the latest attempt and may use a scan grant."}],"security":[{"scanGrant":[]},{"accountToken":[]}],"responses":{"200":{"description":"Findings","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Scan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"REPORT_NOT_READY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scans/{scan_id}/rechecks":{"post":{"operationId":"createRecheck","tags":["scans"],"summary":"Queue a new immutable revision for an owned site","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":true,"schema":{"type":"string"}}],"security":[{"accountToken":[]}],"responses":{"202":{"description":"Recheck queued","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Not owned by this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Scan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scans/{scan_id}/claim":{"post":{"operationId":"claimAnonymousScan","tags":["scans"],"summary":"Attach an anonymous scan to a verified account","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["grant"],"properties":{"grant":{"type":"string"}}}}}},"security":[{"accountToken":[]}],"responses":{"200":{"description":"Claimed scan summary","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Grant invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SCAN_ALREADY_CLAIMED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scans/{scan_id}/exports/{format}":{"get":{"operationId":"exportReadinessReport","tags":["scans"],"summary":"Export the latest or selected historical report as HTML or PDF","description":"Selecting an immutable historical report requires the verified owning account; a scan grant alone is not sufficient.","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"path","required":true,"schema":{"enum":["html","pdf"]}},{"name":"grant","in":"query","required":false,"schema":{"type":"string"},"description":"Anonymous scan access grant returned by startReadinessScan."},{"name":"locale","in":"query","required":false,"schema":{"enum":["en","es","ru"]}},{"name":"attempt_id","in":"query","required":false,"schema":{"type":"string"},"description":"Immutable historical attempt selector. Requires the verified owning account; omitted uses the latest attempt and may use a scan grant."}],"security":[{"scanGrant":[]},{"accountToken":[]}],"responses":{"200":{"description":"Localized HTML or PDF attachment"},"415":{"description":"FORMAT_NOT_SUPPORTED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/findings/{finding_id}/fix-recipe":{"get":{"operationId":"getFixRecipe","tags":["scans"],"summary":"Deterministic fix recipe for a finding","parameters":[{"name":"finding_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"grant","in":"query","required":false,"schema":{"type":"string"},"description":"Anonymous scan access grant returned by startReadinessScan."}],"security":[{"scanGrant":[]},{"accountToken":[]}],"responses":{"200":{"description":"Fix recipe","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Finding not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/request-link":{"post":{"operationId":"requestMagicLink","tags":["account"],"summary":"Request a Supabase Auth passwordless sign-in link (synthetic local mode only outside hosted identity)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","maxLength":254},"locale":{"type":"string","enum":["en","es","ru"],"default":"en"}}}}}},"responses":{"200":{"description":"Delivery message; verification_url is empty on hosted deployments","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"INVALID_EMAIL or INVALID_LOCALE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"AUTH_RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/verify":{"post":{"operationId":"verifyMagicLink","tags":["account"],"summary":"Confirm and exchange a one-time sign-in link for an account session","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"recovery_key":{"type":"string","minLength":43,"maxLength":43,"pattern":"^[A-Za-z0-9_-]{43}$","description":"Optional client-generated key for recovering the same already-persisted session after a lost response."}}}}}},"responses":{"200":{"description":"Account token","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"INVALID_REQUEST: recovery_key must be 43 base64url characters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"AUTH_TOKEN_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"verifyMagicLinkLocal","deprecated":true,"tags":["account"],"summary":"Local-mode compatibility only; hosted deployments require POST","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Local account token","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"AUTH_TOKEN_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"POST required on hosted deployments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/google/start":{"post":{"operationId":"startGoogleSignIn","tags":["account"],"summary":"Start Google OAuth with a caller-generated PKCE challenge","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleSignInStartRequest"}}}},"responses":{"200":{"description":"Fixed Supabase authorization URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleSignInStartResponse"}}}},"400":{"description":"INVALID_REQUEST or INVALID_LOCALE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"AUTH_PROVIDER_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/google/verify":{"post":{"operationId":"verifyGoogleSignIn","tags":["account"],"summary":"Exchange a Google OAuth authorization code for an application account session","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleSignInVerifyRequest"}}}},"responses":{"200":{"description":"Application account session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountSession"}}}},"400":{"description":"INVALID_REQUEST: recovery_key must be 43 base64url characters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"AUTH_TOKEN_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"AUTH_PROVIDER_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/history":{"get":{"operationId":"listAccountHistory","tags":["account"],"summary":"List owned scalar scan history grouped by site","security":[{"accountToken":[]}],"responses":{"200":{"description":"Owned history without canonical report bodies or evidence","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountHistory"}}}},"401":{"description":"AUTH_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}}}}},"/v1/account/notification-preferences":{"get":{"operationId":"getNotificationPreferences","tags":["account"],"summary":"Read automatic checking and independent email preferences","security":[{"accountToken":[]}],"responses":{"200":{"description":"Notification preferences","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}}},"400":{"description":"Invalid preferences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}},"401":{"description":"AUTH_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}}}},"post":{"operationId":"setNotificationPreferences","tags":["account"],"summary":"Set notification preferences without renewing account activity","security":[{"accountToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}}},"responses":{"200":{"description":"Notification preferences","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}}},"400":{"description":"Invalid preferences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}},"401":{"description":"AUTH_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}}}}},"/v1/account/notifications":{"get":{"operationId":"listResultNotifications","tags":["account"],"summary":"List the owner's automatic-update result and progress notices","security":[{"accountToken":[]}],"responses":{"200":{"description":"Owner-only notices","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/AutomaticUpdateNotice"}}}}}}},"401":{"description":"AUTH_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}}}}},"/v1/notifications/unsubscribe":{"post":{"operationId":"unsubscribeResultEmails","tags":["account"],"summary":"Disable email only with a signed result-email token; never a GET mutation","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token"],"properties":{"token":{"type":"string","minLength":45,"maxLength":215,"pattern":"^[A-Za-z0-9_-]{1,171}\\.[A-Za-z0-9_-]{43}$"}}}}}},"responses":{"200":{"description":"Email disabled","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","required":["unsubscribed"],"properties":{"unsubscribed":{"const":true}}}}}},"400":{"description":"Invalid unsubscribe token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}},"503":{"description":"Notification service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}}}}},"/v1/account/check-updates":{"get":{"operationId":"listCheckUpdates","tags":["account"],"summary":"List current readiness checks missing from owned reports","security":[{"accountToken":[]}],"responses":{"200":{"description":"Owned check-version update projection","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckUpdates"}}}},"401":{"description":"AUTH_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}}}}},"/v1/sites":{"get":{"operationId":"listSites","tags":["sites"],"summary":"List sites owned by the account","security":[{"accountToken":[]}],"responses":{"200":{"description":"Owned sites with latest attempt summaries","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"TOKEN_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sites/{site_id}/shared-history":{"get":{"operationId":"listSharedSiteScanHistory","tags":["sites"],"summary":"List author-free summaries of retained checks of the site's start page","description":"Only checks of the start page of the exact origin, not of other paths. Newest first, 100 entries per page. Does not grant report, comparison or mutation access. Deleted records are excluded; refresh after an invalid cursor.","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":128}}],"security":[{"accountToken":[]}],"responses":{"200":{"description":"Shared timeline page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedSiteHistoryPage"}}}},"400":{"description":"Invalid cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sites/{site_id}/history":{"get":{"operationId":"listSiteScanHistory","tags":["sites"],"summary":"List immutable revisions for an owned site","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"accountToken":[]}],"responses":{"200":{"description":"Attempt summaries","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Not owned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Site not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sites/{site_id}/comparison":{"get":{"operationId":"compareReadinessScans","tags":["sites"],"summary":"Full outer join comparison of two revisions","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"base_attempt_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"head_attempt_id","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"accountToken":[]}],"responses":{"200":{"description":"Comparison object","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Not owned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not enough revisions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"COMPARISON_REQUIRES_SAME_PAGE: the reports evaluate different pages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sites/{site_id}/comparison.html":{"get":{"operationId":"exportReadinessComparisonHtml","tags":["sites"],"summary":"Localized comparison HTML export","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"base_attempt_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"head_attempt_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"locale","in":"query","required":false,"schema":{"enum":["en","es","ru"]}}],"security":[{"accountToken":[]}],"responses":{"200":{"description":"HTML attachment"},"422":{"description":"COMPARISON_REQUIRES_SAME_PAGE: the reports evaluate different pages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sites/{site_id}/comparison.pdf":{"get":{"operationId":"exportReadinessComparisonPdf","tags":["sites"],"summary":"Localized comparison PDF export","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"base_attempt_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"head_attempt_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"locale","in":"query","required":false,"schema":{"enum":["en","es","ru"]}}],"security":[{"accountToken":[]}],"responses":{"200":{"description":"PDF attachment"},"422":{"description":"COMPARISON_REQUIRES_SAME_PAGE: the reports evaluate different pages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/export":{"get":{"operationId":"exportAccountData","tags":["account"],"summary":"Export all data belonging to the account","security":[{"accountToken":[]}],"responses":{"200":{"description":"Account data export","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"TOKEN_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"delete":{"operationId":"requestAccountDeletion","tags":["account"],"summary":"Delete account data after explicit confirmation","parameters":[{"name":"confirm","in":"query","required":false,"schema":{"type":"string","enum":["true"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean","enum":[true]}}}}}},"security":[{"accountToken":[]}],"responses":{"200":{"description":"Deletion summary","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Confirmation missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"TOKEN_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"operationId":"mcp","tags":["scans"],"summary":"Stateless JSON-RPC 2.0 MCP endpoint (tools/list, tools/call, resources/*)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"JSON-RPC response","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"securitySchemes":{"scanGrant":{"type":"apiKey","in":"query","name":"grant","description":"Anonymous scan grant (also accepted as x-scan-grant header)."},"accountToken":{"type":"http","scheme":"bearer","description":"Account token returned by /v1/auth/verify."}},"schemas":{"GoogleSignInStartRequest":{"type":"object","additionalProperties":false,"required":["code_challenge"],"properties":{"code_challenge":{"type":"string","minLength":43,"maxLength":43,"pattern":"^[A-Za-z0-9_-]{43}$"},"locale":{"type":"string","enum":["en","es","ru"],"default":"en"}}},"GoogleSignInStartResponse":{"type":"object","additionalProperties":false,"required":["authorization_url"],"properties":{"authorization_url":{"type":"string","format":"uri"}}},"GoogleSignInVerifyRequest":{"type":"object","additionalProperties":false,"required":["code","code_verifier"],"properties":{"code":{"type":"string","minLength":16,"maxLength":256,"pattern":"^[A-Za-z0-9_/-]{16,256}$"},"code_verifier":{"type":"string","minLength":43,"maxLength":43,"pattern":"^[A-Za-z0-9_-]{43}$"},"recovery_key":{"type":"string","minLength":43,"maxLength":43,"pattern":"^[A-Za-z0-9_-]{43}$"}}},"AccountSession":{"type":"object","additionalProperties":false,"required":["account_token","account_id","email"],"properties":{"account_token":{"type":"string"},"account_id":{"type":"string"},"email":{"type":"string","format":"email"}}},"AccountHistory":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AccountHistorySite"}}}},"AccountHistorySite":{"type":"object","additionalProperties":false,"required":["site_id","normalized_origin","revisions"],"properties":{"site_id":{"type":"string"},"normalized_origin":{"type":"string","format":"uri"},"revisions":{"type":"array","items":{"$ref":"#/components/schemas/AccountHistoryRevision"}}}},"AccountHistoryRevision":{"type":"object","additionalProperties":false,"required":["attempt_id","scan_id","revision","status","report_hash","created_at","finished_at"],"properties":{"attempt_id":{"type":"string"},"scan_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"status":{"type":"string"},"report_hash":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}},"NotificationPreferences":{"type":"object","additionalProperties":false,"required":["automatic_updates","email_results","locale"],"properties":{"automatic_updates":{"type":"boolean"},"email_results":{"type":"boolean"},"locale":{"type":"string","enum":["en","es","ru"]}}},"AutomaticUpdateNotice":{"type":"object","additionalProperties":false,"required":["update_id","scan_id","attempt_id","base_attempt_id","site_id","normalized_origin","created_at","finished_at","status","checks","results","limitations"],"properties":{"update_id":{"type":"string"},"scan_id":{"type":"string"},"attempt_id":{"type":"string"},"base_attempt_id":{"type":"string"},"site_id":{"type":"string"},"normalized_origin":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["queued","running","completed","partial","failed","cancelled"]},"checks":{"type":"array","minItems":1,"maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["check_id","title_key"],"properties":{"check_id":{"type":"string"},"title_key":{"type":"string"}}}},"results":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["title_key","status","explanation_key","remediation_key"],"properties":{"title_key":{"type":"string"},"explanation_key":{"type":["string","null"]},"remediation_key":{"type":["string","null"]},"status":{"type":"string","enum":["pass","fail","warning","unknown","not_applicable","unsupported"]}}}},"limitations":{"type":"array","maxItems":128,"items":{"type":"string"}}}},"CheckUpdates":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CheckUpdateSite"}}}},"CheckUpdateSite":{"type":"object","additionalProperties":false,"required":["site_id","normalized_origin","scan_id","last_checked_at","checks"],"properties":{"site_id":{"type":"string"},"normalized_origin":{"type":"string","format":"uri"},"scan_id":{"type":"string"},"last_checked_at":{"type":"string","format":"date-time"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/CheckUpdate"}}}},"CheckUpdate":{"type":"object","additionalProperties":false,"required":["check_id","title_key","check_version","kind"],"properties":{"check_id":{"type":"string"},"title_key":{"type":"string"},"check_version":{"type":"string"},"kind":{"type":"string","enum":["new","updated"]}}},"SharedSiteHistoryPage":{"type":"object","additionalProperties":false,"required":["items","next_cursor"],"properties":{"items":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/SharedSiteHistoryEntry"}},"next_cursor":{"type":["string","null"]}}},"SharedSiteHistoryEntry":{"type":"object","additionalProperties":false,"required":["attempt_id","status","created_at","finished_at","methodology_version","registry_version","readiness","coverage"],"properties":{"attempt_id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"methodology_version":{"type":"string"},"registry_version":{"type":"string"},"readiness":{"type":["number","null"]},"coverage":{"type":["number","null"]}}},"IndustrySnapshot":{"type":"object","required":["index_type","snapshot_id","edition","generated_at","as_of","max_age_days","source","aggregation_version","classification_version","versions","min_sites","industries","metrics","withheld"],"properties":{"index_type":{"const":"industry_index"},"snapshot_id":{"type":"string"},"edition":{"type":"string"},"generated_at":{"type":"string","format":"date-time"},"as_of":{"type":"string","format":"date-time"},"max_age_days":{"type":"integer","minimum":0},"source":{"type":"string"},"vantage":{"type":["string","null"]},"aggregation_version":{"type":"string"},"classification_version":{"type":"string"},"versions":{"type":"object","required":["registry","methodology"],"properties":{"registry":{"type":"string"},"methodology":{"type":"string"}}},"min_sites":{"type":"integer","minimum":5},"empty":{"type":"boolean"},"industries":{"type":"array","items":{"$ref":"#/components/schemas/IndustryGroup"}},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/IndustryMetric"}},"withheld":{"type":"array","items":{"type":"object","required":["industry","title","sites","reason"],"properties":{"industry":{"type":"string"},"title":{"type":"string"},"sites":{"type":"integer","minimum":0},"reason":{"const":"minimum_sites"}}}}}},"IndustryGroup":{"type":"object","required":["industry","title","sites","reports","answers","readiness","checks","adoption","metrics"],"properties":{"industry":{"type":"string"},"title":{"type":"string"},"sites":{"type":"integer","minimum":0},"reports":{"type":"object","properties":{"completed":{"type":"integer","minimum":0},"partial":{"type":"integer","minimum":0},"missing":{"type":"integer","minimum":0}}},"scanned":{"type":"object","properties":{"completed":{"type":"integer","minimum":0},"partial":{"type":"integer","minimum":0}}},"unscanned":{"type":"integer","minimum":0},"answers":{"type":"object","properties":{"blocked":{"type":"integer","minimum":0},"unreadable":{"type":"integer","minimum":0},"unverified":{"type":"integer","minimum":0},"readable_with_gaps":{"type":"integer","minimum":0},"readable":{"type":"integer","minimum":0}}},"readiness":{"type":"object","properties":{"count":{"type":["number","null"]},"median":{"type":["number","null"]},"p90":{"type":["number","null"]},"suppressed":{"type":"boolean"}}},"checks":{"type":"array","items":{"$ref":"#/components/schemas/IndustryCheck"}},"adoption":{"type":"array","items":{"$ref":"#/components/schemas/IndustryAdoption"}},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/IndustryMetric"}}}},"IndustryMetric":{"type":"object","required":["metric_id","key","definition_version","type","unit","population","known","unknown","count","median","p90","suppressed","true_count","false_count","categories"],"properties":{"metric_id":{"type":"string"},"key":{"type":"string"},"definition_version":{"type":"string"},"type":{"type":"string","enum":["numeric","boolean","category"]},"unit":{"type":["string","null"]},"industry":{"type":"string"},"count":{"type":["number","null"]},"median":{"type":["number","null"]},"p90":{"type":["number","null"]},"suppressed":{"type":"boolean"},"population":{"type":["number","null"]},"known":{"type":["number","null"]},"unknown":{"type":["number","null"]},"true_count":{"type":["number","null"]},"false_count":{"type":["number","null"]},"categories":{"type":["object","null"],"additionalProperties":{"type":"integer","minimum":0}}}},"IndustryCheck":{"type":"object","properties":{"check_id":{"type":"string"},"title":{"type":"string"},"tier":{"type":"string"},"capability":{"type":"string"},"applicable":{"type":"integer","minimum":0},"verdicts":{"type":"integer","minimum":0},"pass":{"type":"integer","minimum":0},"warning":{"type":"integer","minimum":0},"fail":{"type":"integer","minimum":0},"unknown":{"type":"integer","minimum":0},"not_applicable":{"type":"integer","minimum":0},"unsupported":{"type":"integer","minimum":0},"fail_share":{"type":["number","null"]}}},"IndustryAdoption":{"type":"object","properties":{"check_id":{"type":"string"},"title":{"type":"string"},"tier":{"type":"string"},"declared":{"type":"integer","minimum":0},"not_adopted":{"type":"integer","minimum":0},"not_applicable":{"type":"integer","minimum":0},"unknown":{"type":"integer","minimum":0}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"phase":{"type":"string"},"correlation_id":{"type":"string"}}}}}}}}