{"openapi":"3.1.0","info":{"title":"站迹统计 SiteTrace Analytics API","version":"v1","description":"独立网站统计服务（CNZZ 风格报表）。两本账：浏览器行为与 HTTP 请求；五类访问者（human_likely / ai_verified / ai_claimed / other_automation / unknown）。数据默认私有；Site ID 是公开的写入标识，不能读取数据。所有响应使用 { data, meta, pagination } 信封，错误使用 { error: { code, message, request_id, retryable } }。"},"servers":[{"url":"https://openstatx.com"}],"paths":{"/api/v1/workspaces":{"post":{"operationId":"createWorkspace","summary":"创建匿名工作区与第一个网站","description":"免注册：输入域名即创建持久匿名工作区、独立站点与安全会话。恢复密钥只在本响应中出现一次。programmatic 模式不设置 Cookie，返回一个短期受限引导令牌。\n\n限流：每 IP 每小时 30 次（超限返回 429 与 retry-after）","tags":["引导"],"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":"成功","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"},"cnzz_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","cnzz_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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[]}},"/api/v1/workspace-recovery":{"post":{"operationId":"recoverWorkspace","summary":"凭恢复密钥恢复工作区","description":"在新设备凭恢复密钥建立新会话（始终签发新会话 ID，防会话固定）。错误密钥返回通用错误，不泄露工作区是否存在。\n\n限流：每 IP 每小时 20 次（超限返回 429 与 retry-after）","tags":["引导"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[]}},"/api/v1/member-invites/accept":{"post":{"operationId":"acceptMemberInvite","summary":"接受成员邀请","description":"以一次性短期邀请令牌加入工作区，获得独立设备会话（不会得到所有者恢复密钥）。\n\n限流：每 IP 每小时 20 次（超限返回 429 与 retry-after）","tags":["成员"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[]}},"/api/v1/schema/metrics":{"get":{"operationId":"getMetricSchema","summary":"指标字典","description":"机器可读指标定义：口径、单位、可加性、去重范围、隐私前提、版本。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/schema/dimensions":{"get":{"operationId":"getDimensionSchema","summary":"维度字典","description":"可用维度、适用数据集、高基数标记与隐私前提。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/schema/reports":{"get":{"operationId":"getReportSchema","summary":"报表目录","description":"每个报表的指标、维度、所需 scope 与对应 REST/MCP 调用。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/capabilities/public":{"get":{"operationId":"getPublicCapabilities","summary":"公开能力表","description":"implemented/enabled/configured/available/reason/limits/retention，不含任何私有数据。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[]}},"/api/v1/demo/session":{"post":{"operationId":"enterDemo","summary":"进入隔离演示","description":"进入固定的只读演示工作区（示例数据，明确标注）。返回 2 小时有效的只读演示令牌，不设置 Cookie，不影响当前真实工作区会话。\n\n限流：每 IP 每小时 30 次（超限返回 429 与 retry-after）","tags":["引导"],"parameters":[],"responses":{"201":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[]}},"/api/v1/workspace":{"get":{"operationId":"getWorkspace","summary":"当前工作区","description":"返回当前凭证所属工作区与调用者身份/权限。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：discover_analytics","tags":["工作区"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":[]},{"sessionCookie":[]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":[],"x-mcp-tools":["discover_analytics"]},"patch":{"operationId":"updateWorkspace","summary":"修改工作区","description":"修改名称与默认时区。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["工作区"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"]}},"/api/v1/workspace/reauth":{"post":{"operationId":"reauthenticate","summary":"近期强认证","description":"重新输入恢复密钥，获得 10 分钟强认证窗口，用于删除、缩短保留期、公开私有数据等高风险动作。\n\n限流：每 IP 每小时 20 次（超限返回 429 与 retry-after）","tags":["工作区"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":[]}},"/api/v1/workspace/sessions":{"get":{"operationId":"listWorkspaceSessions","summary":"会话列表","description":"列出本工作区的浏览器会话（不含任何令牌）。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["工作区"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":[]}},"/api/v1/workspace/sessions/{id}":{"get":{"operationId":"getWorkspaceSession","summary":"会话详情","description":"单个会话信息。id=current 表示当前会话。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["工作区"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":[]},"delete":{"operationId":"revokeWorkspaceSession","summary":"撤销会话/退出","description":"撤销指定会话；id=current 即退出登录。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["工作区"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":[]}},"/api/v1/workspace/sessions/revoke-all":{"post":{"operationId":"revokeAllSessions","summary":"全部会话失效","description":"使所有（或除当前外所有）会话立即失效。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["工作区"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keep_current":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":[]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":[]}},"/api/v1/workspace/recovery/rotate":{"post":{"operationId":"rotateRecoveryKey","summary":"轮换恢复密钥","description":"生成新恢复密钥（只显示一次），旧密钥立即失效并保留审计；按 session_policy 处理已有会话。仅所有者会话可用。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["工作区"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":["credentials:admin"]}},"/api/v1/credentials":{"get":{"operationId":"listCredentials","summary":"API/采集凭证列表","description":"只显示前缀、名称、权限、创建/最后使用时间，不重新暴露完整凭证。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["授权"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["credentials:admin"]},"post":{"operationId":"createCredential","summary":"创建凭证","description":"创建受限只读 API 凭证（绑定 scopes、site_ids、有效期、访问窗口）或只写采集凭证。完整值只返回一次。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["授权"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["credentials:admin"]}},"/api/v1/credentials/{id}":{"delete":{"operationId":"revokeCredential","summary":"吊销凭证","description":"立即失效，进行中的导出也会被阻断。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["授权"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["credentials:admin"]}},"/api/v1/credentials/{id}/rotate":{"post":{"operationId":"rotateCredential","summary":"轮换凭证","description":"签发新值并吊销旧值，权限不变。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["授权"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["credentials:admin"]}},"/api/v1/grants":{"get":{"operationId":"listGrants","summary":"授权列表","description":"OAuth 客户端授权、凭证附加授权、成员授权。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["授权"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["credentials:admin"]},"post":{"operationId":"createGrant","summary":"为凭证追加授权","description":"在授予者权限范围内为某凭证追加 scope（不能超出授予者自身权限）。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["授权"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["credentials:admin"]}},"/api/v1/grants/{id}":{"delete":{"operationId":"revokeGrant","summary":"撤销授权","description":"撤销 OAuth 授权会同时吊销其访问令牌与刷新令牌。\n\n所需权限：`credentials:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["授权"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["credentials:admin"]},{"sessionCookie":["credentials:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["credentials:admin"]}},"/api/v1/members":{"get":{"operationId":"listMembers","summary":"成员列表","description":"成员与角色。\n\n所需权限：`members:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["成员"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["members:admin"]},{"sessionCookie":["members:admin"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["members:admin"]},"post":{"operationId":"createMember","summary":"邀请成员","description":"生成一次性、24 小时有效的邀请令牌；成员使用独立设备身份，不会拿到所有者恢复密钥。\n\n所需权限：`members:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["成员"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["members:admin"]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":["members:admin"]}},"/api/v1/members/{id}":{"patch":{"operationId":"updateMember","summary":"修改成员角色","description":"降级立即生效（已有会话的权限在下一次请求即按新角色计算）。\n\n所需权限：`members:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["成员"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["members:admin"]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":["members:admin"]},"delete":{"operationId":"deleteMember","summary":"移除成员","description":"移除成员并撤销其全部会话。\n\n所需权限：`members:admin`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["成员"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["members:admin"]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":["members:admin"]}},"/api/v1/audit-logs":{"get":{"operationId":"listAuditLogs","summary":"审计日志","description":"身份、授权、配置与高风险动作的审计记录（已脱敏）。\n\n所需权限：`audit:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["工作区"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["audit:read"]},{"sessionCookie":["audit:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["audit:read"]}},"/api/v1/capabilities":{"get":{"operationId":"getCapabilities","summary":"能力表","description":"当前工作区可用能力：implemented/enabled/configured/available/reason/limits/retention。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：discover_analytics","tags":["工作区"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":[]},{"sessionCookie":[]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":[],"x-mcp-tools":["discover_analytics"]}},"/api/v1/usage":{"get":{"operationId":"getUsage","summary":"用量","description":"每站每日接收/拒收/重复事件、查询次数等实测用量；无价格配置时不显示金额。\n\n所需权限：`usage:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_usage","tags":["工作区"],"parameters":[{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["usage:read"]},{"sessionCookie":["usage:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["usage:read"],"x-mcp-tools":["get_usage"]}},"/api/v1/quotas":{"get":{"operationId":"getQuotas","summary":"配额","description":"未验证/已验证站点额度与当前状态（初值待压测）。\n\n所需权限：`usage:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_usage","tags":["工作区"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["usage:read"]},{"sessionCookie":["usage:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["usage:read"],"x-mcp-tools":["get_usage"]}},"/api/v1/sites":{"get":{"operationId":"listSites","summary":"网站列表（多站总表）","description":"当前凭证可见的网站，含今日 PV/UV/HTTP/AI 摘要与接入状态。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：list_sites","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["list_sites"]},"post":{"operationId":"createSite","summary":"添加网站","description":"在当前工作区添加网站。不返回该域名在其他工作区的存在状态。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：add_site","tags":["网站"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"],"x-mcp-tools":["add_site"]}},"/api/v1/sites/batch":{"post":{"operationId":"batchCreateSites","summary":"批量添加网站","description":"幂等批量添加（需 Idempotency-Key），返回结果清单；失败项可重试。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["网站"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"]}},"/api/v1/sites/{id}":{"get":{"operationId":"getSite","summary":"网站详情","description":"网站配置与状态。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：list_sites","tags":["网站"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["list_sites"]},"patch":{"operationId":"updateSite","summary":"修改网站","description":"名称、启停、分组；支持 expected_version 乐观并发。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"]},"delete":{"operationId":"deleteSite","summary":"删除网站","description":"无数据的网站可直接删除；有数据时返回 ACTION_REQUIRED，需要通过 /actions/preview 走高风险动作流程。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["网站"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"]}},"/api/v1/groups":{"get":{"operationId":"listGroups","summary":"站点分组列表","description":"分组及成员站点。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"]},"post":{"operationId":"createGroup","summary":"创建分组","description":"创建站点分组。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"]}},"/api/v1/groups/{id}":{"patch":{"operationId":"updateGroup","summary":"修改分组","description":"修改名称与成员。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"]},"delete":{"operationId":"deleteGroup","summary":"删除分组","description":"只删除分组，不影响网站与数据。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["网站"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"]}},"/api/v1/sites/{id}/verification/challenges":{"post":{"operationId":"createVerificationChallenge","summary":"发起站点验证","description":"签发 HTML 标记 / 验证文件 / DNS TXT 验证挑战。\n\n所需权限：`sites:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：start_site_verification","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"],"x-mcp-tools":["start_site_verification"]}},"/api/v1/sites/{id}/verification/checks":{"post":{"operationId":"runVerificationCheck","summary":"执行验证检查","description":"按挑战方式检查（主动抓取带 SSRF 防护；DNS 通过固定 DoH 解析器）。只收到带 site_id 的事件不算验证成功。\n\n所需权限：`sites:write`\n\n限流：验证检查：每凭证每小时限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：check_site_verification","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["sites:write"]},{"sessionCookie":["sites:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["sites:write"],"x-mcp-tools":["check_site_verification"]}},"/api/v1/sites/{id}/installation":{"get":{"operationId":"getInstallation","summary":"安装与接入状态","description":"JS 片段、CNZZ 兼容片段、边缘适配器与服务端上报示例；browser/edge/server/security_logs 各自采集状态。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：check_installation","tags":["网站"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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"},"cnzz_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","cnzz_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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["check_installation"]}},"/api/v1/sites/{id}/data-quality":{"get":{"operationId":"getDataQuality","summary":"数据质量","description":"接收/拒收/重复、迟到与未来时间、未知率、规则版本与过期、覆盖率（无分母时为 null）。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_data_quality","tags":["网站"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_data_quality"]}},"/api/v1/sites/{id}/settings":{"get":{"operationId":"getSiteSettings","summary":"网站设置","description":"时区、隐私模式、路由、属性白名单、页面分组、保留设置。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["网站"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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"},"cnzz_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","cnzz_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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_site_config"]},"patch":{"operationId":"updateSiteSettings","summary":"修改网站设置","description":"修改时区/归因规则会记录版本，不悄悄重写历史口径；缩短保留期需走高风险动作。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["网站"],"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"},"cnzz_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":"成功","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"},"cnzz_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","cnzz_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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/goals":{"get":{"operationId":"listGoals","summary":"目标列表","description":"目标（带版本）。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_goals","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_goals"]},"post":{"operationId":"createGoal","summary":"创建目标","description":"创建目标。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_goals","tags":["配置"],"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":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_goals"]}},"/api/v1/sites/{id}/goals/{goal_id}":{"patch":{"operationId":"updateGoal","summary":"修改目标","description":"修改目标，版本号 +1。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_goals","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_goals"]},"delete":{"operationId":"deleteGoal","summary":"删除目标","description":"删除目标（历史结果中的定义版本仍可查）。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_goals","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_goals"]}},"/api/v1/sites/{id}/funnels":{"get":{"operationId":"listFunnels","summary":"漏斗列表","description":"漏斗（带版本）。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_funnels","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_funnels"]},"post":{"operationId":"createFunnel","summary":"创建漏斗","description":"创建漏斗。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_funnels","tags":["配置"],"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":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_funnels"]}},"/api/v1/sites/{id}/funnels/{funnel_id}":{"patch":{"operationId":"updateFunnel","summary":"修改漏斗","description":"修改漏斗，版本号 +1。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_funnels","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_funnels"]},"delete":{"operationId":"deleteFunnel","summary":"删除漏斗","description":"删除漏斗（历史结果中的定义版本仍可查）。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_funnels","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_funnels"]}},"/api/v1/sites/{id}/filters":{"get":{"operationId":"listFilters","summary":"过滤器列表","description":"过滤器（带版本）。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_site_config"]},"post":{"operationId":"createFilter","summary":"创建过滤器","description":"创建过滤器。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/filters/{filter_id}":{"patch":{"operationId":"updateFilter","summary":"修改过滤器","description":"修改过滤器，版本号 +1。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]},"delete":{"operationId":"deleteFilter","summary":"删除过滤器","description":"删除过滤器（历史结果中的定义版本仍可查）。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/custom-dimensions":{"get":{"operationId":"listCustomDimensions","summary":"自定义维度列表","description":"自定义维度（带版本）。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_site_config"]},"post":{"operationId":"createCustomDimension","summary":"创建自定义维度","description":"创建自定义维度。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/custom-dimensions/{dimension_id}":{"patch":{"operationId":"updateCustomDimension","summary":"修改自定义维度","description":"修改自定义维度，版本号 +1。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]},"delete":{"operationId":"deleteCustomDimension","summary":"删除自定义维度","description":"删除自定义维度（历史结果中的定义版本仍可查）。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/campaign-costs":{"get":{"operationId":"listCampaignCosts","summary":"推广成本列表","description":"推广成本（带版本）。\n\n所需权限：`conversions:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["conversions:read"],"x-mcp-tools":["manage_site_config"]},"post":{"operationId":"createCampaignCost","summary":"创建推广成本","description":"创建推广成本。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/sites/{id}/campaign-costs/{cost_id}":{"patch":{"operationId":"updateCampaignCost","summary":"修改推广成本","description":"修改推广成本，版本号 +1。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]},"delete":{"operationId":"deleteCampaignCost","summary":"删除推广成本","description":"删除推广成本（历史结果中的定义版本仍可查）。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_site_config","tags":["配置"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["manage_site_config"]}},"/api/v1/collect/browser":{"post":{"operationId":"collectBrowser","summary":"浏览器事件上报","description":"SDK 通过 sendBeacon/fetch keepalive 上报。Site ID 只负责归属，不能读取数据。浏览器上报不能携带任何可信网络证据。\n\n限流：采集：按站点+IP 固定窗口限流（超限返回 429 与 retry-after）","tags":["采集"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"collect_browser","x-sitetrace-scopes":[]}},"/api/v1/collect/server":{"post":{"operationId":"collectServer","summary":"服务端批量上报（签名）","description":"使用只写采集凭证 + HMAC 签名（时间窗口、请求体摘要、nonce）。可上报订单转化、自定义事件与 HTTP 请求。\n\n限流：采集：按站点+IP 固定窗口限流（超限返回 429 与 retry-after）","tags":["采集"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ingestSignature":[]}],"x-sitetrace-auth":"collect_server","x-sitetrace-scopes":[]}},"/api/v1/collect/edge":{"post":{"operationId":"collectEdge","summary":"边缘适配器上报（签名）","description":"外部 Worker 适配器签名上报 HTTP 请求元数据。同账户建议使用 Service Binding RPC（信任等级更高）。\n\n限流：采集：按站点+IP 固定窗口限流（超限返回 429 与 retry-after）","tags":["采集"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ingestSignature":[]}],"x-sitetrace-auth":"collect_edge","x-sitetrace-scopes":[]}},"/api/v1/sites/{id}/overview":{"get":{"operationId":"getOverview","summary":"网站概况","description":"浏览器账本（PV/UV/会话/跳出率/有效停留）与 HTTP 账本（请求/AI/自动化/错误）两组指标分开返回，含同比/环比。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report、traffic_overview","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_overview"]}},"/api/v1/sites/{id}/trends":{"get":{"operationId":"getTrends","summary":"趋势分析","description":"分钟/小时/日/周/月趋势；支持今日昨日同时段、上周期、去年同期对比；时区与夏令时正确。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report、query_analytics","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report","query_analytics"]}},"/api/v1/sites/{id}/realtime":{"get":{"operationId":"getRealtime","summary":"实时访客","description":"最近 30 分钟分钟级 PV/请求、最近 5 分钟活跃访客（不是精确在线连接数）与最近页面/请求。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_realtime","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_realtime"]}},"/api/v1/sites/{id}/sources":{"get":{"operationId":"getSources","summary":"来源分析","description":"搜索、外链、直接/无来源、推广、AI 引荐；保留来源证据与归因限制。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report、traffic_breakdown","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/search-terms":{"get":{"operationId":"getSearchTerms","summary":"搜索词","description":"只展示实际可获得的搜索词，缺失显示“未提供”。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/pages":{"get":{"operationId":"getPages","summary":"页面分析","description":"受访页面、入口页、出口页、页面分组（view=pages|entry|exit|groups）。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report、traffic_breakdown","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/audience":{"get":{"operationId":"getAudience","summary":"访客属性","description":"新老访客、访问深度、国家地区、设备、浏览器、系统、语言（view=...）。不支持的字段显示未知。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report、traffic_breakdown","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/visitors":{"get":{"operationId":"getVisitors","summary":"访客明细","description":"访客级明细（仅 consented 模式）；站点级标识，不跨站。\n\n所需权限：`details:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_sessions","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["details:read"],"x-mcp-tools":["get_sessions"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/sessions":{"get":{"operationId":"listSiteSessions","summary":"会话列表","description":"会话级明细与路径摘要。\n\n所需权限：`details:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_sessions","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["details:read"],"x-mcp-tools":["get_sessions"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/sessions/{session_id}":{"get":{"operationId":"getSessionDetail","summary":"会话详情","description":"单个会话的事件时间线（字段为不可信原始数据）。\n\n所需权限：`details:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_sessions","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["details:read"],"x-mcp-tools":["get_sessions"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/paths":{"get":{"operationId":"getPaths","summary":"访问路径","description":"会话内页面转移（下一页）统计。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/events":{"get":{"operationId":"getEvents","summary":"事件分析","description":"自定义事件、站内搜索、下载、外链点击、自定义属性（view=...）。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report、get_event_details","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report","get_event_details"]}},"/api/v1/sites/{id}/conversions":{"get":{"operationId":"getConversions","summary":"转化分析","description":"目标完成、转化归因（末次非直接）、业务收入（按币种分列，需 revenue:read）。\n\n所需权限：`conversions:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["conversions:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/funnel-results":{"get":{"operationId":"getFunnelResults","summary":"漏斗结果","description":"按漏斗定义版本计算：窗口、顺序、分母、跨会话规则。需 funnel_id 查询参数。\n\n所需权限：`conversions:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["conversions:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/heatmaps":{"get":{"operationId":"getHeatmaps","summary":"点击区域与滚动深度","description":"白名单区域（data-analytics-region）点击与滚动深度；不采集文本、输入或完整 DOM。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report"]}},"/api/v1/sites/{id}/automation":{"get":{"operationId":"getAutomation","summary":"AI 与自动化分析","description":"按提供方/客户端/用途/验证状态/页面拆分；AI 抓取与 AI 引荐真人访问分开；不输出训练/引用次数。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report、traffic_breakdown","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["get_report","traffic_breakdown"]}},"/api/v1/sites/{id}/requests":{"get":{"operationId":"listRequests","summary":"最近请求 / HTTP 分析","description":"HTTP 状态、资源类型、路径集中度、重定向与错误（view=recent|status|resource|paths）。recent 视图为明细需 details:read。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_event_details、get_report","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-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":"单请求分类解释","description":"分类证据抽屉：主体、验证方式、证据列表、规则版本、信任等级。原始字段标记为 untrusted_data。\n\n所需权限：`details:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：explain_classification、traffic_explain","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["details:read"]},{"sessionCookie":["details:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["details:read"],"x-mcp-tools":["explain_classification","traffic_explain"],"x-untrusted-fields":true}},"/api/v1/sites/{id}/campaign-results":{"get":{"operationId":"getCampaignResults","summary":"推广活动效果","description":"UTM 活动的会话、转化、收入与已导入成本（未经授权不连接广告账户）。\n\n所需权限：`conversions:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_report","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["conversions:read"]},{"sessionCookie":["conversions:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["conversions:read"],"x-mcp-tools":["get_report"]}},"/api/v1/comparisons":{"post":{"operationId":"compareSites","summary":"多站对比","description":"真人相关指标、AI 引荐、AI 抓取、机器量、转化、用量与异常；各站 UV 相加只称“各站 UV 合计”。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：compare_sites","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["compare_sites"]}},"/api/v1/query":{"post":{"operationId":"runQuery","summary":"结构化查询","description":"白名单查询编译器（不接受 SQL）：指标、维度、筛选、排序全部校验，值参数化；超预算明确拒绝，不静默截断。\n\n所需权限：`summary:read`\n\n限流：查询类：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：query_analytics","tags":["报表"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["query_analytics"]}},"/api/v1/imports":{"post":{"operationId":"createImport","summary":"上传历史导入","description":"上传 CSV/JSON 旧报表并声明字段映射、时区与口径；生成错误行报告。\n\n所需权限：`imports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_imports","tags":["导入导出"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"来自旧统计系统的日汇总，口径未必与本系统一致","type":"string","maxLength":500}},"required":["site_id","format","content","mapping","timezone"]}}}},"responses":{"201":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/imports/{id}":{"get":{"operationId":"getImport","summary":"导入详情","description":"导入状态、错误行、重叠区间。\n\n所需权限：`imports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_imports","tags":["导入导出"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/imports/{id}/preview":{"post":{"operationId":"previewImport","summary":"预览导入","description":"按映射预览前 20 行，并标记与本地事实重叠的日期（重叠区间将不重复计数）。\n\n所需权限：`imports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_imports","tags":["导入导出"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/imports/{id}/commit":{"post":{"operationId":"commitImport","summary":"提交导入","description":"幂等提交为 imported_aggregate 来源；不与已覆盖区间的本地事实重复相加，不能重新分类为真人/AI。\n\n所需权限：`imports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_imports","tags":["导入导出"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["imports:write"]},{"sessionCookie":["imports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["imports:write"],"x-mcp-tools":["manage_imports"]}},"/api/v1/exports":{"get":{"operationId":"listExports","summary":"导出列表","description":"当前凭证可见的导出任务。\n\n所需权限：`exports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_export","tags":["导入导出"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["exports:write"],"x-mcp-tools":["get_export"]},"post":{"operationId":"createExport","summary":"创建导出","description":"CSV/JSON/NDJSON 导出任务；字段仍受读取 scope 限制；CSV 防公式注入。\n\n所需权限：`exports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：create_export","tags":["导入导出"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["exports:write"],"x-mcp-tools":["create_export"]}},"/api/v1/exports/{id}":{"get":{"operationId":"getExport","summary":"导出状态","description":"任务状态；创建凭证被撤销后状态为 revoked。\n\n所需权限：`exports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：get_export","tags":["导入导出"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["exports:write"],"x-mcp-tools":["get_export"]},"delete":{"operationId":"deleteExport","summary":"删除导出","description":"删除导出文件。\n\n所需权限：`exports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["导入导出"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["exports:write"]}},"/api/v1/exports/{id}/download":{"get":{"operationId":"downloadExport","summary":"下载导出文件","description":"下载时再次校验权限与创建授权是否仍有效。\n\n所需权限：`exports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["导入导出"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"文件内容","content":{"text/csv":{},"application/json":{},"application/x-ndjson":{}}},"400":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["exports:write"]},{"sessionCookie":["exports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["exports:write"]}},"/api/v1/saved-reports":{"get":{"operationId":"listSavedReports","summary":"已保存报表","description":"保存的结构化查询。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_saved_reports","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_saved_reports"]},"post":{"operationId":"createSavedReport","summary":"保存报表","description":"保存一个结构化查询（与 /query 同 Schema）。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_saved_reports","tags":["报表计划"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"相同键 + 相同参数重放返回首次结果；相同键不同参数返回 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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]}},"/api/v1/saved-reports/{id}":{"get":{"operationId":"getSavedReport","summary":"报表详情","description":"单个保存的报表。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_saved_reports","tags":["报表计划"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_saved_reports"]},"patch":{"operationId":"updateSavedReport","summary":"修改报表","description":"修改名称或查询。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_saved_reports","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]},"delete":{"operationId":"deleteSavedReport","summary":"删除报表","description":"删除保存的报表及其计划。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_saved_reports","tags":["报表计划"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]}},"/api/v1/report-runs":{"get":{"operationId":"listReportRuns","summary":"运行记录","description":"报表运行记录与投递结果（失败状态如实展示）。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_saved_reports","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_saved_reports"]},"post":{"operationId":"createReportRun","summary":"立即运行报表","description":"站内生成一次报表结果。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_saved_reports","tags":["报表计划"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"saved_report_id":{"type":"string"}},"required":["saved_report_id"]}}}},"responses":{"201":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"],"x-mcp-tools":["manage_saved_reports"]}},"/api/v1/report-schedules":{"get":{"operationId":"listReportSchedules","summary":"计划列表","description":"日报/周报计划。\n\n所需权限：`summary:read`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_schedules","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["summary:read"]},{"sessionCookie":["summary:read"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["summary:read"],"x-mcp-tools":["manage_schedules"]},"post":{"operationId":"createReportSchedule","summary":"创建计划","description":"按站点时区的日报/周报。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_schedules","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"],"x-mcp-tools":["manage_schedules"]}},"/api/v1/report-schedules/{id}":{"patch":{"operationId":"updateReportSchedule","summary":"修改计划","description":"修改计划。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_schedules","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"],"x-mcp-tools":["manage_schedules"]},"delete":{"operationId":"deleteReportSchedule","summary":"删除计划","description":"删除计划。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_schedules","tags":["报表计划"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"],"x-mcp-tools":["manage_schedules"]}},"/api/v1/destinations":{"get":{"operationId":"listDestinations","summary":"投递目标","description":"webhook（需验证）与可选邮件适配（未配置不得显示已发送）。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"]},"post":{"operationId":"createDestination","summary":"创建投递目标","description":"创建后为 pending_verification，需验证通过才会投递。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"]}},"/api/v1/destinations/{id}":{"patch":{"operationId":"updateDestination","summary":"修改投递目标","description":"修改名称或停用；修改 URL 需重新验证。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["报表计划"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"]},"delete":{"operationId":"deleteDestination","summary":"删除投递目标","description":"删除投递目标。\n\n所需权限：`reports:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["报表计划"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"]}},"/api/v1/destinations/{id}/verify":{"post":{"operationId":"verifyDestination","summary":"验证投递目标","description":"向 webhook 发送带签名的验证挑战，目标须原样返回挑战值（SSRF 防护同站点验证）。\n\n所需权限：`reports:write`\n\n限流：验证检查：每凭证每小时限流（超限返回 429 与 retry-after）","tags":["报表计划"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["reports:write"]},{"sessionCookie":["reports:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["reports:write"]}},"/api/v1/public-shares":{"get":{"operationId":"listPublicShares","summary":"公开分享列表","description":"当前工作区的公开分享。\n\n所需权限：`shares:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_public_shares","tags":["分享"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["shares:write"]},{"sessionCookie":["shares:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["shares:write"],"x-mcp-tools":["manage_public_shares"]},"post":{"operationId":"createPublicShare","summary":"创建公开分享","description":"只公开所选指标与粒度；ENABLE_PUBLIC_SHARES=false 时返回 FEATURE_DISABLED 并说明如何开启。需近期强认证。\n\n所需权限：`shares:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["分享"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["shares:write"]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":["shares:write"]}},"/api/v1/public-shares/{id}":{"delete":{"operationId":"deletePublicShare","summary":"撤销公开分享","description":"撤销后网页、API、MCP 与缓存同步失效。\n\n所需权限：`shares:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：manage_public_shares","tags":["分享"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["shares:write"]},{"sessionCookie":["shares:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["shares:write"],"x-mcp-tools":["manage_public_shares"]}},"/api/v1/public/{share_id}/report":{"get":{"operationId":"getPublicReport","summary":"公开分享报表","description":"服务端强制分享的字段、筛选、时间约束；不能经 /query 或 MCP 绕过。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["分享"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"share","x-sitetrace-scopes":[]}},"/api/v1/actions/preview":{"post":{"operationId":"previewAction","summary":"预览高风险动作","description":"只允许注册动作枚举（删除数据/站点/工作区、缩短保留期、开启公开分享、删除导出）。返回 payload 摘要、影响、期限与所需条件。不接受代码、SQL 或云端管理命令。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：preview_action","tags":["动作"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerCredential":["settings:write"]},{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"principal","x-sitetrace-scopes":["settings:write"],"x-mcp-tools":["preview_action"]}},"/api/v1/actions/{id}/execute":{"post":{"operationId":"executeAction","summary":"执行高风险动作","description":"仅浏览器会话 + 近期强认证可执行；校验 payload 摘要、权限、期限与资源版本。模型的一句“确认”不能替代授权。\n\n所需权限：`settings:write`\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）","tags":["动作"],"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":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"sessionCookie":["settings:write"]}],"x-sitetrace-auth":"session","x-sitetrace-scopes":["settings:write"]}},"/api/v1/classification/rulesets":{"get":{"operationId":"getClassificationRules","summary":"分类规则与注册表","description":"当前规则版本、客户端注册表（官方来源、用途、验证方式、更新时间、有效期）与 IP 清单状态。\n\n限流：默认：每凭证每分钟限流（超限返回 429 与 retry-after）\n\n对应 MCP 工具：discover_analytics","tags":["Schema"],"parameters":[],"responses":{"200":{"description":"成功","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.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"错误（见 error.code）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"x-sitetrace-auth":"public","x-sitetrace-scopes":[],"x-mcp-tools":["discover_analytics"]}}},"components":{"securitySchemes":{"bearerCredential":{"type":"http","scheme":"bearer","description":"只读/管理 API 凭证（stk_...）或短期引导令牌（stb_...）"},"sessionCookie":{"type":"apiKey","in":"cookie","name":"__Host-st_session","description":"浏览器会话（HttpOnly、SameSite=Strict）；写操作需同源 Origin"},"ingestSignature":{"type":"http","scheme":"bearer","description":"采集凭证（sti_...）+ X-SiteTrace-Timestamp / X-SiteTrace-Nonce / X-SiteTrace-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":"读取汇总报表（PV、UV、来源、页面排行、AI 汇总等），不含访客/请求级明细与收入","details:read":"读取访客、会话、单请求明细与分类证据（含路径、UA 等不可信原始字段）","conversions:read":"读取目标、漏斗与转化次数（不含收入金额）","revenue:read":"读取收入金额与订单","exports:write":"创建与下载导出文件（导出内容仍受其它读取 scope 限制）","imports:write":"上传并提交历史数据导入","sites:write":"添加/修改网站、分组、安装与验证","settings:write":"修改网站设置、目标、漏斗、过滤器、自定义维度、推广成本与保留设置","reports:write":"保存报表、创建计划与投递目标","shares:write":"创建/撤销公开分享（仍需服务端开启公开分享功能）","members:admin":"邀请、降级、移除成员","credentials:admin":"创建、轮换、吊销 API 凭证与授权","audit:read":"读取审计日志","usage:read":"读取用量、配额与成本估算"}}},"description":"仅用于 /mcp（授权码 + 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 凭证","OAuth 2.1 授权码 + PKCE"]}}