{"openapi":"3.1.0","info":{"title":"OpenstatX API","version":"v1","description":"Standalone website analytics service (classic reports). Two ledgers: browser behavior and HTTP requests; five visitor classes (human_likely / ai_verified / ai_claimed / other_automation / unknown). Data is private by default; the Site ID is a public write identifier and cannot read data. All responses use the { data, meta, pagination } envelope; errors use { error: { code, message, request_id, retryable } }."},"servers":[{"url":"https://openstatx.com"}],"paths":{"/api/v1/workspaces":{"post":{"operationId":"createWorkspace","summary":"Create an anonymous workspace and first site","description":"No sign-up: entering a domain creates a persistent anonymous workspace, a dedicated site and a secure session. The recovery key appears only once, in this response. programmatic mode sets no cookie and returns a short-lived, restricted bootstrap token.\n\nRate limit: 30 requests per IP per hour (returns 429 with retry-after when exceeded)","tags":["Bootstrap"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":253},"name":{"type":"string","maxLength":80},"timezone":{"type":"string","maxLength":64},"privacy_mode":{"type":"string","enum":["basic","consented"]},"client":{"default":"browser","type":"string","enum":["browser","programmatic"]},"turnstile_token":{"type":"string","maxLength":4096}},"required":["domain"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"site":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"display_domain":{"type":"string"},"hosts":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"include_subdomains":{"type":"boolean"}},"required":["host","include_subdomains"],"additionalProperties":false}},"timezone":{"type":"string"},"privacy_mode":{"type":"string","enum":["basic","consented"]},"status":{"type":"string","enum":["active","disabled"]},"verification_status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"collection_status":{"type":"string","enum":["not_installed","browser_events_received","edge_events_received","error","disabled"]},"group_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_demo":{"type":"boolean"}},"required":["id","name","domain","display_domain","hosts","timezone","privacy_mode","status","verification_status","collection_status","group_ids","created_at","updated_at","version","is_demo"],"additionalProperties":false},"recovery_key":{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"shown_once":{"type":"boolean","const":true},"guidance":{"type":"string"}},"required":["value","prefix","shown_once","guidance"],"additionalProperties":false},"session":{"type":"object","properties":{"established":{"type":"boolean"},"expires_at":{"type":["string","null"]}},"required":["established","expires_at"],"additionalProperties":false},"bootstrap_token":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string"},"note":{"type":"string"}},"required":["value","prefix","scopes","expires_at","note"],"additionalProperties":false},{"type":"null"}]},"install":{"type":"object","properties":{"site_id":{"type":"string"},"public_site_id_note":{"type":"string"},"script_snippet":{"type":"string"},"czc_compat_snippet":{"type":"string"},"edge_adapter_example":{"type":"string"},"server_collect_example":{"type":"string"},"verification_status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"collection":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"status":{"type":"string"},"first_seen_at":{"type":["string","null"]},"last_seen_at":{"type":["string","null"]},"events_accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"type":["string","null"]}},"required":["status","first_seen_at","last_seen_at","events_accepted","last_error"],"additionalProperties":false}},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ok":{"type":["boolean","null"]},"message":{"type":"string"}},"required":["id","ok","message"],"additionalProperties":false}}},"required":["site_id","public_site_id_note","script_snippet","czc_compat_snippet","edge_adapter_example","server_collect_example","verification_status","collection","checks"],"additionalProperties":false}},"required":["workspace","site","recovery_key","session","bootstrap_token","install"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[]}},"/api/v1/workspace-recovery":{"post":{"operationId":"recoverWorkspace","summary":"Restore workspace with recovery key","description":"Establishes a new session on a new device using the recovery key (always issues a new session ID to prevent session fixation). An incorrect key returns a generic error and does not reveal whether the workspace exists.\n\nRate limit: 20 per IP per hour (returns 429 with retry-after when exceeded)","tags":["Bootstrap"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recovery_key":{"type":"string","minLength":10,"maxLength":200},"device_label":{"type":"string","maxLength":80},"turnstile_token":{"type":"string","maxLength":4096}},"required":["recovery_key"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"workspace_id":{"type":"string"},"session_expires_at":{"type":"string"}},"required":["workspace_id","session_expires_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[]}},"/api/v1/member-invites/accept":{"post":{"operationId":"acceptMemberInvite","summary":"Accept member invitation","description":"Join a workspace with a one-time, short-lived invite token and obtain an independent device session (the owner's recovery key is never provided).\n\nRate limit: 20 requests per IP per hour (returns 429 with retry-after when exceeded)","tags":["Members"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invite_token":{"type":"string","minLength":10,"maxLength":200},"device_label":{"type":"string","maxLength":80}},"required":["invite_token"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"workspace_id":{"type":"string"},"member_id":{"type":"string"},"role":{"type":"string"}},"required":["workspace_id","member_id","role"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[]}},"/api/v1/schema/metrics":{"get":{"operationId":"getMetricSchema","summary":"Metric dictionary","description":"Machine-readable metric definitions: definition, unit, additivity, deduplication scope, privacy prerequisites, version.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/schema/dimensions":{"get":{"operationId":"getDimensionSchema","summary":"Dimension dictionary","description":"Available dimensions, applicable datasets, high-cardinality flags and privacy prerequisites.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/schema/reports":{"get":{"operationId":"getReportSchema","summary":"Report catalog","description":"Metrics, dimensions, required scopes and corresponding REST/MCP calls for each report.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/capabilities/public":{"get":{"operationId":"getPublicCapabilities","summary":"Public capability table","description":"implemented/enabled/configured/available/reason/limits/retention; contains no private data.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[]}},"/api/v1/demo/session":{"post":{"operationId":"enterDemo","summary":"Enter isolated demo","description":"Enters a fixed read-only demo workspace (sample data, clearly labeled). Returns a read-only demo token valid for 2 hours; sets no cookie and does not affect the current real workspace session.\n\nRate limit: 30 per IP per hour (returns 429 with retry-after when exceeded)","tags":["Bootstrap"],"parameters":[],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"demo":{"type":"boolean","const":true},"notice":{"type":"string"},"workspace_id":{"type":"string"},"site":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"display_domain":{"type":"string"},"hosts":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"include_subdomains":{"type":"boolean"}},"required":["host","include_subdomains"],"additionalProperties":false}},"timezone":{"type":"string"},"privacy_mode":{"type":"string","enum":["basic","consented"]},"status":{"type":"string","enum":["active","disabled"]},"verification_status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"collection_status":{"type":"string","enum":["not_installed","browser_events_received","edge_events_received","error","disabled"]},"group_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_demo":{"type":"boolean"}},"required":["id","name","domain","display_domain","hosts","timezone","privacy_mode","status","verification_status","collection_status","group_ids","created_at","updated_at","version","is_demo"],"additionalProperties":false},"token":{"type":"object","properties":{"value":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string"}},"required":["value","scopes","expires_at"],"additionalProperties":false}},"required":["demo","notice","workspace_id","site","token"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[]}},"/api/v1/workspace":{"get":{"operationId":"getWorkspace","summary":"Current workspace","description":"Returns the workspace the current credential belongs to and the caller's identity/permissions.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: discover_analytics","tags":["Workspace"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tier":{"type":"string","enum":["unverified","verified"]},"default_timezone":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"is_demo":{"type":"boolean"},"site_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["session","api_credential","oauth"]},"role":{"anyOf":[{"type":"string","enum":["owner","admin","analyst","viewer"]},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"}},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"member_id":{"type":["string","null"]},"reauthenticated_until":{"type":["string","null"]}},"required":["type","role","scopes","site_ids","member_id"],"additionalProperties":false}},"required":["id","name","tier","default_timezone","created_at","updated_at","is_demo","site_count","principal"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":[]},{"sessionCookie":[]}],"x-openstatx-auth":"principal","x-openstatx-scopes":[],"x-mcp-tools":["discover_analytics"]},"patch":{"operationId":"updateWorkspace","summary":"Update workspace","description":"Update name and default time zone.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"default_timezone":{"type":"string","maxLength":64}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tier":{"type":"string","enum":["unverified","verified"]},"default_timezone":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"is_demo":{"type":"boolean"},"site_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["session","api_credential","oauth"]},"role":{"anyOf":[{"type":"string","enum":["owner","admin","analyst","viewer"]},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"}},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"member_id":{"type":["string","null"]},"reauthenticated_until":{"type":["string","null"]}},"required":["type","role","scopes","site_ids","member_id"],"additionalProperties":false}},"required":["id","name","tier","default_timezone","created_at","updated_at","is_demo","site_count","principal"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"]}},"/api/v1/workspace/reauth":{"post":{"operationId":"reauthenticate","summary":"Recent strong authentication","description":"Re-enter the recovery key to obtain a 10-minute strong authentication window for high-risk actions such as deletion, shortening retention, or making private data public.\n\nRate limit: 20 per IP per hour (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recovery_key":{"type":"string","minLength":10,"maxLength":200}},"required":["recovery_key"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"reauthenticated_until":{"type":"string"}},"required":["reauthenticated_until"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-openstatx-auth":"session","x-openstatx-scopes":[]}},"/api/v1/workspace/sessions":{"get":{"operationId":"listWorkspaceSessions","summary":"Sessions","description":"List browser sessions in this workspace (no tokens included).\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"device_label":{"type":["string","null"]},"created_at":{"type":"string"},"last_seen_at":{"type":"string"},"expires_at":{"type":"string"},"revoked_at":{"type":["string","null"]},"current":{"type":"boolean"},"auth_method":{"type":"string"},"member_id":{"type":["string","null"]},"role":{"type":"string","enum":["owner","admin","analyst","viewer"]}},"required":["id","device_label","created_at","last_seen_at","expires_at","revoked_at","current","auth_method","member_id","role"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-openstatx-auth":"session","x-openstatx-scopes":[]}},"/api/v1/workspace/sessions/{id}":{"get":{"operationId":"getWorkspaceSession","summary":"Session details","description":"Single session information. id=current refers to the current session.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"device_label":{"type":["string","null"]},"created_at":{"type":"string"},"last_seen_at":{"type":"string"},"expires_at":{"type":"string"},"revoked_at":{"type":["string","null"]},"current":{"type":"boolean"},"auth_method":{"type":"string"},"member_id":{"type":["string","null"]},"role":{"type":"string","enum":["owner","admin","analyst","viewer"]}},"required":["id","device_label","created_at","last_seen_at","expires_at","revoked_at","current","auth_method","member_id","role"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-openstatx-auth":"session","x-openstatx-scopes":[]},"delete":{"operationId":"revokeWorkspaceSession","summary":"Revoke session/sign out","description":"Revokes the specified session; id=current logs out.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-openstatx-auth":"session","x-openstatx-scopes":[]}},"/api/v1/workspace/sessions/revoke-all":{"post":{"operationId":"revokeAllSessions","summary":"Invalidate all sessions","description":"Immediately invalidate all sessions (or all except the current one).\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keep_current":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"revoked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["revoked"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-openstatx-auth":"session","x-openstatx-scopes":[]}},"/api/v1/workspace/recovery/rotate":{"post":{"operationId":"rotateRecoveryKey","summary":"Rotate recovery key","description":"Generates a new recovery key (shown only once); the old key is invalidated immediately and retained for audit; existing sessions are handled per session_policy. Available only to owner sessions.\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_policy":{"default":"all_other","type":"string","enum":["all_other","all","keep"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"recovery_key":{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"shown_once":{"type":"boolean","const":true}},"required":["value","prefix","shown_once"],"additionalProperties":false},"sessions_revoked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["recovery_key","sessions_revoked"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"session","x-openstatx-scopes":["credentials:admin"]}},"/api/v1/credentials":{"get":{"operationId":"listCredentials","summary":"API/collection credential list","description":"Shows only prefix, name, permissions and created/last-used time; never re-exposes the full credential.\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Grants"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["read_api","ingest"]},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"access_window":{"anyOf":[{"type":"object","properties":{"max_range_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"not_before_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["max_range_days","not_before_days"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"expires_at":{"type":["string","null"]},"last_used_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"created_by":{"type":["string","null"]}},"required":["id","kind","name","prefix","scopes","site_ids","access_window","created_at","expires_at","last_used_at","revoked_at","created_by"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["credentials:admin"]},"post":{"operationId":"createCredential","summary":"Create credential","description":"Create a restricted read-only API credential (bound to scopes, site_ids, validity period and access window) or a write-only collection credential. The full value is returned only once.\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Grants"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"default":"read_api","type":"string","enum":["read_api","ingest"]},"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"default":["summary:read"],"maxItems":20,"type":"array","items":{"type":"string","enum":["summary:read","details:read","conversions:read","revenue:read","exports:write","imports:write","sites:write","settings:write","reports:write","shares:write","members:admin","credentials:admin","audit:read","usage:read"]}},"site_ids":{"default":null,"anyOf":[{"maxItems":1000,"type":"array","items":{"type":"string"}},{"type":"null"}]},"expires_in_days":{"default":90,"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"access_window":{"anyOf":[{"type":"object","properties":{"max_range_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":400},{"type":"null"}]},"not_before_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]}},"required":["max_range_days","not_before_days"]},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"credential":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["read_api","ingest"]},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"access_window":{"anyOf":[{"type":"object","properties":{"max_range_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"not_before_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["max_range_days","not_before_days"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"expires_at":{"type":["string","null"]},"last_used_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"created_by":{"type":["string","null"]}},"required":["id","kind","name","prefix","scopes","site_ids","access_window","created_at","expires_at","last_used_at","revoked_at","created_by"],"additionalProperties":false},"secret":{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"shown_once":{"type":"boolean","const":true}},"required":["value","prefix","shown_once"],"additionalProperties":false},"signing_secret":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"shown_once":{"type":"boolean","const":true}},"required":["value","prefix","shown_once"],"additionalProperties":false},{"type":"null"}]}},"required":["credential","secret","signing_secret"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["credentials:admin"]}},"/api/v1/credentials/{id}":{"delete":{"operationId":"revokeCredential","summary":"Revoke credential","description":"Invalidated immediately; in-progress exports are also blocked.\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Grants"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["credentials:admin"]}},"/api/v1/credentials/{id}/rotate":{"post":{"operationId":"rotateCredential","summary":"Rotate credential","description":"Issues a new value and revokes the old one; permissions unchanged.\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Grants"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"credential":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["read_api","ingest"]},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"access_window":{"anyOf":[{"type":"object","properties":{"max_range_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"not_before_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["max_range_days","not_before_days"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"expires_at":{"type":["string","null"]},"last_used_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"created_by":{"type":["string","null"]}},"required":["id","kind","name","prefix","scopes","site_ids","access_window","created_at","expires_at","last_used_at","revoked_at","created_by"],"additionalProperties":false},"secret":{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"shown_once":{"type":"boolean","const":true}},"required":["value","prefix","shown_once"],"additionalProperties":false},"signing_secret":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"shown_once":{"type":"boolean","const":true}},"required":["value","prefix","shown_once"],"additionalProperties":false},{"type":"null"}]}},"required":["credential","secret","signing_secret"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["credentials:admin"]}},"/api/v1/grants":{"get":{"operationId":"listGrants","summary":"Grant list","description":"OAuth client grants, credential add-on grants, and member grants.\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Grants"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subject_type":{"type":"string","enum":["oauth_client","credential","member"]},"subject_id":{"type":"string"},"client_name":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string"},"expires_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}},"required":["id","subject_type","subject_id","client_name","scopes","site_ids","created_at","expires_at","revoked_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["credentials:admin"]},"post":{"operationId":"createGrant","summary":"Add grant to credential","description":"Adds scopes to a credential within the grantor's permissions (cannot exceed the grantor's own permissions).\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Grants"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject_type":{"type":"string","const":"credential"},"subject_id":{"type":"string"},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["summary:read","details:read","conversions:read","revenue:read","exports:write","imports:write","sites:write","settings:write","reports:write","shares:write","members:admin","credentials:admin","audit:read","usage:read"]}},"site_ids":{"default":null,"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"expires_in_days":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]}},"required":["subject_type","subject_id","scopes"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"subject_type":{"type":"string","enum":["oauth_client","credential","member"]},"subject_id":{"type":"string"},"client_name":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string"},"expires_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}},"required":["id","subject_type","subject_id","client_name","scopes","site_ids","created_at","expires_at","revoked_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["credentials:admin"]}},"/api/v1/grants/{id}":{"delete":{"operationId":"revokeGrant","summary":"Revoke grant","description":"Revoking an OAuth grant also revokes its access and refresh tokens.\n\nRequired scope: `credentials:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Grants"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["credentials:admin"]}},"/api/v1/members":{"get":{"operationId":"listMembers","summary":"Member list","description":"Members and roles.\n\nRequired scope: `members:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Members"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"display_name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","analyst","viewer"]},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"status":{"type":"string","enum":["invited","active","revoked"]},"created_at":{"type":"string"},"joined_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}},"required":["id","display_name","role","site_ids","status","created_at","joined_at","revoked_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["members:admin"]},{"sessionCookie":["members:admin"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["members:admin"]},"post":{"operationId":"createMember","summary":"Invite member","description":"Generates a single-use invitation token valid for 24 hours; members use their own device identity and never receive the owner's recovery key.\n\nRequired scope: `members:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Members"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":80},"role":{"type":"string","enum":["admin","analyst","viewer"]},"site_ids":{"default":null,"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["display_name","role"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"display_name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","analyst","viewer"]},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"status":{"type":"string","enum":["invited","active","revoked"]},"created_at":{"type":"string"},"joined_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}},"required":["id","display_name","role","site_ids","status","created_at","joined_at","revoked_at"],"additionalProperties":false},"invite":{"type":"object","properties":{"value":{"type":"string"},"prefix":{"type":"string"},"shown_once":{"type":"boolean","const":true}},"required":["value","prefix","shown_once"],"additionalProperties":false},"invite_url":{"type":"string"}},"required":["member","invite","invite_url"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["members:admin"]}],"x-openstatx-auth":"session","x-openstatx-scopes":["members:admin"]}},"/api/v1/members/{id}":{"patch":{"operationId":"updateMember","summary":"Change member role","description":"Downgrades take effect immediately (permissions of existing sessions are evaluated under the new role on the next request).\n\nRequired scope: `members:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Members"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","analyst","viewer"]},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"display_name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","analyst","viewer"]},"site_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"status":{"type":"string","enum":["invited","active","revoked"]},"created_at":{"type":"string"},"joined_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}},"required":["id","display_name","role","site_ids","status","created_at","joined_at","revoked_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["members:admin"]}],"x-openstatx-auth":"session","x-openstatx-scopes":["members:admin"]},"delete":{"operationId":"deleteMember","summary":"Remove member","description":"Removes a member and revokes all of their sessions.\n\nRequired scope: `members:admin`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Members"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["members:admin"]}],"x-openstatx-auth":"session","x-openstatx-scopes":["members:admin"]}},"/api/v1/audit-logs":{"get":{"operationId":"listAuditLogs","summary":"Audit log","description":"Audit records (redacted) for identity, authorization, configuration and high-risk actions.\n\nRequired scope: `audit:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Workspace"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actor_type":{"type":"string"},"actor_id":{"type":["string","null"]},"action":{"type":"string"},"target_type":{"type":["string","null"]},"target_id":{"type":["string","null"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"request_id":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","actor_type","actor_id","action","target_type","target_id","details","request_id","created_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["audit:read"]},{"sessionCookie":["audit:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["audit:read"]}},"/api/v1/capabilities":{"get":{"operationId":"getCapabilities","summary":"Capabilities","description":"Capabilities available in the current workspace: implemented/enabled/configured/available/reason/limits/retention.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: discover_analytics","tags":["Workspace"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":[]},{"sessionCookie":[]}],"x-openstatx-auth":"principal","x-openstatx-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/usage":{"get":{"operationId":"getUsage","summary":"Usage","description":"Measured usage per site per day, such as accepted/rejected/duplicate events and query counts; amounts are not shown when no pricing is configured.\n\nRequired scope: `usage:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_usage","tags":["Workspace"],"parameters":[{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["usage:read"]},{"sessionCookie":["usage:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["usage:read"],"x-mcp-tools":["get_usage"]}},"/api/v1/quotas":{"get":{"operationId":"getQuotas","summary":"Quotas","description":"Unverified/verified site quotas and current status (initial values pending load testing).\n\nRequired scope: `usage:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_usage","tags":["Workspace"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["usage:read"]},{"sessionCookie":["usage:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["usage:read"],"x-mcp-tools":["get_usage"]}},"/api/v1/sites":{"get":{"operationId":"listSites","summary":"Site list (multi-site overview)","description":"当前凭证可见的网站，含今日 PV/UV/HTTP/AI 摘要、近 5 分钟实时（with_summary=true）与接入状态。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：list_sites","tags":["Site"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"group_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"with_summary","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["list_sites"]},"post":{"operationId":"createSite","summary":"Add site","description":"Adds a site to the current workspace. Does not reveal whether the domain exists in other workspaces.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: add_site","tags":["Site"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":253},"name":{"type":"string","maxLength":80},"timezone":{"type":"string","maxLength":64},"privacy_mode":{"type":"string","enum":["basic","consented"]},"group_ids":{"maxItems":20,"type":"array","items":{"type":"string"}},"extra_hosts":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"host":{"type":"string","maxLength":253},"include_subdomains":{"default":false,"type":"boolean"}},"required":["host"]}}},"required":["domain"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"display_domain":{"type":"string"},"hosts":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"include_subdomains":{"type":"boolean"}},"required":["host","include_subdomains"],"additionalProperties":false}},"timezone":{"type":"string"},"privacy_mode":{"type":"string","enum":["basic","consented"]},"status":{"type":"string","enum":["active","disabled"]},"verification_status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"collection_status":{"type":"string","enum":["not_installed","browser_events_received","edge_events_received","error","disabled"]},"group_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_demo":{"type":"boolean"}},"required":["id","name","domain","display_domain","hosts","timezone","privacy_mode","status","verification_status","collection_status","group_ids","created_at","updated_at","version","is_demo"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"],"x-mcp-tools":["add_site"]}},"/api/v1/sites/summary":{"get":{"operationId":"getSitesSummary","summary":"Multi-site totals (today's traffic and online now)","description":"当前凭证可见（可按分组/关键字筛选）的全部网站合计：今日 PV、各站 UV 合计、HTTP 请求、AI 请求，以及近 5 分钟实时在线、PV 与请求数。不受分页影响。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：list_sites","tags":["Site"],"parameters":[{"name":"group_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["list_sites"]}},"/api/v1/sites/batch":{"post":{"operationId":"batchCreateSites","summary":"Bulk add sites","description":"Idempotent bulk add (requires Idempotency-Key); returns a result list; failed items can be retried.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Site"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sites":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":253},"name":{"type":"string","maxLength":80},"timezone":{"type":"string","maxLength":64},"privacy_mode":{"type":"string","enum":["basic","consented"]},"group_ids":{"maxItems":20,"type":"array","items":{"type":"string"}},"extra_hosts":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"host":{"type":"string","maxLength":253},"include_subdomains":{"default":false,"type":"boolean"}},"required":["host"]}}},"required":["domain"]}},"continuation_token":{"type":"string","maxLength":200}},"required":["sites"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"batch_id":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"domain":{"type":"string"},"status":{"type":"string","enum":["created","failed","skipped_duplicate_in_batch"]},"site_id":{"type":["string","null"]},"error":{"type":["string","null"]}},"required":["index","domain","status","site_id","error"],"additionalProperties":false}},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["batch_id","results","created","failed"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"]}},"/api/v1/sites/{id}":{"get":{"operationId":"getSite","summary":"Site details","description":"Site configuration and status.\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: list_sites","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"display_domain":{"type":"string"},"hosts":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"include_subdomains":{"type":"boolean"}},"required":["host","include_subdomains"],"additionalProperties":false}},"timezone":{"type":"string"},"privacy_mode":{"type":"string","enum":["basic","consented"]},"status":{"type":"string","enum":["active","disabled"]},"verification_status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"collection_status":{"type":"string","enum":["not_installed","browser_events_received","edge_events_received","error","disabled"]},"group_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_demo":{"type":"boolean"}},"required":["id","name","domain","display_domain","hosts","timezone","privacy_mode","status","verification_status","collection_status","group_ids","created_at","updated_at","version","is_demo"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["list_sites"]},"patch":{"operationId":"updateSite","summary":"Update site","description":"Name, enable/disable, grouping; supports expected_version optimistic concurrency.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"status":{"type":"string","enum":["active","disabled"]},"group_ids":{"maxItems":20,"type":"array","items":{"type":"string"}},"expected_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"display_domain":{"type":"string"},"hosts":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"include_subdomains":{"type":"boolean"}},"required":["host","include_subdomains"],"additionalProperties":false}},"timezone":{"type":"string"},"privacy_mode":{"type":"string","enum":["basic","consented"]},"status":{"type":"string","enum":["active","disabled"]},"verification_status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"collection_status":{"type":"string","enum":["not_installed","browser_events_received","edge_events_received","error","disabled"]},"group_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_demo":{"type":"boolean"}},"required":["id","name","domain","display_domain","hosts","timezone","privacy_mode","status","verification_status","collection_status","group_ids","created_at","updated_at","version","is_demo"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"]},"delete":{"operationId":"deleteSite","summary":"Delete site","description":"Sites with no data can be deleted directly; if data exists, returns ACTION_REQUIRED and the high-risk action flow via /actions/preview is required.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"]}},"/api/v1/groups":{"get":{"operationId":"listGroups","summary":"Site group list","description":"Groups and their member sites.\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Site"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"site_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"}},"required":["id","name","site_ids","created_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"]},"post":{"operationId":"createGroup","summary":"Create group","description":"Create a site group.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Site"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"site_ids":{"default":[],"maxItems":10000,"type":"array","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"site_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"}},"required":["id","name","site_ids","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"]}},"/api/v1/groups/{id}":{"patch":{"operationId":"updateGroup","summary":"Update group","description":"Update name and members.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"site_ids":{"maxItems":10000,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"site_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"}},"required":["id","name","site_ids","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"]},"delete":{"operationId":"deleteGroup","summary":"Delete group","description":"Deletes only the group; sites and data are unaffected.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"]}},"/api/v1/sites/{id}/verification/challenges":{"post":{"operationId":"createVerificationChallenge","summary":"Start site verification","description":"Issues an HTML tag / verification file / DNS TXT verification challenge.\n\nRequired scope: `sites:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: start_site_verification","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["html_tag","file","dns_txt"]}},"required":["method"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["html_tag","file","dns_txt"]},"status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"token":{"type":"string"},"instructions":{"type":"object","properties":{"html_tag":{"type":"string"},"file_path":{"type":"string"},"file_content":{"type":"string"},"dns_name":{"type":"string"},"dns_value":{"type":"string"}},"additionalProperties":false},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_checked_at":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["id","method","status","token","instructions","issued_at","expires_at","verified_at","last_checked_at","last_error"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"],"x-mcp-tools":["start_site_verification"]}},"/api/v1/sites/{id}/verification/checks":{"post":{"operationId":"runVerificationCheck","summary":"Run verification check","description":"Checks by challenge method (active crawl with SSRF protection; DNS via a fixed DoH resolver). Merely receiving events with the site_id does not count as successful verification.\n\nRequired scope: `sites:write`\n\nRate limit: Verification checks: per-credential per-hour limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: check_site_verification","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"challenge_id":{"type":"string"}},"required":["challenge_id"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["html_tag","file","dns_txt"]},"status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"token":{"type":"string"},"instructions":{"type":"object","properties":{"html_tag":{"type":"string"},"file_path":{"type":"string"},"file_content":{"type":"string"},"dns_name":{"type":"string"},"dns_value":{"type":"string"}},"additionalProperties":false},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_checked_at":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["id","method","status","token","instructions","issued_at","expires_at","verified_at","last_checked_at","last_error"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["sites:write"],"x-mcp-tools":["check_site_verification"]}},"/api/v1/sites/{id}/installation":{"get":{"operationId":"getInstallation","summary":"Installation and integration status","description":"JS snippet, _czc-compatible snippet, edge adapter and server-side reporting examples; collection status for each of browser/edge/server/security_logs.\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: check_installation","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"site_id":{"type":"string"},"public_site_id_note":{"type":"string"},"script_snippet":{"type":"string"},"czc_compat_snippet":{"type":"string"},"edge_adapter_example":{"type":"string"},"server_collect_example":{"type":"string"},"verification_status":{"type":"string","enum":["pending","challenge_issued","verified","expired","revoked"]},"collection":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"status":{"type":"string"},"first_seen_at":{"type":["string","null"]},"last_seen_at":{"type":["string","null"]},"events_accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"type":["string","null"]}},"required":["status","first_seen_at","last_seen_at","events_accepted","last_error"],"additionalProperties":false}},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ok":{"type":["boolean","null"]},"message":{"type":"string"}},"required":["id","ok","message"],"additionalProperties":false}}},"required":["site_id","public_site_id_note","script_snippet","czc_compat_snippet","edge_adapter_example","server_collect_example","verification_status","collection","checks"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["check_installation"]}},"/api/v1/sites/{id}/data-quality":{"get":{"operationId":"getDataQuality","summary":"Data quality","description":"Accepted/rejected/duplicate, late and future timestamps, unknown rate, rule version and staleness, coverage (null when there is no denominator).\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_data_quality","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_data_quality"]}},"/api/v1/sites/{id}/settings":{"get":{"operationId":"getSiteSettings","summary":"Site settings","description":"Time zone, privacy mode, routing, property allowlist, page groups, retention settings.\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_site_config","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"site_id":{"type":"string"},"timezone":{"type":"string"},"timezone_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"privacy_mode":{"type":"string","enum":["basic","consented"]},"hash_routing":{"type":"boolean"},"respect_dnt":{"type":"boolean"},"czc_compat":{"type":"boolean"},"allowed_prop_keys":{"type":"array","items":{"type":"string"}},"page_groups":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"prefix":{"type":"string"}},"required":["name","prefix"],"additionalProperties":false}},"excluded_paths":{"type":"array","items":{"type":"string"}},"search_query_params":{"type":"array","items":{"type":"string"}},"sensitive_query_params":{"type":"array","items":{"type":"string"}},"retention":{"type":"object","properties":{"hot_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hourly_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daily_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"identity_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archive_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["hot_days","hourly_days","daily_days","identity_days","archive_days","version"],"additionalProperties":false},"attribution_version":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["site_id","timezone","timezone_version","privacy_mode","hash_routing","respect_dnt","czc_compat","allowed_prop_keys","page_groups","excluded_paths","search_query_params","sensitive_query_params","retention","attribution_version","version"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_site_config"]},"patch":{"operationId":"updateSiteSettings","summary":"Update site settings","description":"Changing time zone/attribution rules records a new version and never silently rewrites historical definitions; shortening the retention period requires a high-risk action.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Site"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string","maxLength":64},"privacy_mode":{"type":"string","enum":["basic","consented"]},"hash_routing":{"type":"boolean"},"respect_dnt":{"type":"boolean"},"czc_compat":{"type":"boolean"},"allowed_prop_keys":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}},"page_groups":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":64},"prefix":{"type":"string","maxLength":256}},"required":["name","prefix"]}},"excluded_paths":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}},"search_query_params":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":32}},"sensitive_query_params":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}},"retention":{"type":"object","properties":{"hot_days":{"type":"integer","minimum":1,"maximum":30},"hourly_days":{"type":"integer","minimum":7,"maximum":400},"daily_days":{"type":"integer","minimum":30,"maximum":3650}}},"expected_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"site_id":{"type":"string"},"timezone":{"type":"string"},"timezone_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"privacy_mode":{"type":"string","enum":["basic","consented"]},"hash_routing":{"type":"boolean"},"respect_dnt":{"type":"boolean"},"czc_compat":{"type":"boolean"},"allowed_prop_keys":{"type":"array","items":{"type":"string"}},"page_groups":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"prefix":{"type":"string"}},"required":["name","prefix"],"additionalProperties":false}},"excluded_paths":{"type":"array","items":{"type":"string"}},"search_query_params":{"type":"array","items":{"type":"string"}},"sensitive_query_params":{"type":"array","items":{"type":"string"}},"retention":{"type":"object","properties":{"hot_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hourly_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daily_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"identity_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archive_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["hot_days","hourly_days","daily_days","identity_days","archive_days","version"],"additionalProperties":false},"attribution_version":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["site_id","timezone","timezone_version","privacy_mode","hash_routing","respect_dnt","czc_compat","allowed_prop_keys","page_groups","excluded_paths","search_query_params","sensitive_query_params","retention","attribution_version","version"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/goals":{"get":{"operationId":"listGoals","summary":"Goal list","description":"Goals (versioned).\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_goals","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["page_view","event","conversion"]},"match":{"type":"object","properties":{"path_prefix":{"type":["string","null"]},"path_exact":{"type":["string","null"]},"event_name":{"type":["string","null"]},"goal_key":{"type":["string","null"]}},"additionalProperties":false},"value_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","site_id","name","type","match","value_minor","currency","version","created_at","updated_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_goals"]},"post":{"operationId":"createGoal","summary":"Create goal","description":"Create goal.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_goals","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["page_view","event","conversion"]},"match":{"type":"object","properties":{"path_prefix":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"path_exact":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"event_name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"goal_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]}}},"value_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]}},"required":["name","type","match"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["page_view","event","conversion"]},"match":{"type":"object","properties":{"path_prefix":{"type":["string","null"]},"path_exact":{"type":["string","null"]},"event_name":{"type":["string","null"]},"goal_key":{"type":["string","null"]}},"additionalProperties":false},"value_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","site_id","name","type","match","value_minor","currency","version","created_at","updated_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_goals"]}},"/api/v1/sites/{id}/goals/{goal_id}":{"patch":{"operationId":"updateGoal","summary":"Update goal","description":"Update goal; version number +1.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_goals","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"goal_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["page_view","event","conversion"]},"match":{"type":"object","properties":{"path_prefix":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"path_exact":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"event_name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"goal_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]}}},"value_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["page_view","event","conversion"]},"match":{"type":"object","properties":{"path_prefix":{"type":["string","null"]},"path_exact":{"type":["string","null"]},"event_name":{"type":["string","null"]},"goal_key":{"type":["string","null"]}},"additionalProperties":false},"value_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","site_id","name","type","match","value_minor","currency","version","created_at","updated_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_goals"]},"delete":{"operationId":"deleteGoal","summary":"Delete goal","description":"Delete goal (the definition version in historical results remains queryable).\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_goals","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"goal_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_goals"]}},"/api/v1/sites/{id}/funnels":{"get":{"operationId":"listFunnels","summary":"Funnel list","description":"Funnels (versioned).\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_funnels","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"type":{"type":"string","enum":["page_view","event"]},"path_prefix":{"type":"string","maxLength":256},"path_exact":{"type":"string","maxLength":256},"event_name":{"type":"string","maxLength":128}},"required":["name","type"],"additionalProperties":false}},"window_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope":{"type":"string","enum":["session","visitor"]},"strict_order":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","site_id","name","steps","window_seconds","scope","strict_order","version","created_at","updated_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_funnels"]},"post":{"operationId":"createFunnel","summary":"Create funnel","description":"Create funnel.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_funnels","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"steps":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"type":{"type":"string","enum":["page_view","event"]},"path_prefix":{"type":"string","maxLength":256},"path_exact":{"type":"string","maxLength":256},"event_name":{"type":"string","maxLength":128}},"required":["name","type"]}},"window_seconds":{"default":86400,"type":"integer","minimum":60,"maximum":2592000},"scope":{"default":"session","type":"string","enum":["session","visitor"]},"strict_order":{"default":true,"type":"boolean"}},"required":["name","steps"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"type":{"type":"string","enum":["page_view","event"]},"path_prefix":{"type":"string","maxLength":256},"path_exact":{"type":"string","maxLength":256},"event_name":{"type":"string","maxLength":128}},"required":["name","type"],"additionalProperties":false}},"window_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope":{"type":"string","enum":["session","visitor"]},"strict_order":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","site_id","name","steps","window_seconds","scope","strict_order","version","created_at","updated_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_funnels"]}},"/api/v1/sites/{id}/funnels/{funnel_id}":{"patch":{"operationId":"updateFunnel","summary":"Update funnel","description":"Update funnel; version number +1.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_funnels","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"funnel_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"steps":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"type":{"type":"string","enum":["page_view","event"]},"path_prefix":{"type":"string","maxLength":256},"path_exact":{"type":"string","maxLength":256},"event_name":{"type":"string","maxLength":128}},"required":["name","type"]}},"window_seconds":{"default":86400,"type":"integer","minimum":60,"maximum":2592000},"scope":{"default":"session","type":"string","enum":["session","visitor"]},"strict_order":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"type":{"type":"string","enum":["page_view","event"]},"path_prefix":{"type":"string","maxLength":256},"path_exact":{"type":"string","maxLength":256},"event_name":{"type":"string","maxLength":128}},"required":["name","type"],"additionalProperties":false}},"window_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope":{"type":"string","enum":["session","visitor"]},"strict_order":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","site_id","name","steps","window_seconds","scope","strict_order","version","created_at","updated_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_funnels"]},"delete":{"operationId":"deleteFunnel","summary":"Delete funnel","description":"Delete funnel (the definition version in historical results remains queryable).\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_funnels","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"funnel_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_funnels"]}},"/api/v1/sites/{id}/filters":{"get":{"operationId":"listFilters","summary":"Filter list","description":"Filters (versioned).\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string","enum":["exclude_path_prefix","exclude_host","exclude_query_param","internal_traffic_cookie"]},"value":{"type":"string"},"created_at":{"type":"string"}},"required":["id","site_id","type","value","created_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_site_config"]},"post":{"operationId":"createFilter","summary":"Create filter","description":"Create filter.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["exclude_path_prefix","exclude_host","exclude_query_param","internal_traffic_cookie"]},"value":{"type":"string","minLength":1,"maxLength":256}},"required":["type","value"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string","enum":["exclude_path_prefix","exclude_host","exclude_query_param","internal_traffic_cookie"]},"value":{"type":"string"},"created_at":{"type":"string"}},"required":["id","site_id","type","value","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/filters/{filter_id}":{"patch":{"operationId":"updateFilter","summary":"Update filter","description":"Update filter; version number +1.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"filter_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["exclude_path_prefix","exclude_host","exclude_query_param","internal_traffic_cookie"]},"value":{"type":"string","minLength":1,"maxLength":256}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string","enum":["exclude_path_prefix","exclude_host","exclude_query_param","internal_traffic_cookie"]},"value":{"type":"string"},"created_at":{"type":"string"}},"required":["id","site_id","type","value","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]},"delete":{"operationId":"deleteFilter","summary":"Delete filter","description":"Delete filter (the definition version in historical results remains queryable).\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"filter_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/custom-dimensions":{"get":{"operationId":"listCustomDimensions","summary":"Custom dimension list","description":"Custom dimensions (versioned).\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"scope":{"type":"string","enum":["event","page"]},"allowed":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","site_id","key","name","scope","allowed","created_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_site_config"]},"post":{"operationId":"createCustomDimension","summary":"Create custom dimension","description":"Create custom dimension.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"name":{"type":"string","minLength":1,"maxLength":80},"scope":{"default":"event","type":"string","enum":["event","page"]},"allowed":{"default":true,"type":"boolean"}},"required":["key","name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"scope":{"type":"string","enum":["event","page"]},"allowed":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","site_id","key","name","scope","allowed","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/custom-dimensions/{dimension_id}":{"patch":{"operationId":"updateCustomDimension","summary":"Update custom dimension","description":"Update custom dimension; version number +1.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"dimension_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"name":{"type":"string","minLength":1,"maxLength":80},"scope":{"default":"event","type":"string","enum":["event","page"]},"allowed":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"scope":{"type":"string","enum":["event","page"]},"allowed":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","site_id","key","name","scope","allowed","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]},"delete":{"operationId":"deleteCustomDimension","summary":"Delete custom dimension","description":"Delete custom dimension (the definition version in historical results remains queryable).\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"dimension_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/campaign-costs":{"get":{"operationId":"listCampaignCosts","summary":"Promotion cost list","description":"Promotion costs (versioned).\n\nRequired scope: `conversions:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"date":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":["string","null"]},"utm_campaign":{"type":"string"},"cost_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"source":{"type":"string","enum":["manual","import"]},"created_at":{"type":"string"}},"required":["id","site_id","date","utm_source","utm_medium","utm_campaign","cost_minor","currency","source","created_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["conversions:read"],"x-mcp-tools":["manage_site_config"]},"post":{"operationId":"createCampaignCost","summary":"Create ad cost","description":"Create ad cost.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"utm_source":{"type":"string","minLength":1,"maxLength":128},"utm_medium":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"utm_campaign":{"type":"string","minLength":1,"maxLength":128},"cost_minor":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["date","utm_source","utm_campaign","cost_minor","currency"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"date":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":["string","null"]},"utm_campaign":{"type":"string"},"cost_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"source":{"type":"string","enum":["manual","import"]},"created_at":{"type":"string"}},"required":["id","site_id","date","utm_source","utm_medium","utm_campaign","cost_minor","currency","source","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/campaign-costs/{cost_id}":{"patch":{"operationId":"updateCampaignCost","summary":"Update ad cost","description":"Update ad cost; version number +1.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cost_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"utm_source":{"type":"string","minLength":1,"maxLength":128},"utm_medium":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"utm_campaign":{"type":"string","minLength":1,"maxLength":128},"cost_minor":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"date":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":["string","null"]},"utm_campaign":{"type":"string"},"cost_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"source":{"type":"string","enum":["manual","import"]},"created_at":{"type":"string"}},"required":["id","site_id","date","utm_source","utm_medium","utm_campaign","cost_minor","currency","source","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]},"delete":{"operationId":"deleteCampaignCost","summary":"Delete ad cost","description":"Delete ad cost (the definition version in historical results remains queryable).\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_site_config","tags":["Configuration"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cost_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/collect/browser":{"post":{"operationId":"collectBrowser","summary":"Browser event reporting","description":"The SDK reports via sendBeacon/fetch keepalive. The Site ID only determines attribution and cannot read data. Browser reports cannot carry any trusted network evidence.\n\nRate limit: Collection: fixed-window limit per site+IP (returns 429 with retry-after when exceeded)","tags":["Collection"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":1},"site_id":{"type":"string","minLength":4,"maxLength":64},"batch_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"sent_at":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sdk":{"type":"string","maxLength":32},"privacy_mode":{"type":"string","enum":["basic","consented"]},"consent":{"type":"boolean"},"signals":{"type":"object","properties":{"webdriver":{"type":"boolean"},"interaction":{"type":"boolean"},"visible":{"type":"boolean"},"js":{"type":"boolean"}}},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}},"dropped":{"type":"integer","minimum":0,"maximum":1000000}},"required":["v","site_id","batch_id","sent_at","privacy_mode","events"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"batch_id":{"type":"string"},"status":{"type":"string","enum":["accepted","partially_accepted","queued","rejected"]},"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejections":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"event_id":{"type":["string","null"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string"}},"required":["event_id","index","reason"],"additionalProperties":false}},"quality_flags":{"type":"array","items":{"type":"string"}}},"required":["batch_id","status","received","accepted","duplicates","rejected","rejections","quality_flags"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"collect_browser","x-openstatx-scopes":[]}},"/api/v1/collect/server":{"post":{"operationId":"collectServer","summary":"Server-side batch reporting (signed)","description":"Uses a write-only collection credential + HMAC signature (time window, request body digest, nonce). Can report order conversions, custom events and HTTP requests.\n\nRate limit: Collection: fixed-window limit per site+IP (returns 429 with retry-after when exceeded)","tags":["Collection"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":1},"site_id":{"type":"string","minLength":4,"maxLength":64},"batch_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"event_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"type":{"type":"string","const":"conversion"},"ts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"goal":{"type":"string","maxLength":128},"order_id":{"type":"string","maxLength":128},"revenue_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000000},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"visitor_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"session_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"props":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}}},"required":["event_id","type","ts","order_id"]},{"type":"object","properties":{"event_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"type":{"type":"string","const":"custom_event"},"ts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","maxLength":128},"visitor_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"session_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"props":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}}},"required":["event_id","type","ts","name"]},{"type":"object","properties":{"event_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"ts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"method":{"type":"string","pattern":"^[A-Z]{3,10}$"},"host":{"type":"string","maxLength":253},"path":{"type":"string","maxLength":2048},"status":{"type":"integer","minimum":100,"maximum":599},"content_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"content_length_declared":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"bytes_sent":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"ttfb_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"redirect_location_host":{"anyOf":[{"type":"string","maxLength":253},{"type":"null"}]},"client":{"type":"object","properties":{"ip":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"ua":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$|^XX$|^T1$"},{"type":"null"}]},"asn":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"colo":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]},"accept_language":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]}}},"cf_bot":{"anyOf":[{"type":"object","properties":{"verified_bot":{"type":["boolean","null"]},"verified_bot_category":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"score":{"anyOf":[{"type":"integer","minimum":1,"maximum":99},{"type":"null"}]},"js_detection_passed":{"type":["boolean","null"]},"static_resource":{"type":["boolean","null"]},"signed_agent":{"type":["boolean","null"]},"detection_ids":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]}},"required":["verified_bot","verified_bot_category","score","js_detection_passed","static_resource"]},{"type":"null"}]},"referer":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"request_ref":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"observation_target":{"default":"tracked_site_request","type":"string","const":"tracked_site_request"},"role":{"default":"original_client","type":"string","enum":["original_client","forwarder"]},"type":{"type":"string","const":"http_request"}},"required":["event_id","ts","method","host","path","status","client","type"]}]}}},"required":["v","site_id","batch_id","events"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"batch_id":{"type":"string"},"status":{"type":"string","enum":["accepted","partially_accepted","queued","rejected"]},"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejections":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"event_id":{"type":["string","null"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string"}},"required":["event_id","index","reason"],"additionalProperties":false}},"quality_flags":{"type":"array","items":{"type":"string"}}},"required":["batch_id","status","received","accepted","duplicates","rejected","rejections","quality_flags"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ingestSignature":[]}],"x-openstatx-auth":"collect_server","x-openstatx-scopes":[]}},"/api/v1/collect/edge":{"post":{"operationId":"collectEdge","summary":"Edge adapter reporting (signed)","description":"External Worker adapter reports signed HTTP request metadata. For the same account, Service Binding RPC is recommended (higher trust level).\n\nRate limit: Collection: fixed-window limit per site + IP (returns 429 with retry-after when exceeded)","tags":["Collection"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":1},"site_id":{"type":"string","minLength":4,"maxLength":64},"batch_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"adapter":{"type":"string","maxLength":64},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"event_id":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"},"ts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"method":{"type":"string","pattern":"^[A-Z]{3,10}$"},"host":{"type":"string","maxLength":253},"path":{"type":"string","maxLength":2048},"status":{"type":"integer","minimum":100,"maximum":599},"content_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"content_length_declared":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"bytes_sent":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"ttfb_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"redirect_location_host":{"anyOf":[{"type":"string","maxLength":253},{"type":"null"}]},"client":{"type":"object","properties":{"ip":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"ua":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$|^XX$|^T1$"},{"type":"null"}]},"asn":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"colo":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]},"accept_language":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]}}},"cf_bot":{"anyOf":[{"type":"object","properties":{"verified_bot":{"type":["boolean","null"]},"verified_bot_category":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"score":{"anyOf":[{"type":"integer","minimum":1,"maximum":99},{"type":"null"}]},"js_detection_passed":{"type":["boolean","null"]},"static_resource":{"type":["boolean","null"]},"signed_agent":{"type":["boolean","null"]},"detection_ids":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]}},"required":["verified_bot","verified_bot_category","score","js_detection_passed","static_resource"]},{"type":"null"}]},"referer":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"request_ref":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"observation_target":{"default":"tracked_site_request","type":"string","const":"tracked_site_request"},"role":{"default":"original_client","type":"string","enum":["original_client","forwarder"]}},"required":["event_id","ts","method","host","path","status","client"]}},"dropped":{"type":"integer","minimum":0,"maximum":1000000000}},"required":["v","site_id","batch_id","events"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"batch_id":{"type":"string"},"status":{"type":"string","enum":["accepted","partially_accepted","queued","rejected"]},"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejections":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"event_id":{"type":["string","null"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string"}},"required":["event_id","index","reason"],"additionalProperties":false}},"quality_flags":{"type":"array","items":{"type":"string"}}},"required":["batch_id","status","received","accepted","duplicates","rejected","rejections","quality_flags"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ingestSignature":[]}],"x-openstatx-auth":"collect_edge","x-openstatx-scopes":[]}},"/api/v1/sites/{id}/overview":{"get":{"operationId":"getOverview","summary":"Site overview","description":"Browser ledger (PV/UV/sessions/bounce rate/engaged time) and HTTP ledger (requests/AI/automation/errors) metrics are returned separately, including year-over-year/period-over-period comparisons.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report, traffic_overview","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_overview"]}},"/api/v1/sites/{id}/trends":{"get":{"operationId":"getTrends","summary":"Trends","description":"Minute/hour/day/week/month trends; supports comparison with the same period yesterday, the previous period, and the same period last year; time zone and DST handled correctly.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tools: get_report, query_analytics","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report","query_analytics"]}},"/api/v1/sites/{id}/realtime":{"get":{"operationId":"getRealtime","summary":"Real-time visitors","description":"Per-minute PV/requests for the last 30 minutes, active visitors in the last 5 minutes (not an exact count of live connections), and recent pages/requests.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_realtime","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_realtime"]}},"/api/v1/sites/{id}/sources":{"get":{"operationId":"getSources","summary":"Source analysis","description":"Search, external links, direct/no source, promotion, AI referral; retains source evidence and attribution limitations.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report, traffic_breakdown","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/search-terms":{"get":{"operationId":"getSearchTerms","summary":"Search terms","description":"Shows only search terms that are actually available; missing ones are shown as \"not provided\".\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: get_report","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/pages":{"get":{"operationId":"getPages","summary":"Page analysis","description":"Visited pages, entry pages, exit pages and page groups (view=pages|entry|exit|groups).\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tools: get_report, traffic_breakdown","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/audience":{"get":{"operationId":"getAudience","summary":"Visitor attributes","description":"New vs. returning visitors, visit depth, country/region, device, browser, OS, language (view=...). Unsupported fields are shown as unknown.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report, traffic_breakdown","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/visitors":{"get":{"operationId":"getVisitors","summary":"Visitor details","description":"Visitor-level details (consented mode only); site-level identifiers, not cross-site.\n\nRequired scope: `details:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_sessions","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["details:read"],"x-mcp-tools":["get_sessions"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/sessions":{"get":{"operationId":"listSiteSessions","summary":"Sessions","description":"Session-level details and path summaries.\n\nRequired scope: `details:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: get_sessions","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["details:read"],"x-mcp-tools":["get_sessions"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/sessions/{session_id}":{"get":{"operationId":"getSessionDetail","summary":"Session details","description":"Event timeline for a single session (fields are untrusted raw data).\n\nRequired scope: `details:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: get_sessions","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["details:read"],"x-mcp-tools":["get_sessions"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/paths":{"get":{"operationId":"getPaths","summary":"Visit paths","description":"In-session page transition (next page) statistics.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: get_report","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/events":{"get":{"operationId":"getEvents","summary":"Event analysis","description":"Custom events, site search, downloads, outbound link clicks, custom properties (view=...).\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report, get_event_details","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report","get_event_details"]}},"/api/v1/sites/{id}/conversions":{"get":{"operationId":"getConversions","summary":"Conversion analysis","description":"Goal completions, conversion attribution (last non-direct), business revenue (split by currency; requires revenue:read).\n\nRequired scope: `conversions:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["conversions:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/funnel-results":{"get":{"operationId":"getFunnelResults","summary":"Funnel results","description":"Computed per funnel definition version: window, order, denominator, cross-session rules. Requires the funnel_id query parameter.\n\nRequired scope: `conversions:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"funnel_id","in":"query","required":true,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["conversions:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/heatmaps":{"get":{"operationId":"getHeatmaps","summary":"Click regions and scroll depth","description":"Clicks and scroll depth in allowlisted regions (data-analytics-region); does not collect text, input or the full DOM.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/automation":{"get":{"operationId":"getAutomation","summary":"AI & automation analysis","description":"Broken down by provider/client/purpose/verification status/page; AI crawls and AI-referred human visits are separated; training/citation counts are not reported.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_report, traffic_breakdown","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/requests":{"get":{"operationId":"listRequests","summary":"Recent requests / HTTP analysis","description":"HTTP status, resource type, path concentration, redirects and errors (view=recent|status|resource|paths). The recent view is row-level detail and requires details:read.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tools: get_event_details, get_report","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["get_event_details","get_report"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/requests/{request_id}/explanation":{"get":{"operationId":"explainRequest","summary":"Per-request classification explanation","description":"Classification evidence drawer: actor, verification method, evidence list, rule version and trust level. Raw fields are marked as untrusted_data.\n\nRequired scope: `details:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tools: explain_classification, traffic_explain","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"request_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["details:read"],"x-mcp-tools":["explain_classification","traffic_explain"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/campaign-results":{"get":{"operationId":"getCampaignResults","summary":"Campaign performance","description":"Sessions, conversions, revenue and imported costs for UTM campaigns (ad accounts are never connected without authorization).\n\nRequired scope: `conversions:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: get_report","tags":["Reports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","last_90_days"]}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday","none"]}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["minute","hour","day","week","month"]}},{"name":"actor_class","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"path","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"view","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["conversions:read"],"x-mcp-tools":["get_report"]}},"/api/v1/comparisons":{"post":{"operationId":"compareSites","summary":"Compare sites","description":"Human-related metrics, AI referrals, AI crawls, machine volume, conversions, usage and anomalies; UV summed across sites is only called \"sum of per-site UV\".\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: compare_sites","tags":["Reports"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"site_ids":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}},"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"preset":{"type":"string"},"timezone":{"type":"string"}},"required":["site_ids"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["compare_sites"]}},"/api/v1/query":{"post":{"operationId":"runQuery","summary":"Structured queries","description":"Allowlist query compiler (does not accept SQL): metrics, dimensions, filters and sorting are all validated, and values are parameterized; over-budget queries are explicitly rejected, never silently truncated.\n\nRequired scope: `summary:read`\n\nRate limit: Query: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: query_analytics","tags":["Reports"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"site_ids":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}},"dataset":{"type":"string","enum":["http_requests","browser_events","sessions","conversions"]},"metrics":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","maxLength":64}},"dimensions":{"default":[],"maxItems":4,"type":"array","items":{"type":"string","maxLength":64}},"time_range":{"type":"object","properties":{"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["start","end"]},"timezone":{"type":"string","maxLength":64},"filters":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"dimension":{"type":"string","maxLength":64},"op":{"type":"string","enum":["eq","neq","in","not_in","contains","starts_with","is_null","not_null","gte","lte"]},"value":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"}]}}]}},"required":["dimension","op"]}},"order_by":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":64},"direction":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["field"]}},"limit":{"default":100,"type":"integer","minimum":1,"maximum":1000},"cursor":{"type":"string","maxLength":512},"compare_to":{"type":"string","enum":["previous_period","previous_year","same_time_yesterday"]}},"required":["site_ids","dataset","metrics","time_range"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["query_analytics"]}},"/api/v1/imports":{"post":{"operationId":"createImport","summary":"Upload historical import","description":"Upload legacy CSV/JSON reports and declare field mapping, time zone and definitions; generates an error-row report.\n\nRequired scope: `imports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_imports","tags":["Import/export"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"site_id":{"type":"string"},"format":{"type":"string","enum":["csv","json"]},"content":{"type":"string","maxLength":2097152},"mapping":{"type":"object","properties":{"date":{"type":"string"},"page_views":{"type":"string"},"unique_visitors":{"type":"string"},"sessions":{"type":"string"},"dimension":{"type":"string"},"dimension_type":{"default":"none","type":"string","enum":["none","path","referrer_host","country"]}},"required":["date"]},"timezone":{"type":"string","maxLength":64},"metric_semantics":{"default":"Daily aggregates from the legacy analytics system; definitions may not match this system","type":"string","maxLength":500}},"required":["site_id","format","content","mapping","timezone"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"status":{"type":"string","enum":["uploaded","previewed","committed","failed"]},"format":{"type":"string","enum":["csv","json"]},"timezone":{"type":"string"},"metric_semantics":{"type":"string"},"row_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"}},"required":["row","error"],"additionalProperties":false}},"preview":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"overlap_days":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"committed_at":{"type":["string","null"]}},"required":["id","site_id","status","format","timezone","metric_semantics","row_count","error_rows","preview","overlap_days","created_at","committed_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/imports/{id}":{"get":{"operationId":"getImport","summary":"Import details","description":"Import status, error rows and overlapping ranges.\n\nRequired scope: `imports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_imports","tags":["Import/export"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"status":{"type":"string","enum":["uploaded","previewed","committed","failed"]},"format":{"type":"string","enum":["csv","json"]},"timezone":{"type":"string"},"metric_semantics":{"type":"string"},"row_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"}},"required":["row","error"],"additionalProperties":false}},"preview":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"overlap_days":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"committed_at":{"type":["string","null"]}},"required":["id","site_id","status","format","timezone","metric_semantics","row_count","error_rows","preview","overlap_days","created_at","committed_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/imports/{id}/preview":{"post":{"operationId":"previewImport","summary":"Preview import","description":"Previews the first 20 rows per the mapping and flags dates that overlap with local facts (overlapping ranges will not be double-counted).\n\nRequired scope: `imports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_imports","tags":["Import/export"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"status":{"type":"string","enum":["uploaded","previewed","committed","failed"]},"format":{"type":"string","enum":["csv","json"]},"timezone":{"type":"string"},"metric_semantics":{"type":"string"},"row_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"}},"required":["row","error"],"additionalProperties":false}},"preview":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"overlap_days":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"committed_at":{"type":["string","null"]}},"required":["id","site_id","status","format","timezone","metric_semantics","row_count","error_rows","preview","overlap_days","created_at","committed_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/imports/{id}/commit":{"post":{"operationId":"commitImport","summary":"Commit import","description":"Idempotently commits as an imported_aggregate source; not added on top of local facts for already-covered ranges, and cannot be reclassified as human/AI.\n\nRequired scope: `imports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_imports","tags":["Import/export"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"status":{"type":"string","enum":["uploaded","previewed","committed","failed"]},"format":{"type":"string","enum":["csv","json"]},"timezone":{"type":"string"},"metric_semantics":{"type":"string"},"row_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"}},"required":["row","error"],"additionalProperties":false}},"preview":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"overlap_days":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"committed_at":{"type":["string","null"]}},"required":["id","site_id","status","format","timezone","metric_semantics","row_count","error_rows","preview","overlap_days","created_at","committed_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/exports":{"get":{"operationId":"listExports","summary":"Export list","description":"Export jobs visible to the current credential.\n\nRequired scope: `exports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: get_export","tags":["Import/export"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"dataset":{"type":"string"},"format":{"type":"string","enum":["csv","json","ndjson"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled","revoked"]},"row_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"byte_size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"error":{"type":["string","null"]},"source":{"type":"string","enum":["hot","archive"]},"download_path":{"type":["string","null"]}},"required":["id","site_id","dataset","format","status","row_count","byte_size","created_at","completed_at","expires_at","error","source","download_path"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["exports:write"],"x-mcp-tools":["get_export"]},"post":{"operationId":"createExport","summary":"Create export","description":"CSV/JSON/NDJSON export job; fields remain subject to read-scope restrictions; CSV output is protected against formula injection.\n\nRequired scope: `exports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: create_export","tags":["Import/export"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"site_id":{"type":"string"},"dataset":{"type":"string","enum":["browser_events","http_requests","sessions","conversions","report"]},"format":{"default":"csv","type":"string","enum":["csv","json","ndjson"]},"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"fields":{"maxItems":40,"type":"array","items":{"type":"string","maxLength":64}},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"default":"hot","type":"string","enum":["hot","archive"]}},"required":["site_id","dataset","start","end"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"dataset":{"type":"string"},"format":{"type":"string","enum":["csv","json","ndjson"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled","revoked"]},"row_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"byte_size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"error":{"type":["string","null"]},"source":{"type":"string","enum":["hot","archive"]},"download_path":{"type":["string","null"]}},"required":["id","site_id","dataset","format","status","row_count","byte_size","created_at","completed_at","expires_at","error","source","download_path"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["exports:write"],"x-mcp-tools":["create_export"]}},"/api/v1/exports/{id}":{"get":{"operationId":"getExport","summary":"Export status","description":"Job status; becomes revoked once the creating credential is revoked.\n\nRequired scope: `exports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: get_export","tags":["Import/export"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"dataset":{"type":"string"},"format":{"type":"string","enum":["csv","json","ndjson"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled","revoked"]},"row_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"byte_size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"error":{"type":["string","null"]},"source":{"type":"string","enum":["hot","archive"]},"download_path":{"type":["string","null"]}},"required":["id","site_id","dataset","format","status","row_count","byte_size","created_at","completed_at","expires_at","error","source","download_path"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["exports:write"],"x-mcp-tools":["get_export"]},"delete":{"operationId":"deleteExport","summary":"Delete export","description":"Delete an export file.\n\nRequired scope: `exports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Import/export"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["exports:write"]}},"/api/v1/exports/{id}/download":{"get":{"operationId":"downloadExport","summary":"Download export file","description":"Permissions and the creating grant are re-checked for validity at download time.\n\nRequired scope: `exports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Import/export"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"File content","content":{"text/csv":{},"application/json":{},"application/x-ndjson":{}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["exports:write"]}},"/api/v1/saved-reports":{"get":{"operationId":"listSavedReports","summary":"Saved reports","description":"Saved structured queries.\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_saved_reports","tags":["Report schedules"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"site_ids":{"type":"array","items":{"type":"string"}},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","site_ids","query","created_at","updated_at","version"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_saved_reports"]},"post":{"operationId":"createSavedReport","summary":"Save report","description":"Save a structured query (same schema as /query).\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_saved_reports","tags":["Report schedules"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Replaying the same key with the same parameters returns the first result; the same key with different parameters returns 409 IDEMPOTENCY_CONFLICT"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","query"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"site_ids":{"type":"array","items":{"type":"string"}},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","site_ids","query","created_at","updated_at","version"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]}},"/api/v1/saved-reports/{id}":{"get":{"operationId":"getSavedReport","summary":"Report details","description":"A single saved report.\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_saved_reports","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"site_ids":{"type":"array","items":{"type":"string"}},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","site_ids","query","created_at","updated_at","version"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_saved_reports"]},"patch":{"operationId":"updateSavedReport","summary":"Update report","description":"Update name or query.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_saved_reports","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"site_ids":{"type":"array","items":{"type":"string"}},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","site_ids","query","created_at","updated_at","version"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]},"delete":{"operationId":"deleteSavedReport","summary":"Delete report","description":"Delete a saved report and its schedules.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_saved_reports","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]}},"/api/v1/report-runs":{"get":{"operationId":"listReportRuns","summary":"Run history","description":"Report run history and delivery results (failure statuses shown as-is).\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_saved_reports","tags":["Report schedules"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"saved_report_id":{"type":"string"},"schedule_id":{"type":["string","null"]},"status":{"type":"string","enum":["pending","running","completed","failed"]},"started_at":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"error":{"type":["string","null"]},"result":{"anyOf":[{},{"type":"null"}]},"deliveries":{"type":"array","items":{"type":"object","properties":{"destination_id":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"type":["string","null"]}},"required":["destination_id","status","attempts","last_error"],"additionalProperties":false}}},"required":["id","saved_report_id","schedule_id","status","started_at","completed_at","error","result","deliveries"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_saved_reports"]},"post":{"operationId":"createReportRun","summary":"Run report now","description":"Generates a report result once, in-app.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_saved_reports","tags":["Report schedules"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"saved_report_id":{"type":"string"}},"required":["saved_report_id"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"saved_report_id":{"type":"string"},"schedule_id":{"type":["string","null"]},"status":{"type":"string","enum":["pending","running","completed","failed"]},"started_at":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"error":{"type":["string","null"]},"result":{"anyOf":[{},{"type":"null"}]},"deliveries":{"type":"array","items":{"type":"object","properties":{"destination_id":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"type":["string","null"]}},"required":["destination_id","status","attempts","last_error"],"additionalProperties":false}}},"required":["id","saved_report_id","schedule_id","status","started_at","completed_at","error","result","deliveries"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]}},"/api/v1/report-schedules":{"get":{"operationId":"listReportSchedules","summary":"Schedule list","description":"Daily/weekly report schedules.\n\nRequired scope: `summary:read`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_schedules","tags":["Report schedules"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"saved_report_id":{"type":"string"},"cadence":{"type":"string","enum":["daily","weekly"]},"hour_local":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekday":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":"string"},"destination_ids":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"next_run_at":{"type":["string","null"]},"last_run_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","saved_report_id","cadence","hour_local","weekday","timezone","destination_ids","enabled","next_run_at","last_run_at","created_at"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["summary:read"],"x-mcp-tools":["manage_schedules"]},"post":{"operationId":"createReportSchedule","summary":"Create schedule","description":"Daily/weekly reports in the site's time zone.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_schedules","tags":["Report schedules"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"saved_report_id":{"type":"string"},"cadence":{"type":"string","enum":["daily","weekly"]},"hour_local":{"type":"integer","minimum":0,"maximum":23},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"timezone":{"type":"string","maxLength":64},"destination_ids":{"default":[],"maxItems":5,"type":"array","items":{"type":"string"}},"enabled":{"default":true,"type":"boolean"}},"required":["saved_report_id","cadence","hour_local"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"saved_report_id":{"type":"string"},"cadence":{"type":"string","enum":["daily","weekly"]},"hour_local":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekday":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":"string"},"destination_ids":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"next_run_at":{"type":["string","null"]},"last_run_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","saved_report_id","cadence","hour_local","weekday","timezone","destination_ids","enabled","next_run_at","last_run_at","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"],"x-mcp-tools":["manage_schedules"]}},"/api/v1/report-schedules/{id}":{"patch":{"operationId":"updateReportSchedule","summary":"Update schedule","description":"Update schedule.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_schedules","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"saved_report_id":{"type":"string"},"cadence":{"type":"string","enum":["daily","weekly"]},"hour_local":{"type":"integer","minimum":0,"maximum":23},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"timezone":{"type":"string","maxLength":64},"destination_ids":{"default":[],"maxItems":5,"type":"array","items":{"type":"string"}},"enabled":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"saved_report_id":{"type":"string"},"cadence":{"type":"string","enum":["daily","weekly"]},"hour_local":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekday":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":"string"},"destination_ids":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"next_run_at":{"type":["string","null"]},"last_run_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","saved_report_id","cadence","hour_local","weekday","timezone","destination_ids","enabled","next_run_at","last_run_at","created_at"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"],"x-mcp-tools":["manage_schedules"]},"delete":{"operationId":"deleteReportSchedule","summary":"Delete schedule","description":"Delete schedule.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: manage_schedules","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"],"x-mcp-tools":["manage_schedules"]}},"/api/v1/destinations":{"get":{"operationId":"listDestinations","summary":"Delivery targets","description":"Webhook (verification required) and optional email adapter (must never show as sent when not configured).\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Report schedules"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["webhook","email"]},"name":{"type":"string"},"target_display":{"type":"string"},"status":{"type":"string","enum":["pending_verification","verified","failed","disabled"]},"created_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["id","type","name","target_display","status","created_at","verified_at","last_error"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"]},"post":{"operationId":"createDestination","summary":"Create delivery target","description":"Starts as pending_verification after creation; deliveries only begin once verification passes.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Report schedules"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["webhook","email"]},"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":2048,"format":"uri"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["type","name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["webhook","email"]},"name":{"type":"string"},"target_display":{"type":"string"},"status":{"type":"string","enum":["pending_verification","verified","failed","disabled"]},"created_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["id","type","name","target_display","status","created_at","verified_at","last_error"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"]}},"/api/v1/destinations/{id}":{"patch":{"operationId":"updateDestination","summary":"Update delivery target","description":"Update name or disable; changing the URL requires re-verification.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["webhook","email"]},"name":{"type":"string"},"target_display":{"type":"string"},"status":{"type":"string","enum":["pending_verification","verified","failed","disabled"]},"created_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["id","type","name","target_display","status","created_at","verified_at","last_error"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"]},"delete":{"operationId":"deleteDestination","summary":"Delete delivery target","description":"Delete a delivery destination.\n\nRequired scope: `reports:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"]}},"/api/v1/destinations/{id}/verify":{"post":{"operationId":"verifyDestination","summary":"Verify delivery target","description":"Sends a signed verification challenge to the webhook; the target must echo the challenge value back unchanged (SSRF protection same as site verification).\n\nRequired scope: `reports:write`\n\nRate limit: Verification checks: per-credential per-hour limit (returns 429 with retry-after when exceeded)","tags":["Report schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["webhook","email"]},"name":{"type":"string"},"target_display":{"type":"string"},"status":{"type":"string","enum":["pending_verification","verified","failed","disabled"]},"created_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["id","type","name","target_display","status","created_at","verified_at","last_error"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["reports:write"]}},"/api/v1/public-shares":{"get":{"operationId":"listPublicShares","summary":"Public share list","description":"Public shares of the current workspace.\n\nRequired scope: `shares:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_public_shares","tags":["Sharing"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"report":{"type":"string","enum":["overview","trends","pages","sources"]},"metrics":{"type":"array","items":{"type":"string"}},"max_range_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granularity":{"type":"string","enum":["day","hour"]},"created_at":{"type":"string"},"revoked_at":{"type":["string","null"]},"public_path":{"type":"string"}},"required":["id","site_id","report","metrics","max_range_days","granularity","created_at","revoked_at","public_path"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["shares:write"]},{"sessionCookie":["shares:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["shares:write"],"x-mcp-tools":["manage_public_shares"]},"post":{"operationId":"createPublicShare","summary":"Create public share","description":"Exposes only the selected metrics and granularity; when ENABLE_PUBLIC_SHARES=false, returns FEATURE_DISABLED with instructions on how to enable it. Requires recent strong authentication.\n\nRequired scope: `shares:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Sharing"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"site_id":{"type":"string"},"report":{"type":"string","enum":["overview","trends","pages","sources"]},"metrics":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string"}},"max_range_days":{"default":30,"type":"integer","minimum":1,"maximum":90},"granularity":{"default":"day","type":"string","enum":["day","hour"]}},"required":["site_id","report","metrics"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"report":{"type":"string","enum":["overview","trends","pages","sources"]},"metrics":{"type":"array","items":{"type":"string"}},"max_range_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granularity":{"type":"string","enum":["day","hour"]},"created_at":{"type":"string"},"revoked_at":{"type":["string","null"]},"public_path":{"type":"string"}},"required":["id","site_id","report","metrics","max_range_days","granularity","created_at","revoked_at","public_path"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["shares:write"]}],"x-openstatx-auth":"session","x-openstatx-scopes":["shares:write"]}},"/api/v1/public-shares/{id}":{"delete":{"operationId":"deletePublicShare","summary":"Revoke public share","description":"After revocation, the web page, API, MCP and cache are invalidated simultaneously.\n\nRequired scope: `shares:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: manage_public_shares","tags":["Sharing"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["shares:write"]},{"sessionCookie":["shares:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["shares:write"],"x-mcp-tools":["manage_public_shares"]}},"/api/v1/public/{share_id}/report":{"get":{"operationId":"getPublicReport","summary":"Public shared report","description":"Share fields, filters and time constraints enforced server-side; cannot be bypassed via /query or MCP.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Sharing"],"parameters":[{"name":"share_id","in":"path","required":true,"schema":{"type":"string","minLength":8,"maxLength":80}},{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","maxLength":32}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rows"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"share","x-openstatx-scopes":[]}},"/api/v1/actions/preview":{"post":{"operationId":"previewAction","summary":"Preview high-risk action","description":"Only registered action enums are allowed (delete data/site/workspace, shorten retention period, enable public share, delete export). Returns the payload digest, impact, expiry and required conditions. Does not accept code, SQL or cloud management commands.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nMCP tool: preview_action","tags":["Action"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["delete_site_data","delete_site","shorten_retention","enable_public_share","delete_workspace","delete_export"]},"site_id":{"type":"string"},"resource_id":{"type":"string"},"params":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["action"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string","enum":["delete_site_data","delete_site","shorten_retention","enable_public_share","delete_workspace","delete_export"]},"status":{"type":"string","enum":["pending","executed","expired","cancelled"]},"payload_digest":{"type":"string"},"summary":{"type":"string"},"impact":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"requires":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string"},"resource_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"executed_at":{"type":["string","null"]},"result":{"anyOf":[{},{"type":"null"}]}},"required":["id","action","status","payload_digest","summary","impact","requires","expires_at","resource_version","executed_at","result"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"principal","x-openstatx-scopes":["settings:write"],"x-mcp-tools":["preview_action"]}},"/api/v1/actions/{id}/execute":{"post":{"operationId":"executeAction","summary":"Execute high-risk action","description":"Can only be executed from a browser session with recent strong authentication; verifies the payload digest, permissions, expiry and resource version. A model saying \"confirm\" is no substitute for authorization.\n\nRequired scope: `settings:write`\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)","tags":["Action"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payload_digest":{"type":"string"},"confirm_text":{"type":"string","maxLength":200}},"required":["payload_digest","confirm_text"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string","enum":["delete_site_data","delete_site","shorten_retention","enable_public_share","delete_workspace","delete_export"]},"status":{"type":"string","enum":["pending","executed","expired","cancelled"]},"payload_digest":{"type":"string"},"summary":{"type":"string"},"impact":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"requires":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string"},"resource_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"executed_at":{"type":["string","null"]},"result":{"anyOf":[{},{"type":"null"}]}},"required":["id","action","status","payload_digest","summary","impact","requires","expires_at","resource_version","executed_at","result"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["settings:write"]}],"x-openstatx-auth":"session","x-openstatx-scopes":["settings:write"]}},"/api/v1/classification/rulesets":{"get":{"operationId":"getClassificationRules","summary":"Classification rules and registry","description":"Current rule version, client registry (official source, purpose, verification method, update time, validity period) and IP list status.\n\nRate limit: Default: per-credential per-minute limit (returns 429 with retry-after when exceeded)\n\nCorresponding MCP tool: discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/Meta"},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-openstatx-auth":"public","x-openstatx-scopes":[],"x-mcp-tools":["discover_analytics"]}}},"components":{"securitySchemes":{"bearerCredential":{"type":"http","scheme":"bearer","description":"Read-only/admin API credential (stk_...) or short-lived bootstrap token (stb_...)"},"sessionCookie":{"type":"apiKey","in":"cookie","name":"__Host-st_session","description":"Browser session (HttpOnly, SameSite=Strict); write operations require a same-origin Origin"},"ingestSignature":{"type":"http","scheme":"bearer","description":"Collection credential (sti_...) + X-OpenstatX-Timestamp / X-OpenstatX-Nonce / X-OpenstatX-Signature: v1=HMAC-SHA256(secret, ts.nonce.sha256(body))"},"oauth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://openstatx.com/authorize","tokenUrl":"https://openstatx.com/oauth/token","scopes":{"summary:read":"Read summary reports (PV, UV, sources, top pages, AI summary, etc.), excluding visitor/request-level details and revenue","details:read":"Read visitor, session and single-request details and classification evidence (including untrusted raw fields such as path and UA)","conversions:read":"Read goals, funnels and conversion counts (excluding revenue amounts)","revenue:read":"Read revenue amounts and orders","exports:write":"Create and download export files (export content is still limited by other read scopes)","imports:write":"Upload and submit historical data imports","sites:write":"Add/edit sites, groups, installation and verification","settings:write":"Edit site settings, goals, funnels, filters, custom dimensions, campaign costs and retention settings","reports:write":"Save reports, create schedules and delivery targets","shares:write":"Create/revoke public shares (public sharing must still be enabled on the server)","members:admin":"Invite, downgrade and remove members","credentials:admin":"Create, rotate and revoke API credentials and grants","audit:read":"Read audit logs","usage:read":"Read usage, quotas and cost estimates"}}},"description":"Only for /mcp (authorization code + PKCE)"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id","retryable"],"properties":{"code":{"type":"string","enum":["BAD_REQUEST","VALIDATION_FAILED","UNAUTHENTICATED","FORBIDDEN","CSRF_FAILED","NOT_FOUND","CONFLICT","IDEMPOTENCY_CONFLICT","ACTION_REQUIRED","VERSION_CONFLICT","PAYLOAD_TOO_LARGE","UNSUPPORTED_COMBINATION","QUERY_TOO_EXPENSIVE","REAUTH_REQUIRED","RATE_LIMITED","QUOTA_EXCEEDED","FEATURE_DISABLED","DEPENDENCY_UNAVAILABLE","INTERNAL","RECOVERY_FAILED","HOST_NOT_ALLOWED","SIGNATURE_INVALID","EXPORT_EXPIRED"]},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object"},"retryable":{"type":"boolean"},"retry_after_seconds":{"type":"integer"}}}}},"Meta":{"type":"object","required":["request_id","api_version"],"properties":{"request_id":{"type":"string"},"api_version":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"data_as_of":{"type":"string","format":"date-time"},"quality_by_metric":{"type":"object"},"coverage":{"type":"object"},"freshness":{"type":"object"},"next_actions":{"type":"array"}}},"Pagination":{"type":"object","properties":{"next_cursor":{"type":["string","null"]},"limit":{"type":"integer"}}}}},"x-mcp":{"endpoint":"https://openstatx.com/mcp","transport":"streamable-http","auth":["Bearer stk_ API credential","OAuth 2.1 authorization code + PKCE"]}}