{"openapi":"3.1.0","info":{"title":"Monita API","version":"1.0.0","description":"Programmatic access to Monita: alerts, issues, integrations and usage. Authenticate with a Clerk API key (`Authorization: Bearer ak_...`) created from your profile, or a session token from the dashboard."},"servers":[{"url":"https://api.monita.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Clerk API key (ak_...) or session JWT"}},"schemas":{"Alert":{"allOf":[{"$ref":"#/components/schemas/AlertInput"},{"type":"object","properties":{"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"},"maxItems":10},"id":{"type":"string"},"orgId":{"type":"string"},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","orgId","createdAt","updatedAt"]}]},"Condition":{"type":"object","properties":{"parameter":{"type":"string","minLength":1,"maxLength":200},"op":{"$ref":"#/components/schemas/Operator"},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100}},"required":["parameter","op"]},"Operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with","ends_with","not_starts_with","not_ends_with","is_blank","not_blank","length_eq","length_gt","length_lt","gt","lt","regex","contains_email","contains_phone","custom_pii_regex"]},"JourneySpec":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","enum":[2]},"steps":{"type":"array","items":{"type":"object","properties":{"anchor":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["session"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["page"]},"path":{"type":"string","minLength":1,"maxLength":500},"op":{"type":"string","enum":["equals","contains","starts_with"]}},"required":["kind","path"]},{"type":"object","properties":{"kind":{"type":"string","enum":["label"]},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["kind","label"]},{"type":"object","properties":{"kind":{"type":"string","enum":["event"]},"vendor":{"type":"string","maxLength":200},"event":{"type":"string","maxLength":200}},"required":["kind"]}]},"expect":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":80},"vendor":{"type":"string","maxLength":200},"event":{"type":"string","maxLength":200},"ordered":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Condition"},"maxItems":20}}},"maxItems":20}},"required":["anchor","expect"]},"minItems":1,"maxItems":10}},"required":["version","steps"]},{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","maxLength":200},"event":{"type":"string","maxLength":200}}},"minItems":1,"maxItems":10}},"required":["steps"]}]},"Channel":{"type":"object","properties":{"type":{"type":"string","enum":["email","slack","teams","webhook","jira"]},"target":{"type":"string","minLength":1,"maxLength":2000}},"required":["type","target"]},"AlertInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domainId":{"type":"string"},"domainIds":{"type":"array","items":{"type":"string"},"maxItems":100},"alertType":{"type":"string","enum":["data_validation","tag_volume_change","volume_threshold","volume_anomaly","journey"]},"severity":{"type":"string","enum":["low","medium","high","critical"],"default":"low"},"vendors":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":100},"conditions":{"type":"object","properties":{"logic":{"type":"string","enum":["any","all"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/Condition"},"maxItems":50}},"required":["logic","items"]},"filters":{"type":"array","items":{"$ref":"#/components/schemas/Condition"},"maxItems":50},"conditionGroups":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["all","any"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/Condition"},"maxItems":50}},"required":["op","items"]},"maxItems":20},"period":{"type":"string","minLength":1,"maxLength":20},"timezone":{"type":"string","maxLength":50,"default":"UTC"},"runWindows":{"type":"object","properties":{"hours":{"type":"array","items":{"type":"integer","minimum":0,"maximum":23},"minItems":2,"maxItems":2},"days":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7}}},"journey":{"$ref":"#/components/schemas/JourneySpec"},"volume":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["increase","decrease"]},"percent":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":10000},"event":{"type":"string","maxLength":200}},"required":["direction","percent"]},{"type":"object","properties":{"op":{"type":"string","enum":["lte","gte"]},"count":{"type":"integer","minimum":0,"maximum":100000000},"event":{"type":"string","maxLength":200}},"required":["op","count"]},{"type":"object","properties":{"vendor":{"type":"string","minLength":1,"maxLength":200},"event":{"type":"string","maxLength":200},"sensitivity":{"type":"number","minimum":2,"maximum":8}},"required":["vendor"]}]},"throttle":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":1000},"per":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":10080},"unit":{"type":"string","enum":["minutes","hours"]}},"required":["count","per","unit"]},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"},"minItems":1,"maxItems":10},"impactValue":{"type":"integer","minimum":0},"enabled":{"type":"boolean","default":true}},"required":["name","alertType","period","channels"]},"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"AlertPreview":{"type":"object","properties":{"scanned":{"type":"number"},"matched":{"type":"number"},"windowHours":{"type":"number"},"samples":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["scanned","matched","windowHours","samples"]},"AlertPreviewInput":{"type":"object","properties":{"rule":{"$ref":"#/components/schemas/AlertInput"},"hours":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":168,"default":24}},"required":["rule"]},"AlertBacktest":{"type":"object","properties":{"grain":{"type":"string","enum":["hour","day"]},"method":{"type":"string","enum":["sql","rollup","sampled"]},"coverage":{"type":"object","nullable":true,"properties":{"sampled":{"type":"number"},"total":{"type":"number"}},"required":["sampled","total"]},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"matchCount":{"type":"number"},"wouldFire":{"type":"boolean"}},"required":["start","matchCount","wouldFire"]}}},"required":["grain","method","coverage","buckets"]},"AlertBacktestInput":{"type":"object","properties":{"rule":{"$ref":"#/components/schemas/AlertInput"},"days":{"anyOf":[{"type":"number","enum":[7]},{"type":"number","enum":[14]},{"type":"number","enum":[30]}],"default":14}},"required":["rule"]},"AlertBulkResult":{"type":"object","properties":{"created":{"type":"number"},"failed":{"type":"number"},"errors":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"error":{"type":"string"}},"required":["index","error"]}}},"required":["created","failed","errors"]},"AlertBulkInput":{"type":"object","properties":{"alerts":{"type":"array","items":{"$ref":"#/components/schemas/AlertInput"},"minItems":1,"maxItems":500}},"required":["alerts"]},"AlertEnabledInput":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"Issue":{"type":"object","properties":{"id":{"type":"string"},"alertId":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","muted"]},"severity":{"type":"string"},"title":{"type":"string"},"alertType":{"type":"string"},"occurrences":{"type":"number"},"capReached":{"type":"boolean"},"notificationsSent":{"type":"number"},"impactValue":{"type":"number","nullable":true},"notes":{"type":"string","nullable":true},"jiraKey":{"type":"string","nullable":true},"firstSeenAt":{"type":"number"},"lastSeenAt":{"type":"number"},"hosts":{"type":"array","nullable":true,"items":{"type":"string"},"default":null}},"required":["id","alertId","status","severity","title","alertType","occurrences","capReached","notificationsSent","impactValue","notes","jiraKey","firstSeenAt","lastSeenAt"]},"IssueDetail":{"allOf":[{"$ref":"#/components/schemas/Issue"},{"type":"object","properties":{"domainId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"occurrenceSeries":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"number"}},"required":["day","count"]}},"history":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"payload":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdAt":{"type":"number"}},"required":["kind","payload","createdAt"]}}},"required":["domainId","domain","occurrenceSeries","history"]}]},"IssueBulkInput":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":500},"status":{"type":"string","enum":["open","acknowledged","resolved"]}},"required":["ids","status"]},"IssuePatch":{"type":"object","properties":{"status":{"type":"string","enum":["open","acknowledged","resolved","muted"]},"notes":{"type":"string","maxLength":2000}}},"Integration":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"label":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"number"}},"required":["id","provider","label","status","createdAt"]},"IntegrationInput":{"type":"object","properties":{"provider":{"type":"string","enum":["gtm","slack","teams","jira","webhook","email_digest"]},"label":{"type":"string","minLength":1,"maxLength":100,"default":"default"},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["provider","config"]},"Domain":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"token":{"type":"string"},"system":{"type":"string"},"status":{"type":"string"},"monitoredUrls":{"type":"array","items":{"type":"string"}},"vendorCount":{"type":"number"},"createdAt":{"type":"number"},"projectId":{"type":"string","nullable":true},"collect":{"type":"object","nullable":true,"properties":{"hostname":{"type":"string"},"status":{"type":"string"}},"required":["hostname","status"]},"routing":{"type":"object","properties":{"mode":{"type":"string","enum":["legacy","custom","default"]},"collectEndpoint":{"type":"string"},"cdnHost":{"type":"string"}},"required":["mode","collectEndpoint","cdnHost"]},"legacyScript":{"type":"boolean"},"events24h":{"type":"number","default":0},"lastEventAt":{"type":"number","nullable":true,"default":null},"prodVersion":{"type":"number","nullable":true,"default":null}},"required":["id","orgId","name","token","system","status","monitoredUrls","vendorCount","createdAt","projectId","collect","routing","legacyScript"]},"DomainInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"system":{"type":"string","enum":["global","tealium","adobe","tag_commander","google_tag_manager_global","google_tag_manager","ios","android","server"],"default":"global"},"monitoredUrls":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":50,"default":[]},"vendors":{"type":"array","items":{"$ref":"#/components/schemas/DomainVendorConfig"},"maxItems":200,"default":[]},"allowManualMonitoring":{"type":"boolean","default":false},"screenshotBase64":{"type":"string"}},"required":["name"]},"DomainVendorConfig":{"type":"object","properties":{"vendorName":{"type":"string","minLength":1,"maxLength":200},"urlPatternMatches":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":200},"excludeParameters":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":500,"default":[]},"eventParameter":{"type":"string","maxLength":200},"filters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"op":{"type":"string","enum":["eq","ne","contains","blank","not_blank","exist","not_exist"]},"val":{"type":"array","items":{"type":"string"}}},"required":["key","op"]},"maxItems":100,"default":[]},"filtersJoinOperator":{"type":"string","enum":["AND","OR"],"default":"AND"},"filterGroups":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["all","any"],"default":"all"},"filters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"op":{"type":"string","enum":["eq","ne","contains","blank","not_blank","exist","not_exist"]},"val":{"type":"array","items":{"type":"string"}}},"required":["key","op"]},"maxItems":100}},"required":["filters"]},"maxItems":20},"enabled":{"type":"boolean","default":true}},"required":["vendorName","urlPatternMatches"]},"DomainImport":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"system":{"type":"string","minLength":1,"maxLength":50},"token":{"type":"string","minLength":20,"maxLength":64},"monitoredUrls":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":50,"default":[]},"wireConfig":{"type":"object","properties":{"monitoringVersion":{"type":"string"},"vendors":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"allowManualMonitoring":{"type":"boolean"}},"required":["monitoringVersion","vendors"],"additionalProperties":{"nullable":true}}},"required":["name","system","token","wireConfig"]},"SignalMigrations":{"type":"object","properties":{"migrations":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"samples":{"type":"number"}},"required":["from","to","samples"]}}},"required":["migrations"]},"DomainDetail":{"allOf":[{"$ref":"#/components/schemas/Domain"},{"type":"object","properties":{"prodVersion":{"type":"number","nullable":true},"sourceClass":{"type":"string","enum":["web","app","gtm","server"]},"configs":{"type":"object","properties":{"dev":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"prod":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["dev","prod"]},"devVersion":{"type":"number","nullable":true}},"required":["prodVersion","sourceClass","configs","devVersion"]}]},"MonitoringUpdate":{"type":"object","properties":{"vendors":{"type":"array","items":{"$ref":"#/components/schemas/DomainVendorConfig"},"maxItems":200},"allowManualMonitoring":{"type":"boolean","default":false}},"required":["vendors"]},"DomainEnvironment":{"type":"object","properties":{"detected":{"type":"object","nullable":true,"properties":{"tms":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"cms":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"build":{"type":"string","nullable":true},"observedAt":{"type":"number"}},"required":["tms","cms","build","observedAt"]},"primaryTms":{"type":"string","nullable":true}},"required":["detected","primaryTms"]},"DomainEnvironmentInput":{"type":"object","properties":{"primaryTms":{"type":"string","nullable":true,"maxLength":50}},"required":["primaryTms"]},"DomainRename":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"]},"DomainVersions":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"number"},"active":{"type":"boolean"},"createdAt":{"type":"number"},"vendorCount":{"type":"number"},"rollbackOf":{"type":"number","nullable":true}},"required":["version","active","createdAt","vendorCount","rollbackOf"]}}},"required":["versions"]},"DomainEndpoint":{"type":"object","properties":{"mode":{"type":"string"},"collectEndpoint":{"type":"string"},"cdnHost":{"type":"string"}},"required":["mode","collectEndpoint","cdnHost"]},"PropertyHostname":{"type":"object","properties":{"hostname":{"type":"string"},"status":{"type":"string","enum":["unreviewed","approved","denied"]},"firstSeenAt":{"type":"number"},"lastSeenAt":{"type":"number"},"events7d":{"type":"number"},"decidedAt":{"type":"number","nullable":true}},"required":["hostname","status","firstSeenAt","lastSeenAt","events7d","decidedAt"]},"EventParams":{"type":"object","properties":{"envelope":{"type":"array","items":{"type":"string"}},"payload":{"type":"array","items":{"type":"string"}},"sampledEvents":{"type":"number"}},"required":["envelope","payload","sampledEvents"]},"DataDictionary":{"type":"object","properties":{"sampledEvents":{"type":"number"},"windowHours":{"type":"number"},"vendors":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"events":{"type":"number"},"keys":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"presencePct":{"type":"number"},"examples":{"type":"array","items":{"type":"string"}},"cardinality":{"type":"number"},"lastSeen":{"type":"number","nullable":true}},"required":["key","presencePct","examples","cardinality","lastSeen"]}}},"required":["vendor","events","keys"]}}},"required":["sampledEvents","windowHours","vendors"]},"DataDictionaryFlat":{"type":"object","properties":{"sampledEvents":{"type":"number"},"windowHours":{"type":"number"},"truncated":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"vendor":{"type":"string"},"event":{"type":"string"},"key":{"type":"string"},"count":{"type":"number"},"values":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]}},"lastSeen":{"type":"number","nullable":true}},"required":["domain","vendor","event","key","count","values","lastSeen"]}}},"required":["sampledEvents","windowHours","truncated","rows"]},"StatsOverview":{"type":"object","properties":{"events24h":{"type":"number"},"eventsPrev24h":{"type":"number"},"events7d":{"type":"number"},"byDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"number"}},"required":["day","count"]}},"byHour":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"number"},"count":{"type":"number"}},"required":["hour","count"]}},"byDomainSeries":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"series":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"number"},"count":{"type":"number"}},"required":["hour","count"]}}},"required":["domain","series"]}},"windowHours":{"type":"number"},"byVendor":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"count":{"type":"number"}},"required":["vendor","count"]}},"byDomain":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"count":{"type":"number"}},"required":["domain","count"]}},"openIssues":{"type":"number"},"valueProtected":{"type":"number"},"activeDomains":{"type":"number"},"sessions24h":{"type":"number","nullable":true},"visitors24h":{"type":"number","nullable":true}},"required":["events24h","eventsPrev24h","events7d","byDay","byVendor","byDomain","openIssues","valueProtected","activeDomains"]},"StatsUptime":{"type":"object","properties":{"hours":{"type":"array","items":{"type":"number"}},"vendors":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"counts":{"type":"array","items":{"type":"number"}}},"required":["vendor","counts"]}}},"required":["hours","vendors"]},"StatsPerformance":{"type":"object","properties":{"windowHours":{"type":"number"},"vendors":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"events":{"type":"number"},"avgExecMs":{"type":"number","nullable":true},"maxExecMs":{"type":"number","nullable":true},"failures":{"type":"number"},"failurePct":{"type":"number"}},"required":["vendor","events","avgExecMs","maxExecMs","failures","failurePct"]}}},"required":["windowHours","vendors"]},"StatsLive":{"type":"object","properties":{"series":{"type":"array","items":{"type":"object","properties":{"minute":{"type":"string"},"events":{"type":"number"},"domains":{"type":"object","additionalProperties":{"type":"number"}}},"required":["minute","events"]}},"byDomain":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"events":{"type":"number"}},"required":["domain","events"]}},"last5m":{"type":"number"}},"required":["series","byDomain","last5m"]},"TagUptimeTree":{"type":"object","properties":{"hours":{"type":"array","items":{"type":"number"}},"domains":{"type":"array","items":{"nullable":true}}},"required":["hours","domains"]},"PiiScan":{"type":"object","properties":{"scanned":{"type":"number"},"windowHours":{"type":"number"},"findings":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"kind":{"type":"string","enum":["email","phone"]},"count":{"type":"number"},"samples":{"type":"array","items":{"type":"string"}},"keys":{"type":"array","items":{"type":"string"},"default":[]},"urls":{"type":"array","items":{"type":"string"}}},"required":["vendor","kind","count","samples","urls"]}}},"required":["scanned","windowHours","findings"]},"VendorPolicies":{"type":"object","properties":{"vendors":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"events7d":{"type":"number"},"policy":{"type":"string","nullable":true,"enum":["allow","block",null]},"policyScope":{"type":"string","nullable":true,"enum":["org","project","property",null]},"consentExpectation":{"type":"string","nullable":true,"enum":["consent_mode","exempt",null]},"note":{"type":"string","nullable":true},"lastSeenLiveAt":{"type":"number","nullable":true},"lastSeenAuditAt":{"type":"number","nullable":true},"instances":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"lastSeenLiveAt":{"type":"number","nullable":true},"lastSeenAuditAt":{"type":"number","nullable":true}},"required":["accountId","lastSeenLiveAt","lastSeenAuditAt"]}}},"required":["vendor","events7d","policy","policyScope","note","lastSeenLiveAt","lastSeenAuditAt","instances"]}}},"required":["vendors"]},"VendorPolicyInput":{"type":"object","properties":{"policy":{"type":"string","nullable":true,"enum":["allow","block",null]},"note":{"type":"string","maxLength":500},"consentExpectation":{"type":"string","enum":["required","consent_mode","exempt"]},"projectId":{"type":"string"},"domainId":{"type":"string"}},"required":["policy"]},"ObservedCookies":{"type":"object","properties":{"sampled":{"type":"number"},"cookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"owner":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"sessions":{"type":"number"}},"required":["name","owner","domains","sessions"]}}},"required":["sampled","cookies"]},"PiiDeepScan":{"type":"object","properties":{"scanned":{"type":"number"},"findings":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"key":{"type":"string"},"kind":{"type":"string"},"confidence":{"type":"number"},"note":{"type":"string"}},"required":["vendor","key","kind","confidence","note"]}}},"required":["scanned","findings"]},"ConsentConfig":{"type":"object","properties":{"configs":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"mode":{"type":"string","enum":["auto","manual"]},"rules":{"type":"array","items":{"type":"object","properties":{"match":{"type":"string","enum":["equals","prefix","contains","regex"]},"pattern":{"type":"string","minLength":1,"maxLength":200},"verdict":{"type":"string","enum":["yes","no"]},"label":{"type":"string","maxLength":100},"categories":{"type":"array","items":{"type":"string","enum":["ads","social","analytics","session_replay","chat","other"]},"maxItems":6}},"required":["match","pattern","verdict"]}},"note":{"type":"string","nullable":true},"updatedBy":{"type":"string","nullable":true},"updatedAt":{"type":"number","nullable":true}},"required":["domainId","mode","rules","note","updatedBy","updatedAt"]}},"properties":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"domain":{"type":"string"},"detectedCmp":{"type":"string","nullable":true},"cmpExpected":{"type":"boolean"}},"required":["domainId","domain","detectedCmp","cmpExpected"]}}},"required":["configs","properties"]},"ConsentSamples":{"type":"object","properties":{"windowHours":{"type":"number"},"totalEvents":{"type":"number"},"values":{"type":"array","items":{"type":"object","properties":{"cn":{"type":"string"},"events":{"type":"number"},"verdict":{"type":"string","enum":["yes","no","unknown"]},"source":{"type":"string","enum":["manual","builtin","none"]},"shape":{"type":"string"}},"required":["cn","events","verdict","source","shape"]}}},"required":["windowHours","totalEvents","values"]},"TagPerformance":{"type":"object","properties":{"windowHours":{"type":"number"},"pagesSampled":{"type":"number"},"loafCoverage":{"type":"number"},"vendors":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"hosts":{"type":"array","items":{"type":"string"}},"pages":{"type":"number"},"reqPerPage":{"type":"number"},"p50DurMs":{"type":"number"},"p75DurMs":{"type":"number"},"maxMs":{"type":"number"},"p75BlockMs":{"type":"number"},"blockShare":{"type":"number"},"kbPerPage":{"type":"number"}},"required":["vendor","hosts","pages","reqPerPage","p50DurMs","p75DurMs","maxMs","p75BlockMs","blockShare","kbPerPage"]}}},"required":["windowHours","pagesSampled","loafCoverage","vendors"]},"NotificationSettings":{"type":"object","properties":{"email":{"type":"string"},"volume":{"type":"boolean"},"data":{"type":"boolean"},"compliance":{"type":"boolean"},"audits":{"type":"boolean"},"digest":{"type":"object","properties":{"subscribed":{"type":"boolean"},"context":{"type":"string"},"cadence":{"type":"string","nullable":true},"hourUtc":{"type":"number","nullable":true}},"required":["subscribed","context","cadence","hourUtc"]}},"required":["email","volume","data","compliance","audits","digest"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"createdAt":{"type":"number"},"expiration":{"type":"number","nullable":true},"lastUsedAt":{"type":"number","nullable":true}},"required":["id","name","createdAt","expiration","lastUsedAt"]},"ComplianceGeo":{"type":"object","properties":{"available":{"type":"boolean"},"windowHours":{"type":"number"},"totalEvents":{"type":"number"},"countries":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"events":{"type":"number"},"consentYes":{"type":"number"},"consentNo":{"type":"number"},"consentUnknown":{"type":"number"}},"required":["country","events","consentYes","consentNo","consentUnknown"]}},"states":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"events":{"type":"number"},"consentYes":{"type":"number"},"consentNo":{"type":"number"},"consentUnknown":{"type":"number"}},"required":["state","events","consentYes","consentNo","consentUnknown"]}},"cities":{"type":"array","items":{"type":"object","properties":{"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"},"events":{"type":"number"}},"required":["city","state","country","events"]}},"domains":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"domain":{"type":"string"},"events":{"type":"number"},"consentNo":{"type":"number"}},"required":["domainId","domain","events","consentNo"]}}},"required":["available","windowHours","totalEvents","countries","states","cities","domains"]},"ConsentVendors":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"events":{"type":"number"},"consentYes":{"type":"number"},"consentNo":{"type":"number"},"consentUnknown":{"type":"number"},"noConsentData":{"type":"number"},"consentExpectation":{"type":"string","nullable":true,"enum":["consent_mode","exempt",null]}},"required":["vendor","events","consentYes","consentNo","consentUnknown","noConsentData"]}},"sampled":{"type":"number"},"windowDays":{"type":"number"}},"required":["rows","sampled","windowDays"]},"ComplianceStanding":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"domain":{"type":"string"},"standing":{"type":"string","enum":["critical","warning","good"]},"events7d":{"type":"number"},"openIssues":{"type":"object","properties":{"critical":{"type":"number"},"high":{"type":"number"},"medium":{"type":"number"},"low":{"type":"number"}},"required":["critical","high","medium","low"]},"complianceIssues":{"type":"number"},"blockedVendorsActive":{"type":"array","items":{"type":"string"}},"cmpDetected":{"type":"boolean"},"cmpExpected":{"type":"boolean"},"lastAuditAt":{"type":"number","nullable":true}},"required":["domainId","domain","standing","events7d","openIssues","complianceIssues","blockedVendorsActive","cmpDetected","cmpExpected","lastAuditAt"]}}},"required":["domains"]},"ComplianceRegulations":{"type":"object","properties":{"windowHours":{"type":"number"},"geoAvailable":{"type":"boolean"},"regulations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortName":{"type":"string"},"jurisdiction":{"type":"string"},"citation":{"type":"string"},"enforcement":{"type":"string"},"summary":{"type":"string"},"whyItMatters":{"type":"string"},"checks":{"type":"array","items":{"type":"string"}},"posture":{"type":"string","enum":["action","review","ok"]},"ignored":{"type":"boolean"},"signals":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["critical","warning","info"]},"label":{"type":"string"},"evidence":{"type":"string"}},"required":["severity","label","evidence"]}}},"required":["id","name","shortName","jurisdiction","citation","enforcement","summary","whyItMatters","checks","posture","ignored","signals"]}}},"required":["windowHours","geoAvailable","regulations"]},"RegulationSettings":{"type":"object","properties":{"ignored":{"type":"array","items":{"type":"string"}},"available":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"shortName":{"type":"string"},"name":{"type":"string"},"jurisdiction":{"type":"string"}},"required":["id","shortName","name","jurisdiction"]}}},"required":["ignored","available"]},"AuditLog":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actorId":{"type":"string","nullable":true},"actorEmail":{"type":"string","nullable":true},"action":{"type":"string"},"objectType":{"type":"string"},"objectId":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"ip":{"type":"string","nullable":true},"createdAt":{"type":"number"}},"required":["id","actorId","actorEmail","action","objectType","objectId","metadata","ip","createdAt"]}},"nextBefore":{"type":"number","nullable":true}},"required":["entries","nextBefore"]},"OrgSettings":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string","nullable":true},"region":{"type":"string"},"plan":{"type":"string","nullable":true},"billingMode":{"type":"string","nullable":true},"trialEndsAt":{"type":"number","nullable":true},"digest":{"type":"object","nullable":true,"properties":{"recipients":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"context":{"type":"string"}},"required":["email"]}},"hourUtc":{"type":"number"},"cadence":{"type":"string"}},"required":["recipients","hourUtc","cadence"]},"ai":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"required":["id","name","slug","region","plan","billingMode","trialEndsAt","digest","ai"]},"OrgSettingsInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"digest":{"type":"object","nullable":true,"properties":{"recipients":{"type":"array","items":{"anyOf":[{"type":"string","format":"email"},{"type":"object","properties":{"email":{"type":"string","format":"email"},"context":{"type":"string","maxLength":500}},"required":["email"]}]},"maxItems":50},"hourUtc":{"type":"integer","minimum":0,"maximum":23,"default":8},"cadence":{"type":"string","enum":["daily","every2days","weekly"],"default":"daily"}},"required":["recipients"]},"ai":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}},"ValueReport":{"type":"object","properties":{"openValue":{"type":"number"},"resolvedValue30d":{"type":"number"},"resolvedValueTotal":{"type":"number"},"topIssues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"severity":{"type":"string"},"impactValue":{"type":"number"},"occurrences":{"type":"number"}},"required":["id","title","status","severity","impactValue","occurrences"]}}},"required":["openValue","resolvedValue30d","resolvedValueTotal","topIssues"]},"OrgMembers":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","nullable":true},"clerkUserId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"role":{"type":"string"},"joinedAt":{"type":"number","nullable":true}},"required":["userId","clerkUserId","name","email","imageUrl","role","joinedAt"]}}},"required":["members"]},"OrgInvitations":{"type":"object","properties":{"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"createdAt":{"type":"number"}},"required":["id","email","role","createdAt"]}}},"required":["invitations"]},"OrgInviteInput":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["owner","admin","editor","member","viewer","billing_admin"],"default":"member"}},"required":["email"]},"OrgMemberRoleInput":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","editor","member","viewer","billing_admin"]}},"required":["role"]},"AdminOrgs":{"type":"object","properties":{"orgs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"plan":{"type":"string","nullable":true},"billingMode":{"type":"string","nullable":true},"trialEndsAt":{"type":"number","nullable":true},"limits":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"}]}},"billing":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"domains":{"type":"number"},"events24h":{"type":"number"},"openIssues":{"type":"number"}},"required":["id","name","region","plan","billingMode","trialEndsAt","limits","billing","domains","events24h","openIssues"]}}},"required":["orgs"]},"AdminOrgUpdate":{"type":"object","properties":{"plan":{"type":"string","maxLength":50},"billingMode":{"type":"string","enum":["stripe_metered","stripe_invoice","xero","manual"]},"trialEndsAt":{"type":"number","nullable":true},"limits":{"type":"object","nullable":true,"properties":{"events":{"type":"integer","minimum":0,"exclusiveMinimum":true},"eventsAnnual":{"type":"integer","minimum":0,"exclusiveMinimum":true},"annualStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"seats":{"type":"integer","minimum":0,"exclusiveMinimum":true},"domains":{"type":"integer","minimum":0,"exclusiveMinimum":true},"auditPages":{"type":"integer","minimum":0},"auditPagesAdvanced":{"type":"integer","minimum":0}}},"billing":{"type":"object","nullable":true,"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"licensePrice":{"type":"number","minimum":0},"contractStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"contractYears":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":10},"paymentCadence":{"type":"string","enum":["monthly","quarterly","annually"]},"overage":{"type":"object","properties":{"perMillionEvents":{"type":"number","minimum":0},"perUser":{"type":"number","minimum":0},"perProperty":{"type":"number","minimum":0},"perSimpleAudit":{"type":"number","minimum":0},"perAdvancedAudit":{"type":"number","minimum":0}}},"stripeCustomerId":{"type":"string","maxLength":64}}}}},"AdminOrgDelete":{"type":"object","properties":{"confirmName":{"type":"string"}},"required":["confirmName"]},"AdminRepublishResult":{"type":"object","properties":{"republished":{"type":"number"},"skipped":{"type":"number"},"tokens":{"type":"array","items":{"type":"string"}}},"required":["republished","skipped","tokens"]},"AdminRepublish":{"type":"object","properties":{"orgId":{"type":"string"},"domainIds":{"type":"array","items":{"type":"string"},"maxItems":200},"all":{"type":"boolean","default":false}}},"AdminImportLegacyResult":{"type":"object","properties":{"imported":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"token":{"type":"string"},"version":{"type":"number"},"frozen":{"type":"boolean"}},"required":["domainId","token","version","frozen"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"reason":{"type":"string"}},"required":["domainId","reason"]}}},"required":["imported","skipped"]},"AdminImportLegacy":{"type":"object","properties":{"domainIds":{"type":"array","items":{"type":"string"},"maxItems":200},"orgId":{"type":"string"}}},"GtmAccounts":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}},"required":["accountId","name","path"]}}},"required":["accounts"]},"GtmAccountContainers":{"type":"object","properties":{"containers":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"containerId":{"type":"string"},"publicId":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}},"required":["accountId","containerId","publicId","name","path"]}}},"required":["containers"]},"GtmTagInventory":{"type":"object","properties":{"workspaceName":{"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"tagId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"displayType":{"type":"string"},"paused":{"type":"boolean"},"isMonita":{"type":"boolean"},"parameters":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"type":{"type":"string"}},"required":["value","type"]}}},"required":["tagId","name","type","displayType","paused","isMonita","parameters"]}},"variables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]}}},"required":["workspaceName","tags","variables"]},"GtmDeployResult":{"type":"object","properties":{"deployed":{"type":"boolean"},"workspacePath":{"type":"string"},"workspaceName":{"type":"string"},"workspaceCreated":{"type":"boolean"},"template":{"type":"string","enum":["new","existing","updated"]},"tag":{"type":"string","enum":["new","updated"]},"monitoredTags":{"type":"number"}},"required":["deployed","workspacePath","workspaceName","workspaceCreated","template","tag","monitoredTags"]},"GtmDeployInput":{"type":"object","properties":{"domainId":{"type":"string"},"containerPath":{"type":"string","pattern":"^accounts\\/\\d+\\/containers\\/\\d+$"},"container":{"type":"object","properties":{"name":{"type":"string"},"publicId":{"type":"string"},"accountId":{"type":"string"},"containerId":{"type":"string"}},"required":["name","publicId","accountId","containerId"]},"tagName":{"type":"string","minLength":1,"maxLength":100,"default":"Monita Tag"},"customerIdVariable":{"type":"string","maxLength":200,"default":""},"sessionIdVariable":{"type":"string","maxLength":200,"default":""},"whitelistedDomains":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":100,"default":[]},"selectedTags":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"default":{}}},"required":["domainId","containerPath","container"]},"GtmRedeployInput":{"type":"object","properties":{"domainId":{"type":"string"}},"required":["domainId"]},"SlackChannels":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isPrivate":{"type":"boolean"}},"required":["id","name","isPrivate"]}}},"required":["channels"]},"SlackChannelInput":{"type":"object","properties":{"channelId":{"type":"string"},"channelName":{"type":"string"}},"required":["channelId","channelName"]},"JiraConfig":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"status":{"type":"string"},"config":{"type":"object","properties":{"sites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"name":{"type":"string"}},"required":["id","url","name"]}},"cloudId":{"type":"string"},"siteUrl":{"type":"string"},"siteName":{"type":"string"},"defaultProjectKey":{"type":"string"},"issueType":{"type":"string"},"minSeverity":{"type":"string"},"autoCreate":{"type":"boolean"},"projectMappings":{"type":"object","additionalProperties":{"type":"string"}}}}},"required":["id","label","status","config"]},"JiraConfigPatch":{"type":"object","properties":{"cloudId":{"type":"string"},"defaultProjectKey":{"type":"string"},"issueType":{"type":"string","minLength":1,"maxLength":50},"minSeverity":{"type":"string","enum":["low","medium","high","critical"]},"autoCreate":{"type":"boolean"},"projectMappings":{"type":"object","additionalProperties":{"type":"string"}}}},"JiraProjects":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"}},"required":["id","key","name"]}}},"required":["projects"]},"TeamsClaimInput":{"type":"object","properties":{"nonce":{"type":"string","format":"uuid"}},"required":["nonce"]},"TeamsChannels":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["channels"]},"TeamsChannelInput":{"type":"object","properties":{"channelId":{"type":"string"},"channelName":{"type":"string"}},"required":["channelId","channelName"]},"ChangeEvents":{"type":"object","properties":{"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string","nullable":true},"domainId":{"type":"string","nullable":true},"source":{"type":"string"},"ref":{"type":"string"},"title":{"type":"string","nullable":true},"occurredAt":{"type":"number"},"windowMinutes":{"type":"number"},"status":{"type":"string"},"findings":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["id","domain","domainId","source","ref","title","occurredAt","windowMinutes","status","findings"]}}},"required":["changes"]},"AutoCatalog":{"type":"object","properties":{"signals":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"domain":{"type":"string"},"vendor":{"type":"string"},"event":{"type":"string"},"events24h":{"type":"number"},"events7d":{"type":"number"},"eventsWindow":{"type":"number"},"eventsPrevWindow":{"type":"number"},"changePct":{"type":"number","nullable":true},"lastSeen":{"type":"number","nullable":true},"mode":{"type":"string","enum":["auto","muted","off"]},"sensitivity":{"type":"number","nullable":true},"readiness":{"type":"object","properties":{"hours":{"type":"number"},"pct":{"type":"number"},"stage":{"type":"string"}},"required":["hours","pct","stage"]},"spark":{"type":"array","items":{"type":"number"}},"openIssues":{"type":"number"},"label":{"type":"string","nullable":true}},"required":["domainId","domain","vendor","event","events24h","events7d","eventsWindow","eventsPrevWindow","changePct","lastSeen","mode","sensitivity","readiness","spark","openIssues","label"]}}},"required":["signals"]},"EnvPresence":{"type":"object","properties":{"devOnly":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"domain":{"type":"string"},"vendor":{"type":"string"},"event":{"type":"string"},"events":{"type":"number"}},"required":["domainId","domain","vendor","event","events"]}},"prodOnly":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"domain":{"type":"string"},"vendor":{"type":"string"},"event":{"type":"string"},"events":{"type":"number"}},"required":["domainId","domain","vendor","event","events"]}},"devActive":{"type":"boolean"}},"required":["devOnly","prodOnly","devActive"]},"AutoConfig":{"type":"object","properties":{"volume":{"type":"object","properties":{"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["realtime","hourly","6hours","daily"]},"sensitivity":{"type":"number","minimum":2,"maximum":8}},"required":["enabled","frequency","sensitivity"]},"data":{"type":"object","properties":{"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["6hours","daily","weekly"]}},"required":["enabled","frequency"]},"compliance":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"devSignals":{"type":"boolean"},"timezone":{"type":"string","minLength":1,"maxLength":64},"calendar":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","maxLength":80},"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["suppress","elevated"]},"annual":{"type":"boolean"}},"required":["id","name","start","end","mode"]},"maxItems":50}},"required":["volume","data","compliance"]},"AnomalySeries":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"number"},"actual":{"type":"number"},"expected":{"type":"number"},"lo":{"type":"number"},"hi":{"type":"number"},"flag":{"type":"string","nullable":true}},"required":["hour","actual","expected","lo","hi","flag"]}},"readiness":{"type":"object","properties":{"hours":{"type":"number"},"pct":{"type":"number"},"stage":{"type":"string"}},"required":["hours","pct","stage"]},"windows":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"name":{"type":"string"},"mode":{"type":"string"}},"required":["start","end","name","mode"]}}},"required":["points","readiness"]},"AnomalyBacktest":{"type":"object","properties":{"readiness":{"type":"object","properties":{"hours":{"type":"number"},"pct":{"type":"number"},"stage":{"type":"string"}},"required":["hours","pct","stage"]},"hours":{"type":"number"},"sensitivities":{"type":"array","items":{"type":"object","properties":{"sensitivity":{"type":"number"},"counts":{"type":"object","properties":{"zero":{"type":"number"},"drop":{"type":"number"},"spike":{"type":"number"},"shift":{"type":"number"}},"required":["zero","drop","spike","shift"]},"flaggedHours":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"number"},"flag":{"type":"string"}},"required":["hour","flag"]}}},"required":["sensitivity","counts","flaggedHours"]}}},"required":["readiness","hours","sensitivities"]},"SessionFlows":{"type":"object","properties":{"sessionsSampled":{"type":"number"},"steps":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"nodes":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"},"vendors":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"event":{"type":"string"},"count":{"type":"number"}},"required":["vendor","event","count"]}}},"required":["path","sessions","vendors"]}}},"required":["index","nodes"]}},"links":{"type":"array","items":{"type":"object","properties":{"fromStep":{"type":"number"},"fromPath":{"type":"string"},"toPath":{"type":"string"},"sessions":{"type":"number"}},"required":["fromStep","fromPath","toPath","sessions"]}}},"required":["sessionsSampled","steps","links"]},"JourneyPaths":{"type":"object","properties":{"sessionsSampled":{"type":"number"},"revenueVisible":{"type":"boolean"},"conversionSource":{"type":"string","enum":["explicit","labels","heuristic"]},"paths":{"type":"array","items":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"string"}},"sessions":{"type":"number"},"conversions":{"type":"number"},"revenue":{"type":"number"},"steps":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"event":{"type":"string"},"label":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"count":{"type":"number"}},"required":["vendor","event","label","color","count"]}}},"required":["path","tags"]}}},"required":["pages","sessions","conversions","steps"]}}},"required":["sessionsSampled","revenueVisible","conversionSource","paths"]},"ProjectList":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"isDefault":{"type":"boolean"},"domainCount":{"type":"number"},"myRole":{"type":"string","enum":["admin","editor","viewer"]},"grants":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"}},"required":["userId","email","role"]}}},"required":["id","name","description","isDefault","domainCount","myRole"]}}},"required":["projects"]},"Labels":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["event","key"]},"vendor":{"type":"string"},"ref":{"type":"string"},"label":{"type":"string","nullable":true},"class":{"type":"string","nullable":true},"source":{"type":"string"},"color":{"type":"string","nullable":true},"conversion":{"type":"number","nullable":true}},"required":["kind","vendor","ref","label","class","source","color","conversion"]}}},"required":["labels"]},"Scores":{"type":"object","properties":{"overall":{"type":"number"},"availability":{"type":"object","properties":{"score":{"type":"number"},"detail":{"type":"string"}},"required":["score","detail"]},"accuracy":{"type":"object","properties":{"score":{"type":"number"},"detail":{"type":"string"}},"required":["score","detail"]},"compliance":{"type":"object","properties":{"score":{"type":"number"},"detail":{"type":"string"}},"required":["score","detail"]}},"required":["overall","availability","accuracy","compliance"]},"LabelsHealth":{"type":"object","properties":{"diverging":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"event":{"type":"string"},"label":{"type":"string"},"similarity":{"type":"number"},"events":{"type":"number"},"bucketEvents":{"type":"number"}},"required":["vendor","event","label","similarity","events","bucketEvents"]}},"suggestions":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"event":{"type":"string"},"label":{"type":"string"},"similarity":{"type":"number"},"events":{"type":"number"}},"required":["vendor","event","label","similarity","events"]}},"windowDays":{"type":"number"}},"required":["diverging","suggestions","windowDays"]},"CoverageMatrix":{"type":"object","properties":{"vendors":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"inSitemap":{"type":"boolean"},"events":{"type":"number"},"fired":{"type":"object","additionalProperties":{"type":"number"}}},"required":["path","inSitemap","events","fired"]}},"unmonitored":{"type":"array","items":{"type":"string"}},"sitemapPages":{"type":"number"}},"required":["vendors","rows","unmonitored","sitemapPages"]},"AuditRun":{"type":"object","properties":{"scanned":{"type":"number"},"errors":{"type":"number"},"issuesFiled":{"type":"number"}},"required":["scanned","errors","issuesFiled"]},"AuditResults":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"scannedAt":{"type":"number"},"status":{"type":"string"},"vendors":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"host":{"type":"string"},"parent":{"type":"string","nullable":true},"requests":{"type":"number"},"accountIds":{"type":"array","items":{"type":"string"}}},"required":["vendor","host","parent","requests","accountIds"]}},"cookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":"string"},"expires":{"type":"number"},"secure":{"type":"boolean"},"httpOnly":{"type":"boolean"},"sameSite":{"type":"string"}},"required":["name","domain","expires","secure","httpOnly","sameSite"]}}},"required":["path","scannedAt","status","vendors","cookies"]}},"policies":{"type":"object","additionalProperties":{"type":"string"}},"lastScannedAt":{"type":"number","nullable":true},"sitePages":{"type":"number"}},"required":["pages","policies","lastScannedAt","sitePages"]},"AuditEstimate":{"type":"object","properties":{"pages":{"type":"number"},"simple":{"type":"object","properties":{"budget":{"type":"number"},"used":{"type":"number"},"remaining":{"type":"number"}},"required":["budget","used","remaining"]},"advanced":{"type":"object","properties":{"budget":{"type":"number"},"used":{"type":"number"},"remaining":{"type":"number"}},"required":["budget","used","remaining"]},"maxPerRun":{"type":"number"}},"required":["pages","simple","advanced","maxPerRun"]},"AuditRunInput":{"type":"object","properties":{"kind":{"type":"string","enum":["property","url","campaign"],"default":"property"},"name":{"type":"string","maxLength":120},"domainId":{"type":"string"},"paths":{"type":"array","items":{"type":"string","maxLength":300},"maxItems":500},"fetchSitemap":{"type":"boolean"},"sitemapUrl":{"type":"string","maxLength":500,"format":"uri"},"url":{"type":"string","maxLength":2000,"format":"uri"},"injectCookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"value":{"type":"string","maxLength":2000},"domain":{"type":"string","maxLength":200}},"required":["name","value"]},"maxItems":20},"advanced":{"type":"object","properties":{"region":{"type":"string","maxLength":30},"proxies":{"type":"boolean"},"bypassBanners":{"type":"boolean"},"consentInstruction":{"type":"string","maxLength":300}}},"overage":{"type":"boolean","default":false}}},"AuditChanges":{"type":"object","properties":{"latestRunId":{"type":"string","nullable":true},"latestRunAt":{"type":"number","nullable":true},"previousRunAt":{"type":"number","nullable":true},"vendors":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["added","removed"]},"cookies":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["added","removed"]}},"required":["latestRunId","latestRunAt","previousRunAt","vendors","cookies"]},"AuditRunDetail":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["property","url","campaign"]},"tier":{"type":"string","enum":["simple","advanced"]},"status":{"type":"string","enum":["queued","running","done","error","canceled"]},"name":{"type":"string","nullable":true},"startedBy":{"type":"string","nullable":true},"targetHost":{"type":"string","nullable":true},"domainId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"pagesRequested":{"type":"number"},"pagesScanned":{"type":"number"},"pagesErrored":{"type":"number"},"issuesFiled":{"type":"number"},"summary":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"shared":{"type":"boolean"},"error":{"type":"string","nullable":true},"createdAt":{"type":"number"},"finishedAt":{"type":"number","nullable":true},"findings":{"type":"array","items":{"type":"object","properties":{"page":{"type":"string"},"check":{"type":"string"},"key":{"type":"string"},"value":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"verdict":{"type":"string","nullable":true}},"required":["page","check","key","value","verdict"]}}},"required":["id","kind","tier","status","name","startedBy","targetHost","domainId","domain","pagesRequested","pagesScanned","pagesErrored","issuesFiled","summary","shared","error","createdAt","finishedAt","findings"]},"AuditScheduleInput":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"kind":{"type":"string","enum":["property","url","campaign"],"default":"property"},"domainId":{"type":"string"},"url":{"type":"string","maxLength":2000,"format":"uri"},"injectCookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"value":{"type":"string","maxLength":2000},"domain":{"type":"string","maxLength":200}},"required":["name","value"]},"maxItems":20},"advanced":{"type":"object","properties":{"region":{"type":"string","maxLength":30},"proxies":{"type":"boolean"},"bypassBanners":{"type":"boolean"},"consentInstruction":{"type":"string","maxLength":300}}},"frequency":{"type":"string","enum":["daily","weekly"],"default":"daily"},"hourUtc":{"type":"integer","minimum":0,"maximum":23,"default":3},"weekday":{"type":"integer","minimum":0,"maximum":6,"default":1}}},"FlowTest":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prompt":{"type":"string"},"domainId":{"type":"string","nullable":true},"targetDomain":{"type":"string","nullable":true},"variables":{"type":"object","additionalProperties":{"type":"string"}},"status":{"type":"string"},"stepsCount":{"type":"number"},"activeVersion":{"type":"number","nullable":true},"schedule":{"$ref":"#/components/schemas/FlowSchedule"},"nextRunAt":{"type":"number","nullable":true},"provider":{"type":"string","enum":["cloudflare","browserbase"]},"regions":{"type":"array","items":{"type":"string"}},"proxies":{"type":"boolean"},"createdAt":{"type":"number"},"updatedAt":{"type":"number"},"latestRun":{"$ref":"#/components/schemas/FlowRun"}},"required":["id","name","prompt","domainId","targetDomain","variables","status","stepsCount","activeVersion","schedule","nextRunAt","provider","regions","proxies","createdAt","updatedAt","latestRun"]},"FlowSchedule":{"type":"string","nullable":true,"maxLength":24,"example":"daily@09:00"},"FlowRun":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"testId":{"type":"string"},"versionId":{"type":"string","nullable":true},"status":{"type":"string"},"trigger":{"type":"string"},"startedAt":{"type":"number","nullable":true},"finishedAt":{"type":"number","nullable":true},"durationMs":{"type":"number","nullable":true},"pausedMs":{"type":"number","nullable":true},"summary":{"type":"object","nullable":true,"properties":{"stepsTotal":{"type":"number"},"stepsPassed":{"type":"number"},"healedSteps":{"type":"number"},"vendorsFired":{"type":"number"},"findings":{"type":"number"},"pausedMs":{"type":"number"}},"required":["stepsTotal","stepsPassed","healedSteps","vendorsFired","findings"]},"error":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"createdAt":{"type":"number"}},"required":["id","testId","versionId","status","trigger","startedAt","finishedAt","durationMs","pausedMs","summary","error","region","createdAt"]},"FlowReportShare":{"type":"object","properties":{"id":{"type":"string"},"runId":{"type":"string"},"expiresAt":{"type":"number","nullable":true},"revokedAt":{"type":"number","nullable":true},"createdAt":{"type":"number"}},"required":["id","runId","expiresAt","revokedAt","createdAt"]},"FlowVariable":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"},"kind":{"type":"string","enum":["variable","secret"]},"scope":{"type":"string","enum":["user","project","org"]},"projectId":{"type":"string","nullable":true},"value":{"type":"string","nullable":true},"hint":{"type":"string","nullable":true},"editable":{"type":"boolean"},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","handle","kind","scope","projectId","value","hint","editable","createdAt","updatedAt"]},"FlowVersion":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"},"status":{"type":"string"},"source":{"type":"string"},"promotedFromId":{"type":"string","nullable":true},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"intent":{"type":"string"},"action":{"type":"string"},"selector":{"type":"string"},"value":{"type":"string"},"url":{"type":"string"}},"required":["id","intent","action"]}},"createdAt":{"type":"number"}},"required":["id","version","status","source","promotedFromId","steps","createdAt"]}},"parameters":{}},"paths":{"/v1/alerts":{"post":{"tags":["Alerts"],"summary":"Create an alert rule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Alerts"],"summary":"List alert rules","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"alerts":{"type":"array","items":{"$ref":"#/components/schemas/Alert"}}},"required":["alerts"]}}}}}}},"/v1/alerts/preview":{"post":{"tags":["Alerts"],"summary":"Preview a draft rule against recent events","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertPreviewInput"}}}},"responses":{"200":{"description":"Preview result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertPreview"}}}},"503":{"description":"Preview unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/alerts/backtest":{"post":{"tags":["Alerts"],"summary":"Backtest a draft rule against recent history","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertBacktestInput"}}}},"responses":{"200":{"description":"Backtest result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertBacktest"}}}},"503":{"description":"Backtest unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/alerts/{id}":{"get":{"tags":["Alerts"],"summary":"Get an alert rule","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Alerts"],"summary":"Update an alert rule","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Alerts"],"summary":"Delete an alert rule","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/alerts/bulk":{"post":{"tags":["Alerts"],"summary":"Bulk-create alert rules","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertBulkInput"}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertBulkResult"}}}}}}},"/v1/alerts/{id}/enabled":{"put":{"tags":["Alerts"],"summary":"Enable or disable an alert rule","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertEnabledInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/issues":{"get":{"tags":["Issues"],"summary":"List issues","parameters":[{"schema":{"type":"string","enum":["open","acknowledged","resolved","muted"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string","enum":["low","medium","high","critical"]},"required":false,"name":"severity","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Issue"},{"type":"object","properties":{"domain":{"type":"string","nullable":true}},"required":["domain"]}]}},"suppressions":{"type":"array","items":{"type":"object","properties":{"domainId":{"type":"string"},"domain":{"type":"string"},"until":{"type":"number"},"vanished":{"type":"array","items":{"type":"string"}},"appeared":{"type":"array","items":{"type":"string"}}},"required":["domainId","domain","until","vanished","appeared"]}}},"required":["issues","suppressions"]}}}}}}},"/v1/issues/{id}":{"get":{"tags":["Issues"],"summary":"Get an issue with occurrence series + history","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueDetail"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Issues"],"summary":"Update issue status or notes","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuePatch"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Issue"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/issues/bulk":{"post":{"tags":["Issues"],"summary":"Bulk update issue status","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueBulkInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]}}}}}}},"/v1/integrations":{"post":{"tags":["Integrations"],"summary":"Connect an integration","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"409":{"description":"Already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Integrations"],"summary":"List integrations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"$ref":"#/components/schemas/Integration"}}},"required":["integrations"]}}}}}}},"/v1/integrations/{id}":{"delete":{"tags":["Integrations"],"summary":"Disconnect an integration","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/scan":{"post":{"tags":["Domains"],"summary":"Scan a URL to auto-detect marketing vendors","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":500}},"required":["url"]}}}},"responses":{"200":{"description":"Scan result","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"detectedVendors":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"screenshotBase64":{"type":"string"},"warning":{"type":"string"}},"required":["url","detectedVendors"]}}}},"400":{"description":"Invalid URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains":{"post":{"tags":["Domains"],"summary":"Create a monitored domain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"409":{"description":"Domain exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Domains"],"summary":"List domains","parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/Domain"}}},"required":["domains"]}}}}}}},"/v1/domains/import":{"post":{"tags":["Domains"],"summary":"Import an existing production domain config verbatim (original token preserved)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainImport"}}}},"responses":{"201":{"description":"Imported","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"409":{"description":"Token already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/promote":{"post":{"tags":["Domains"],"summary":"Promote the dev script version to production","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Promoted","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number"},"renames":{"type":"array","items":{"type":"string"}}},"required":["version","renames"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/migrate-signal-history":{"post":{"tags":["Domains"],"summary":"Carry signal history to renamed event names for one vendor","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"vendor":{"type":"string","minLength":1,"maxLength":200}},"required":["vendor"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalMigrations"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}":{"get":{"tags":["Domains"],"summary":"Get a domain with its dev + prod monitoring configs","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDetail"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Domains"],"summary":"Delete a domain (cascades monitors, script versions, CDN artifacts)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/monitoring":{"put":{"tags":["Domains"],"summary":"Update monitoring config (dev environment; promote to ship)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitoringUpdate"}}}},"responses":{"200":{"description":"Saved to dev","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number"}},"required":["version"]}}}},"400":{"description":"Unsupported vendors / source class","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/environment":{"get":{"tags":["Domains"],"summary":"Detected TMS/CMS/build environment for a domain","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainEnvironment"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Domains"],"summary":"Set the primary TMS for a multi-TMS domain","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainEnvironmentInput"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/name":{"put":{"tags":["Domains"],"summary":"Rename a domain","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainRename"}}}},"responses":{"200":{"description":"Renamed","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/versions":{"get":{"tags":["Domains"],"summary":"Prod deployment history (newest first)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainVersions"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/rollback":{"post":{"tags":["Domains"],"summary":"Roll prod back to a prior version (republished as a new version)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["version"]}}}},"responses":{"200":{"description":"Rolled back","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number"},"rolledBackTo":{"type":"number"}},"required":["version","rolledBackTo"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/project":{"put":{"tags":["Domains"],"summary":"Assign a domain to a project (null = org-wide commons); org admin","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","nullable":true}},"required":["projectId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/endpoint":{"put":{"tags":["Domains"],"summary":"Set which endpoint/CDN hostname pair this property uses (org admin)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["legacy","monita"]}},"required":["mode"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainEndpoint"}}}},"403":{"description":"Forbidden / endpoint locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/collect":{"put":{"tags":["Domains"],"summary":"Set a custom collection hostname for this domain (org admin)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","minLength":4,"maxLength":253}},"required":["hostname"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"dns":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"},"purpose":{"type":"string"}},"required":["type","name","value","purpose"]}}},"required":["hostname","status"]}}}},"400":{"description":"Bad hostname","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provisioning unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Domains"],"summary":"Custom collection hostname status (refreshes from Cloudflare)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"dns":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"},"purpose":{"type":"string"}},"required":["type","name","value","purpose"]}}},"required":["hostname","status"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Domains"],"summary":"Remove the custom collection hostname (org admin)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/hostnames":{"get":{"tags":["Domains"],"summary":"Hostnames observed for this property, with verdicts and 7d traffic","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hostnames":{"type":"array","items":{"$ref":"#/components/schemas/PropertyHostname"}}},"required":["hostnames"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/domains/{id}/hostnames/{hostname}":{"put":{"tags":["Domains"],"summary":"Set the verdict for an observed hostname (denied = dropped at the collector)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":253},"required":true,"name":"hostname","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["unreviewed","approved","denied"]}},"required":["status"]}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/params":{"get":{"tags":["Events"],"summary":"Parameters observed in recent traffic (for rule autocomplete)","parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"vendor","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":168,"default":24},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventParams"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/dictionary":{"get":{"tags":["Events"],"summary":"Observed payload keys per vendor with presence and example values","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":168,"default":24},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string","enum":["prod","dev","both"],"default":"prod"},"required":false,"name":"env","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataDictionary"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/dictionary/flat":{"get":{"tags":["Events"],"summary":"Flat dictionary rows: domain > vendor > event > key with top values","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":168,"default":24},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataDictionaryFlat"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/values":{"get":{"tags":["Events"],"summary":"Distinct observed values for a parameter (envelope column or dt key)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"param","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"vendor","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":720,"default":168},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}}},"required":["values"]}}}}}}},"/v1/stats/overview":{"get":{"tags":["Stats"],"summary":"Org-wide monitoring overview (events, vendors, domains, issues)","parameters":[{"schema":{"type":"integer","minimum":24,"maximum":336,"default":72},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsOverview"}}}}}}},"/v1/stats/uptime":{"get":{"tags":["Stats"],"summary":"Tag uptime: vendor × hour event counts","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":168,"default":24},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsUptime"}}}}}}},"/v1/stats/performance":{"get":{"tags":["Stats"],"summary":"Vendor performance: execution time and failure mix","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":168,"default":24},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsPerformance"}}}}}}},"/v1/stats/live":{"get":{"tags":["Stats"],"summary":"Live events (last hour, minute buckets, seconds-fresh)","parameters":[{"schema":{"type":"integer","minimum":5,"maximum":60,"default":60},"required":false,"name":"minutes","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsLive"}}}},"503":{"description":"Live tier unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/stats/tag-uptime":{"get":{"tags":["Stats"],"summary":"Tag Uptime tree: domain → vendor → vendor-event status strips + issues","parameters":[{"schema":{"type":"integer","minimum":24,"maximum":336,"default":24},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagUptimeTree"}}}},"503":{"description":"Engine unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/compliance/pii":{"get":{"tags":["Compliance"],"summary":"Scan recent vendor payloads for PII-shaped data","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":168,"default":24},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string"},"required":false,"name":"domainId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"hostname","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PiiScan"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/compliance/vendors":{"get":{"tags":["Compliance"],"summary":"Vendors observed in traffic with their allow/block policy (optionally resolved for a project or property)","parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"domainId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorPolicies"}}}}}}},"/v1/compliance/vendors/{vendor}":{"put":{"tags":["Compliance"],"summary":"Set the allow/block policy for a vendor (org-wide, per project, or per property)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"vendor","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorPolicyInput"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/compliance/cookies":{"get":{"tags":["Compliance"],"summary":"Tracking cookies observed in live traffic (presence-only watchlist)","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":336,"default":72},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string"},"required":false,"name":"domainId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"hostname","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObservedCookies"}}}}}}},"/v1/compliance/pii/deep":{"post":{"tags":["Compliance"],"summary":"AI deep scan: PII beyond regex shapes (names, addresses, id numbers)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domainId":{"type":"string"},"hours":{"type":"integer","minimum":1,"maximum":168,"default":24}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PiiDeepScan"}}}},"403":{"description":"AI features disabled (org setting or flag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"AI unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/compliance/pii/action":{"post":{"tags":["Compliance"],"summary":"Act on a deep-scan finding: file an issue or ignore the key","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["file","ignore"]},"vendor":{"type":"string","minLength":1,"maxLength":200},"key":{"type":"string","minLength":1,"maxLength":300},"kind":{"type":"string","maxLength":40,"default":"pii"},"note":{"type":"string","maxLength":300}},"required":["action","vendor","key"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok"]}}}}}}},"/v1/compliance/consent-config":{"get":{"tags":["Compliance"],"summary":"Consent Configuration: per-property mode, rules, and detected CMP","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentConfig"}}}}}},"put":{"tags":["Compliance"],"summary":"Set a scope's consent mode and rules (domainId '' = org default)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domainId":{"type":"string","maxLength":40,"default":""},"mode":{"type":"string","enum":["auto","manual"]},"rules":{"type":"array","items":{"type":"object","properties":{"match":{"type":"string","enum":["equals","prefix","contains","regex"]},"pattern":{"type":"string","minLength":1,"maxLength":200},"verdict":{"type":"string","enum":["yes","no"]},"label":{"type":"string","maxLength":100},"categories":{"type":"array","items":{"type":"string","enum":["ads","social","analytics","session_replay","chat","other"]},"maxItems":6}},"required":["match","pattern","verdict"]},"maxItems":50,"default":[]},"note":{"type":"string","maxLength":500},"cmpExpected":{"type":"boolean"}},"required":["mode"]}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/compliance/consent-samples":{"get":{"tags":["Compliance"],"summary":"Observed cn values with current classification (Consent Configuration)","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":720,"default":72},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"domainId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentSamples"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/performance/tags":{"get":{"tags":["Performance"],"summary":"Per-vendor tag execution timing from sampled field telemetry","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":720,"default":24},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"domainId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagPerformance"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/me":{"get":{"tags":["Notifications"],"summary":"The caller's own notification subscriptions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettings"}}}},"400":{"description":"No user identity (org-level API key)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"tags":["Notifications"],"summary":"Update the caller's auto-alert pillar subscriptions","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"volume":{"type":"boolean"},"data":{"type":"boolean"},"compliance":{"type":"boolean"},"audits":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"No user identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/notifications/digest/me":{"put":{"tags":["Notifications"],"summary":"Subscribe or unsubscribe the caller from the org digest, with their audience context","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"subscribed":{"type":"boolean"},"context":{"type":"string","maxLength":200}},"required":["subscribed"]}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"subscribed":{"type":"boolean"}},"required":["ok","subscribed"]}}}},"400":{"description":"No user identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/account/api-keys":{"get":{"tags":["Account"],"summary":"The caller's API keys (never includes secrets)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["keys"]}}}},"400":{"description":"No user identity (org-level credential)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Key service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Account"],"summary":"Create an API key — the secret is in THIS response only","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"expiresInDays":{"type":"integer","minimum":1,"maximum":365}},"required":["name"]}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"secret":{"type":"string"}},"required":["id","name","secret"]}}}},"400":{"description":"No user identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Key service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/account/api-keys/{id}/revoke":{"post":{"tags":["Account"],"summary":"Revoke one of the caller's API keys","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"No user identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not the caller's key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Key service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/compliance/geo":{"get":{"tags":["Compliance"],"summary":"Traffic origin by country/state/city with consent split (command center map)","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":2160,"default":72},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceGeo"}}}},"503":{"description":"Geo tier unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/compliance/consent-vendors":{"get":{"tags":["Compliance"],"summary":"Per-vendor consent breach matrix (fired with/without consent)","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":30,"default":7},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","enum":["all","gdpr","us"],"default":"all"},"required":false,"name":"region","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentVendors"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/compliance/standing":{"get":{"tags":["Compliance"],"summary":"Per-domain compliance standing (portfolio panel)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceStanding"}}}}}}},"/v1/compliance/regulations":{"get":{"tags":["Compliance"],"summary":"US privacy-regulation exposure computed from observed tag behaviour","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":720,"default":168},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceRegulations"}}}}}}},"/v1/compliance/regulations/settings":{"get":{"tags":["Compliance"],"summary":"Which regulations this organization watches vs ignores","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegulationSettings"}}}}}},"put":{"tags":["Compliance"],"summary":"Set the ignored-regulations list","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ignored":{"type":"array","items":{"type":"string"},"maxItems":50}},"required":["ignored"]}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"ignored":{"type":"array","items":{"type":"string"}}},"required":["ok","ignored"]}}}}}}},"/v1/compliance/report":{"get":{"tags":["Compliance"],"summary":"Exportable compliance evidence report (html | json | csv)","parameters":[{"schema":{"type":"string","enum":["html","json","csv","pii-csv"],"default":"html"},"required":false,"name":"format","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":720,"default":168},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"Report","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/v1/org/audit-log":{"get":{"tags":["Organization"],"summary":"Org audit log (owner/admin only)","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","maxLength":80},"required":false,"name":"action","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"actor","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLog"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/audit-log/export":{"get":{"tags":["Organization"],"summary":"Export the audit log as CSV (owner/admin only)","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":365,"default":90},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org":{"get":{"tags":["Organization"],"summary":"Current organization settings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSettings"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Organization"],"summary":"Update organization settings (name, digest)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSettingsInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSettings"}}}},"400":{"description":"Rename rejected by Clerk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Clerk unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/value":{"get":{"tags":["Organization"],"summary":"Impact value protected by monitoring","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueReport"}}}}}}},"/v1/org/members":{"get":{"tags":["Organization"],"summary":"Org members (Clerk roster merged with local user records)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMembers"}}}},"503":{"description":"Clerk unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/invitations":{"get":{"tags":["Organization"],"summary":"Pending organization invitations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgInvitations"}}}},"503":{"description":"Clerk unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Organization"],"summary":"Invite a teammate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgInviteInput"}}}},"responses":{"201":{"description":"Invited","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invite failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Clerk unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/invitations/{id}":{"delete":{"tags":["Organization"],"summary":"Revoke a pending invitation","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"503":{"description":"Clerk unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/members/{clerkUserId}":{"patch":{"tags":["Organization"],"summary":"Change a member role","parameters":[{"schema":{"type":"string"},"required":true,"name":"clerkUserId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberRoleInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Refused (e.g. sole owner)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not a member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Clerk unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Organization"],"summary":"Remove a member from the organization","parameters":[{"schema":{"type":"string"},"required":true,"name":"clerkUserId","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Refused (self, or sole owner)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not a member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Clerk unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/orgs":{"get":{"tags":["Admin"],"summary":"All organizations with usage and issue counts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrgs"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/orgs/{id}":{"put":{"tags":["Admin"],"summary":"Override plan / billing mode / trial for an org","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrgUpdate"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Admin"],"summary":"Delete an organization and all its data (staff only, name-confirmed)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrgDelete"}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"domains":{"type":"number"}},"required":["deleted","domains"]}}}},"400":{"description":"Name mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/republish":{"post":{"tags":["Admin"],"summary":"Republish script/config artifacts for an org or specific domains","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRepublish"}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRepublishResult"}}}},"400":{"description":"Bad scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/import-legacy":{"post":{"tags":["Admin"],"summary":"Freeze migrated domains onto their live raptor CDN artifacts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportLegacy"}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportLegacyResult"}}}},"400":{"description":"Bad scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/gtm/authorize":{"get":{"tags":["GTM"],"summary":"Google OAuth consent URL for GTM container access","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"503":{"description":"OAuth not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/gtm/callback":{"get":{"tags":["GTM"],"summary":"OAuth callback: exchanges the code, stores the refresh token","parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"query"},{"schema":{"type":"string"},"required":true,"name":"state","in":"query"}],"responses":{"302":{"description":"Back to the app"},"400":{"description":"Bad state/code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"OAuth not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/gtm/accounts":{"get":{"tags":["GTM"],"summary":"List GTM accounts for the connected Google user","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmAccounts"}}}},"503":{"description":"Not connected / not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/gtm/accounts/{accountId}/containers":{"get":{"tags":["GTM"],"summary":"List containers in one GTM account","parameters":[{"schema":{"type":"string"},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmAccountContainers"}}}},"503":{"description":"Not connected / not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/gtm/tags":{"get":{"tags":["GTM"],"summary":"Tag inventory of a container workspace for monitoring selection","parameters":[{"schema":{"type":"string","pattern":"^accounts\\/\\d+\\/containers\\/\\d+$"},"required":true,"name":"containerPath","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmTagInventory"}}}},"503":{"description":"Not connected / not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/gtm/deploy":{"post":{"tags":["GTM"],"summary":"Deploy the Monita monitoring template + tag into a GTM workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmDeployInput"}}}},"responses":{"200":{"description":"Deployed (unpublished workspace change)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmDeployResult"}}}},"404":{"description":"Domain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Not connected / not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/gtm/redeploy":{"post":{"tags":["GTM"],"summary":"Re-deploy monitoring for a GTM domain from its stored selection","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmRedeployInput"}}}},"responses":{"200":{"description":"Redeployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmDeployResult"}}}},"404":{"description":"Domain or stored selection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Not connected / not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/slack/authorize":{"get":{"tags":["Slack"],"summary":"Slack OAuth v2 install URL for the Monita app","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"503":{"description":"OAuth not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/slack/callback":{"get":{"tags":["Slack"],"summary":"OAuth callback: exchanges the code, stores the bot token","parameters":[{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string"},"required":true,"name":"state","in":"query"},{"schema":{"type":"string"},"required":false,"name":"error","in":"query"}],"responses":{"302":{"description":"Back to the app"},"400":{"description":"Bad state/code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"OAuth not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/slack/{id}/channels":{"get":{"tags":["Slack"],"summary":"List channels the bot can post to","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackChannels"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Slack API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/slack/{id}/channel":{"post":{"tags":["Slack"],"summary":"Set the destination channel for this integration","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackChannelInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"label":{"type":"string"}},"required":["ok","label"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Slack rejected the test post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/jira/authorize":{"get":{"tags":["Jira"],"summary":"Atlassian OAuth consent URL","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"503":{"description":"OAuth not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/jira/callback":{"get":{"tags":["Jira"],"summary":"OAuth callback: stores rotating tokens + accessible sites","parameters":[{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string"},"required":true,"name":"state","in":"query"},{"schema":{"type":"string"},"required":false,"name":"error","in":"query"}],"responses":{"302":{"description":"Back to the app"},"400":{"description":"Bad state/code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"OAuth not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/jira/config":{"get":{"tags":["Jira"],"summary":"Current Jira connection config (sites, mapping, thresholds)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JiraConfig"}}}},"404":{"description":"Not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Jira"],"summary":"Update Jira mapping and thresholds","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JiraConfigPatch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"string"}},"required":["ok","status"]}}}},"400":{"description":"Unknown site","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/jira/webhook":{"post":{"tags":["Jira"],"summary":"Jira dynamic-webhook receiver (status sync)","parameters":[{"schema":{"type":"string"},"required":true,"name":"t","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"Processed"},"401":{"description":"Bad capability token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/jira/file/{issueId}":{"post":{"tags":["Jira"],"summary":"Create a Jira issue for a Monita issue on demand","parameters":[{"schema":{"type":"string"},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Filed","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"}},"required":["key"]}}}},"404":{"description":"Issue not found / Jira not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already linked to Jira","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Jira API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/jira/projects":{"get":{"tags":["Jira"],"summary":"List Jira projects on the connected site","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JiraProjects"}}}},"404":{"description":"Not connected / no site selected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Jira API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/teams/messages":{"post":{"tags":["Teams"],"summary":"Bot Framework messaging endpoint","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"Handled"},"401":{"description":"Bad connector JWT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Bot not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/teams/claim":{"post":{"tags":["Teams"],"summary":"Claim a Teams installation for this organization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsClaimInput"}}}},"responses":{"200":{"description":"Claimed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"teamName":{"type":"string"}},"required":["id"]}}}},"404":{"description":"Unknown/expired nonce","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Team already connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/teams/{id}/channels":{"get":{"tags":["Teams"],"summary":"List channels in the connected team","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsChannels"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Connector error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Bot not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/teams/{id}/channel":{"post":{"tags":["Teams"],"summary":"Set the destination channel for this integration","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsChannelInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"label":{"type":"string"}},"required":["ok","label"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Test post failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Bot not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/teams/{id}/test":{"post":{"tags":["Teams"],"summary":"Send a sample alert to the configured channel","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Sent","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"No channel configured yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Connector error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Bot not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/changes":{"get":{"tags":["Changes"],"summary":"Change events and watch-window verdicts","parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeEvents"}}}}}}},"/v1/auto/catalog":{"get":{"tags":["Auto Alerts"],"summary":"Signal catalog: every vendor-event series discovered in traffic","parameters":[{"schema":{"type":"integer","minimum":6,"maximum":336,"default":24},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string","enum":["prod","dev"],"default":"prod"},"required":false,"name":"env","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoCatalog"}}}}}}},"/v1/auto/env-presence":{"get":{"tags":["Auto Alerts"],"summary":"Signals present in only one environment (dev-only / prod-only) over the window","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":30,"default":7},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvPresence"}}}}}}},"/v1/auto/signals":{"put":{"tags":["Auto Alerts"],"summary":"Set a signal mode (auto = monitored, muted = tracked no issues, off = ignored) and/or sensitivity override","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domainId":{"type":"string","minLength":1},"vendor":{"type":"string","minLength":1,"maxLength":200},"event":{"type":"string","maxLength":200,"default":""},"mode":{"type":"string","enum":["auto","muted","off"]},"sensitivity":{"type":"integer","nullable":true,"minimum":2,"maximum":8}},"required":["domainId","vendor","mode"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auto/settings":{"get":{"tags":["Auto Alerts"],"summary":"Org Auto Alerts configuration","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoConfig"}}}}}},"put":{"tags":["Auto Alerts"],"summary":"Update org Auto Alerts configuration","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"volume":{"type":"object","properties":{"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["realtime","hourly","6hours","daily"]},"sensitivity":{"type":"number","minimum":2,"maximum":8}},"required":["enabled","frequency","sensitivity"]},"data":{"type":"object","properties":{"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["6hours","daily","weekly"]}},"required":["enabled","frequency"]},"compliance":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"devSignals":{"type":"boolean"},"timezone":{"type":"string","minLength":1,"maxLength":64},"calendar":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","maxLength":80},"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["suppress","elevated"]},"annual":{"type":"boolean"}},"required":["id","name","start","end","mode"]},"maxItems":50}},"required":["volume","data","compliance"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auto/series":{"post":{"tags":["Auto Alerts"],"summary":"Anomaly chart data for one signal (same engine that files issues)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domainId":{"type":"string","minLength":1},"vendor":{"type":"string","minLength":1,"maxLength":200},"event":{"type":"string","maxLength":200,"default":""},"hours":{"type":"integer","minimum":24,"maximum":504,"default":336},"sensitivity":{"type":"number","minimum":2,"maximum":8,"default":4}},"required":["domainId","vendor"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomalySeries"}}}},"503":{"description":"Engine unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auto/backtest":{"post":{"tags":["Auto Alerts"],"summary":"Backtest one signal across all sensitivities (2…8)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domainId":{"type":"string","minLength":1},"vendor":{"type":"string","minLength":1,"maxLength":200},"event":{"type":"string","maxLength":200,"default":""},"hours":{"type":"integer","minimum":24,"maximum":504,"default":336}},"required":["domainId","vendor"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomalyBacktest"}}}},"503":{"description":"Engine unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/journeys/flows":{"get":{"tags":["Journeys"],"summary":"Session flow graph: paths per step with the tags firing at each","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":336,"default":72},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string"},"required":false,"name":"domainId","in":"query"},{"schema":{"type":"integer","minimum":2,"maximum":6,"default":4},"required":false,"name":"maxSteps","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionFlows"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/journeys/paths":{"get":{"tags":["Journeys"],"summary":"Most common session paths, label-enriched, with conversions and (permission-gated) revenue","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":336,"default":72},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string"},"required":false,"name":"domainId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"integer","minimum":3,"maximum":30,"default":12},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyPaths"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects":{"get":{"tags":["Projects"],"summary":"Projects visible to the caller (grants included for org admins)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectList"}}}}}},"post":{"tags":["Projects"],"summary":"Create a project (org admin)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}":{"put":{"tags":["Projects"],"summary":"Rename / redescribe a project (org admin)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Projects"],"summary":"Delete a project — its domains return to the org-wide commons (org admin)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}/grants":{"put":{"tags":["Projects"],"summary":"Set a member grant on a project: viewer, editor, or none (org admin)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"role":{"type":"string","enum":["viewer","editor","none"]}},"required":["userId","role"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/insights/labels":{"get":{"tags":["Insights"],"summary":"The semantic layer: event labels + key classes (AI-proposed, user-editable)","parameters":[{"schema":{"type":"string","enum":["event","key"]},"required":false,"name":"kind","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Labels"}}}}}},"put":{"tags":["Insights"],"summary":"Set/override a label or key class (user edits always beat AI)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["event","key"]},"vendor":{"type":"string","minLength":1,"maxLength":200},"ref":{"type":"string","minLength":1,"maxLength":300},"label":{"type":"string","nullable":true,"maxLength":80},"class":{"type":"string","nullable":true,"enum":["customer","vendor","critical",null]},"color":{"type":"string","nullable":true,"pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","vendor","ref"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/v1/insights/scores":{"get":{"tags":["Insights"],"summary":"Pillar scores (availability / accuracy / compliance) + overall","parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Scores"}}}}}}},"/v1/insights/labels/assign":{"post":{"tags":["Insights"],"summary":"Create a label (or grow an existing one) with member events in one call","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"kind":{"type":"string","enum":["event","key"],"default":"event"},"members":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","minLength":1,"maxLength":200},"event":{"type":"string","minLength":1,"maxLength":300}},"required":["vendor","event"]},"minItems":1,"maxItems":100}},"required":["label","members"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"assigned":{"type":"number"}},"required":["ok","assigned"]}}}}}}},"/v1/insights/labels/conversion":{"post":{"tags":["Insights"],"summary":"Mark or unmark a label bucket as a conversion","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"conversion":{"type":"boolean"}},"required":["label","conversion"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]}}}}}}},"/v1/insights/labels/confirm":{"post":{"tags":["Insights"],"summary":"Confirm an AI-proposed label bucket — locks it against relabelling","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["event","key"],"default":"event"}},"required":["label"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"locked":{"type":"number"}},"required":["locked"]}}}}}}},"/v1/insights/labels/health":{"get":{"tags":["Insights"],"summary":"Trend health of event-label buckets: diverging members (bug candidates) + trend-matched suggestions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelsHealth"}}}}}}},"/v1/insights/labels/rename":{"post":{"tags":["Insights"],"summary":"Rename or recolor a label across every member event","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":80},"to":{"type":"string","nullable":true,"maxLength":80},"color":{"type":"string","nullable":true,"pattern":"^#[0-9a-fA-F]{6}$"},"kind":{"type":"string","enum":["event","key"],"default":"event"}},"required":["from","to"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]}}}}}}},"/v1/coverage/sitemap":{"post":{"tags":["Coverage"],"summary":"Import the expected page surface: fetch sitemap.xml or accept an uploaded path list","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domainId":{"type":"string","minLength":1},"paths":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":500}},"required":["domainId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"imported":{"type":"number"}},"required":["imported"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Sitemap unreachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/coverage":{"get":{"tags":["Coverage"],"summary":"Presence matrix: expected pages × vendors, with unmonitored pages surfaced","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"domainId","in":"query"},{"schema":{"type":"integer","minimum":24,"maximum":336,"default":168},"required":false,"name":"hours","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoverageMatrix"}}}},"503":{"description":"Warehouse unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audit/run":{"post":{"tags":["Audit"],"summary":"Run an audit pass: scan the domain's key pages, refresh page_scans, file findings","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domainId":{"type":"string","minLength":1},"paths":{"type":"array","items":{"type":"string","maxLength":300},"maxItems":8}},"required":["domainId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRun"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Browser Rendering unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audit":{"get":{"tags":["Audit"],"summary":"Latest audit results per page (piggyback tree + cookies + policy status)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"domainId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditResults"}}}}}}},"/v1/audits/estimate":{"get":{"tags":["Audits"],"summary":"Pre-flight: how many pages a run would consume vs the monthly budget","parameters":[{"schema":{"type":"string"},"required":false,"name":"domainId","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"fetchSitemap","in":"query"},{"schema":{"type":"string","maxLength":500,"format":"uri"},"required":false,"name":"sitemapUrl","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEstimate"}}}}}}},"/v1/audits":{"post":{"tags":["Audits"],"summary":"Create and start an audit run","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRunInput"}}}},"responses":{"201":{"description":"Started","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["property","url","campaign"]},"tier":{"type":"string","enum":["simple","advanced"]},"status":{"type":"string","enum":["queued","running","done","error","canceled"]},"name":{"type":"string","nullable":true},"startedBy":{"type":"string","nullable":true},"targetHost":{"type":"string","nullable":true},"domainId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"pagesRequested":{"type":"number"},"pagesScanned":{"type":"number"},"pagesErrored":{"type":"number"},"issuesFiled":{"type":"number"},"summary":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"shared":{"type":"boolean"},"error":{"type":"string","nullable":true},"createdAt":{"type":"number"},"finishedAt":{"type":"number","nullable":true}},"required":["id","kind","tier","status","name","startedBy","targetHost","domainId","domain","pagesRequested","pagesScanned","pagesErrored","issuesFiled","summary","shared","error","createdAt","finishedAt"]}}}},"400":{"description":"Bad target","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Over the monthly page budget (send overage: true to consent)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"pages":{"type":"number"},"remaining":{"type":"number"},"budget":{"type":"number"}},"required":["error","pages","remaining","budget"]}}}},"404":{"description":"Domain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Browser Rendering unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Audits"],"summary":"List audit runs","parameters":[{"schema":{"type":"string"},"required":false,"name":"domainId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["property","url","campaign"]},"tier":{"type":"string","enum":["simple","advanced"]},"status":{"type":"string","enum":["queued","running","done","error","canceled"]},"name":{"type":"string","nullable":true},"startedBy":{"type":"string","nullable":true},"targetHost":{"type":"string","nullable":true},"domainId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"pagesRequested":{"type":"number"},"pagesScanned":{"type":"number"},"pagesErrored":{"type":"number"},"issuesFiled":{"type":"number"},"summary":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"shared":{"type":"boolean"},"error":{"type":"string","nullable":true},"createdAt":{"type":"number"},"finishedAt":{"type":"number","nullable":true}},"required":["id","kind","tier","status","name","startedBy","targetHost","domainId","domain","pagesRequested","pagesScanned","pagesErrored","issuesFiled","summary","shared","error","createdAt","finishedAt"]}},"simple":{"type":"object","properties":{"budget":{"type":"number"},"used":{"type":"number"}},"required":["budget","used"]},"advanced":{"type":"object","properties":{"budget":{"type":"number"},"used":{"type":"number"}},"required":["budget","used"]}},"required":["runs","simple","advanced"]}}}}}}},"/v1/audits/changes":{"get":{"tags":["Audits"],"summary":"What changed between the last two completed audits of a property","parameters":[{"schema":{"type":"string"},"required":true,"name":"domainId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditChanges"}}}}}}},"/v1/audits/{id}":{"get":{"tags":["Audits"],"summary":"Audit run with findings (the report data)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRunDetail"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audits/{id}/screenshots/{idx}":{"get":{"tags":["Audits"],"summary":"Page screenshot captured during the run (JPEG)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"idx","in":"path"}],"responses":{"200":{"description":"JPEG","content":{"image/jpeg":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audits/{id}/cancel":{"post":{"tags":["Audits"],"summary":"Cancel a running audit","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audits/{id}/share":{"post":{"tags":["Audits"],"summary":"Mint (or revoke) the public share link for a finished run","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"revoke":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","nullable":true}},"required":["url"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Run not finished","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audits/schedules":{"get":{"tags":["Audits"],"summary":"List audit schedules","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"config":{"type":"object","additionalProperties":{"nullable":true}},"frequency":{"type":"string","enum":["daily","weekly"]},"hourUtc":{"type":"number"},"weekday":{"type":"number"},"enabled":{"type":"boolean"},"lastRunAt":{"type":"number","nullable":true},"lastResult":{"type":"string","nullable":true},"createdAt":{"type":"number"}},"required":["id","name","config","frequency","hourUtc","weekday","enabled","lastRunAt","lastResult","createdAt"]}}},"required":["schedules"]}}}}}},"post":{"tags":["Audits"],"summary":"Create an audit schedule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditScheduleInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"config":{"type":"object","additionalProperties":{"nullable":true}},"frequency":{"type":"string","enum":["daily","weekly"]},"hourUtc":{"type":"number"},"weekday":{"type":"number"},"enabled":{"type":"boolean"},"lastRunAt":{"type":"number","nullable":true},"lastResult":{"type":"string","nullable":true},"createdAt":{"type":"number"}},"required":["id","name","config","frequency","hourUtc","weekday","enabled","lastRunAt","lastResult","createdAt"]}}}},"400":{"description":"Bad target","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audits/schedules/{id}":{"patch":{"tags":["Audits"],"summary":"Enable/disable an audit schedule","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Audits"],"summary":"Delete an audit schedule","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows":{"post":{"tags":["Flows"],"summary":"Create a flow test from a prompt and start a recording run","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"prompt":{"type":"string","minLength":8,"maxLength":2000},"variables":{"type":"object","additionalProperties":{"type":"string","maxLength":500}},"domainId":{"type":"string"},"startUrl":{"type":"string","format":"uri"},"provider":{"type":"string","enum":["cloudflare","browserbase"]},"regions":{"type":"array","items":{"type":"string","enum":["us-west-2","us-east-1","eu-central-1","ap-southeast-1"]},"maxItems":4},"proxies":{"type":"boolean"}},"required":["prompt"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"$ref":"#/components/schemas/FlowTest"},"run":{"$ref":"#/components/schemas/FlowRun"}},"required":["test","run"]}}}},"403":{"description":"Advanced-run tier not enabled for this org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Flows worker unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Flows"],"summary":"List flow tests with their latest run","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tests":{"type":"array","items":{"$ref":"#/components/schemas/FlowTest"}}},"required":["tests"]}}}}}}},"/v1/flows/reports":{"get":{"tags":["Flows"],"summary":"Runs with reports across all flow tests, with share state","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reports":{"type":"array","items":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/FlowRun"},"testName":{"type":"string"},"headline":{"type":"string","nullable":true},"shares":{"type":"array","items":{"$ref":"#/components/schemas/FlowReportShare"}}},"required":["run","testName","headline","shares"]}}},"required":["reports"]}}}}}}},"/v1/flows/variables":{"get":{"tags":["Flows"],"summary":"Saved flow variables visible to the caller (secrets as hints only)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/FlowVariable"}}},"required":["variables"]}}}}}},"post":{"tags":["Flows"],"summary":"Save a flow variable or secret (secret values are write-only)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"handle":{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},"kind":{"type":"string","enum":["variable","secret"]},"scope":{"type":"string","enum":["user","project","org"]},"value":{"type":"string","minLength":1,"maxLength":500},"projectId":{"type":"string"}},"required":["handle","kind","scope","value"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"variable":{"$ref":"#/components/schemas/FlowVariable"}},"required":["variable"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions for this scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Handle already exists in this scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Secrets unavailable (FLOWS_VAR_KEK not set)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/variables/{varId}":{"put":{"tags":["Flows"],"summary":"Replace a saved variable value (secrets re-encrypt; scope/kind immutable)","parameters":[{"schema":{"type":"string"},"required":true,"name":"varId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":500}},"required":["value"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"variable":{"$ref":"#/components/schemas/FlowVariable"}},"required":["variable"]}}}},"403":{"description":"Insufficient permissions for this scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Secrets unavailable (FLOWS_VAR_KEK not set)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Flows"],"summary":"Delete a saved flow variable","parameters":[{"schema":{"type":"string"},"required":true,"name":"varId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Insufficient permissions for this scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/{id}":{"get":{"tags":["Flows"],"summary":"Flow test detail with version history","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"$ref":"#/components/schemas/FlowTest"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/FlowVersion"}}},"required":["test","versions"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Flows"],"summary":"Update a flow test (rename, set or clear its monitor schedule)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"schedule":{"$ref":"#/components/schemas/FlowSchedule"},"provider":{"type":"string","enum":["cloudflare","browserbase"]},"regions":{"type":"array","items":{"type":"string","enum":["us-west-2","us-east-1","eu-central-1","ap-southeast-1"]},"maxItems":4},"proxies":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"schedule":{"$ref":"#/components/schemas/FlowSchedule"},"nextRunAt":{"type":"number","nullable":true}},"required":["ok","schedule","nextRunAt"]}}}},"403":{"description":"Advanced-run tier not enabled for this org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Flows"],"summary":"Archive a flow test","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/{id}/run":{"post":{"tags":["Flows"],"summary":"Start a deterministic replay run of the active version (advanced runs: one run per location)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/FlowRun"},"runs":{"type":"array","items":{"$ref":"#/components/schemas/FlowRun"}}},"required":["run","runs"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"No active version to replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Flows worker unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/{id}/runs":{"get":{"tags":["Flows"],"summary":"Run history for a flow test","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/FlowRun"}}},"required":["runs"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/runs/{runId}":{"get":{"tags":["Flows"],"summary":"Run status + report + progress events (poll with ?since=<seq>)","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"since","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/FlowRun"},"test":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"prompt":{"type":"string"},"targetDomain":{"type":"string","nullable":true}},"required":["name","prompt","targetDomain"]},"report":{"type":"object","nullable":true,"properties":{},"additionalProperties":{"nullable":true}},"artifacts":{"type":"object","nullable":true,"properties":{"screenshots":{"type":"array","items":{"type":"string"}}},"required":["screenshots"]},"events":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"number"},"ts":{"type":"number"},"type":{"type":"string"}},"required":["seq","ts","type"],"additionalProperties":{"nullable":true}}},"latestSeq":{"type":"number"},"liveStatus":{"type":"string","nullable":true}},"required":["run","test","report","artifacts","events","latestSeq","liveStatus"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Flows"],"summary":"Delete a run and its report (artifacts + share links included)","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Run is still active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/runs/{runId}/share":{"post":{"tags":["Flows"],"summary":"Create a public share link for a run report (token returned once)","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expiresInDays":{"type":"integer","nullable":true,"minimum":1,"maximum":365}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"share":{"$ref":"#/components/schemas/FlowReportShare"},"token":{"type":"string"},"path":{"type":"string"}},"required":["share","token","path"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Run has no report yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/runs/{runId}/shares":{"get":{"tags":["Flows"],"summary":"List share links for a run (hashes only — tokens are never stored)","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"shares":{"type":"array","items":{"$ref":"#/components/schemas/FlowReportShare"}}},"required":["shares"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/shares/{shareId}":{"delete":{"tags":["Flows"],"summary":"Revoke a share link (the public URL stops resolving immediately)","parameters":[{"schema":{"type":"string"},"required":true,"name":"shareId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}