{"openapi":"3.1.0","info":{"title":"TagSpy REST API","version":"1.0.0","description":"Register GA4 / Firebase / Tag Manager properties, trigger scans, inspect any ID without tracking it, read snapshots and diffs, and manage alert channels.\n\nSingle action-routed endpoint: every operation is selected with the `action` query parameter. Authenticate with a revocable API key (My alerts, Developer access). Requires an active Spy or Agency plan, except `health`, `inspect`, `gtm.inspect` and `resolve`, which work on every plan. Read-only actions also accept GET.\n\nFair use per account: 60 requests/minute, 2000 requests/day, 60 scans/hour. Unversioned; evolves additively.","contact":{"name":"TagSpy support","url":"https://tagspy.io/support"}},"servers":[{"url":"https://tagspy.io/api/v1","description":"This deployment"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Properties"},{"name":"Scanning"},{"name":"Data"},{"name":"Alerts"}],"paths":{"/?action=health":{"get":{"operationId":"health","summary":"Check the key and plan","tags":["Data"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"health"}}],"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=properties":{"get":{"operationId":"listProperties","summary":"List watched properties","tags":["Properties"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"properties"}}],"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"type":"object","properties":{"properties":{"type":"array","items":{"$ref":"#/components/schemas/Property"}}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=property.add":{"post":{"operationId":"addProperty","summary":"Watch a GA4 property or GTM container","tags":["Properties"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"property.add"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Provide one of ga4Id (G-/GT- or a Firebase App ID), containerId or appId.","properties":{"ga4Id":{"type":"string","examples":["G-KN80RDFSQK"]},"containerId":{"type":"string","examples":["GTM-WDC8G6"]},"appId":{"type":"string","examples":["1:261400168171:android:0dbac07695d93817"]},"label":{"type":"string","maxLength":80}}}}}},"responses":{"201":{"description":"Created (or the existing record for an ID already watched)","content":{"application/json":{"schema":{"type":"object","properties":{"property":{"$ref":"#/components/schemas/Property"}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=property.remove":{"post":{"operationId":"removeProperty","summary":"Stop watching a property","tags":["Properties"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"property.remove"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["propertyId"],"properties":{"propertyId":{"type":"string"}}}}}},"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Removed"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=resolve":{"post":{"operationId":"resolveUrl","summary":"Find the GA4 IDs and GTM containers a page loads","tags":["Scanning"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"resolve"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resolution"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=scan":{"post":{"operationId":"scan","summary":"Scan now and store a snapshot if the configuration changed","tags":["Scanning"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"scan"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ga4Id":{"type":"string"},"containerId":{"type":"string"},"appId":{"type":"string"},"propertyId":{"type":"string"},"url":{"type":"string","format":"uri"},"createIfMissing":{"type":"boolean","default":true},"alerts":{"type":"array","maxItems":10,"items":{"type":"object","required":["kind","target"],"properties":{"kind":{"$ref":"#/components/schemas/ChannelKind"},"target":{"type":"string"},"label":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"type":"object","properties":{"property":{"$ref":"#/components/schemas/Property"},"resolution":{"anyOf":[{"$ref":"#/components/schemas/Resolution"},{"type":"null"}]},"scan":{"type":"object","properties":{"snapshotId":{"type":"string"},"changed":{"type":"boolean"},"hash":{"type":"string"},"isFirstSnapshot":{"type":"boolean"},"summary":{"type":"array","items":{"type":"string"},"description":"One line per change; empty when nothing changed or on the first snapshot."}}},"alerts":{"type":"object","properties":{"created":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"errors":{"type":"array","items":{"type":"string"}}}}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=inspect":{"post":{"operationId":"inspect","summary":"Read a GA4 or Firebase configuration without tracking it","tags":["Data"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"inspect"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Provide ga4Id (G-/GT- or a Firebase App ID), appId, containerId or url.","properties":{"ga4Id":{"type":"string"},"appId":{"type":"string"},"containerId":{"type":"string"},"url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"type":"object","properties":{"property_id":{"type":"string"},"platform":{"type":"string","enum":["web","app","gtm"]},"tracked":{"type":"boolean","const":false},"resolution":{"$ref":"#/components/schemas/Resolution"},"config":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=gtm.inspect":{"post":{"operationId":"gtmInspect","summary":"Read a Tag Manager container without tracking it","tags":["Data"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"gtm.inspect"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"containerId":{"type":"string"},"url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"type":"object","properties":{"container_id":{"type":"string"},"platform":{"type":"string","const":"gtm"},"tracked":{"type":"boolean","const":false},"resolution":{"anyOf":[{"$ref":"#/components/schemas/Resolution"},{"type":"null"}]},"container":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=snapshot":{"get":{"operationId":"getSnapshot","summary":"Read a stored snapshot","tags":["Data"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"snapshot"}},{"name":"id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"type":"object","properties":{"snapshot":{"type":"object","properties":{"id":{"type":"string"},"property_id":{"type":"string"},"config_hash":{"type":"string"},"fetched_at":{"type":"string","format":"date-time"},"config_json":{"type":"object","additionalProperties":true}}}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=diff":{"get":{"operationId":"getDiff","summary":"Diff a snapshot against the previous one","tags":["Data"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"diff"}},{"name":"snapshotId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/SnapshotRef"},{"type":"null"}]},"to":{"$ref":"#/components/schemas/SnapshotRef"},"report":{"$ref":"#/components/schemas/DiffReport"}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=alert.list":{"get":{"operationId":"listAlerts","summary":"List alert channels","tags":["Alerts"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"alert.list"}}],"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=alert.add":{"post":{"operationId":"addAlert","summary":"Add an alert channel","tags":["Alerts"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"alert.add"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","target"],"properties":{"kind":{"$ref":"#/components/schemas/ChannelKind"},"target":{"type":"string"},"label":{"type":"string"},"propertyId":{"type":"string"}}}}}},"responses":{"201":{"description":"Created (or the existing record for an ID already watched)","content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/Channel"}}}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/?action=alert.remove":{"post":{"operationId":"removeAlert","summary":"Remove an alert channel","tags":["Alerts"],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","const":"alert.remove"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{"description":"Operation result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Removed"}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan does not include this (no API access, property limit, channel)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-site request with a session cookie; use an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"A state-changing action was sent as GET","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target cannot be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream Google file could not be fetched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream Google file timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from My alerts, Developer access."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Removed":{"type":"object","properties":{"removed":{"type":"boolean"}}},"ChannelKind":{"type":"string","enum":["email","slack","teams","webhook"]},"Health":{"type":"object","properties":{"ok":{"type":"boolean"},"user":{"type":"string","format":"uuid"},"email":{"type":"string"},"plan":{"type":"string","enum":["mission","spy","agency"]},"superadmin":{"type":"boolean"},"version":{"type":"string"}}},"Property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"property_id":{"type":"string","examples":["G-KN80RDFSQK"]},"platform":{"type":"string","enum":["web","app","gtm"]},"label":{"type":["string","null"]},"scan_frequency":{"type":"string","enum":["daily","hourly"]},"last_scanned_at":{"type":["string","null"],"format":"date-time"},"last_change_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"snapshot_count":{"type":"integer"}}},"Channel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"$ref":"#/components/schemas/ChannelKind"},"target":{"type":"string"},"label":{"type":["string","null"]},"active":{"type":"boolean","description":"False while an email address other than your own waits for its recipient to confirm."},"property_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}},"SnapshotRef":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fetched_at":{"type":"string","format":"date-time"},"version":{"type":["string","null"]},"config_hash":{"type":"string"}}},"DiffChange":{"type":"object","properties":{"path":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["added","removed","modified"]},"value":{},"before":{},"after":{}}},"DiffReport":{"type":"object","properties":{"platform":{"type":"string","enum":["web","app","gtm"]},"identical":{"type":"boolean"},"summary":{"type":"array","items":{"type":"string"}},"added":{"type":"array","items":{"$ref":"#/components/schemas/DiffChange"}},"removed":{"type":"array","items":{"$ref":"#/components/schemas/DiffChange"}},"modified":{"type":"array","items":{"$ref":"#/components/schemas/DiffChange"}}}},"Resolution":{"type":"object","properties":{"url":{"type":"string"},"final_url":{"type":"string"},"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"}}}},"containers":{"type":"array","items":{"type":"string"}},"error":{"type":["string","null"]}}}}}}