{"openapi":"3.1.0","info":{"title":"YAAP public API","version":"1.0.0"},"servers":[{"url":"https://yaap.sh/api/v1"}],"paths":{"/me":{"get":{"operationId":"get_access","description":"Inspect this credential's scopes and website grants.","security":[{"bearerAuth":[]}],"x-yaap-scopes":[],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"credentialId":{"type":"string"},"kind":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"siteIds":{"type":"array","items":{"type":"string"}},"allSites":{"type":"boolean"}},"required":["credentialId","kind","scopes","siteIds","allSites"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/capabilities":{"get":{"operationId":"get_capabilities","description":"Discover supported metrics, filters, limits, and authorization scopes.","security":[{"bearerAuth":[]}],"x-yaap-scopes":[],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"timezone":{"type":"string"},"grantedScopes":{"type":"array","items":{"type":"string"}},"operations":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["apiVersion","metricSemanticsVersion","timezone","grantedScopes","operations","limits"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/api-keys":{"get":{"operationId":"list_api_keys","description":"List credential metadata; secrets are never returned.","security":[{"ownerSession":[]}],"x-yaap-scopes":[],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"siteIds":{"type":"array","items":{"type":"string"}},"allSites":{"type":"boolean"},"expiresAt":{"type":"number"},"revokedAt":{"anyOf":[{"type":"number"},{"type":"null"}]},"kind":{"type":"string"}},"required":["id","name","hint","scopes","siteIds","allSites","expiresAt","revokedAt","kind"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"post":{"operationId":"create_api_key","description":"Create a scoped credential; store the returned token securely.","security":[{"ownerSession":[]}],"x-yaap-scopes":[],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["sites:read","sites:create","sites:write","reports:read","events:read","visitors:read","goals:read","goals:write","funnels:read","funnels:write","revenue:read","payments:read","settings:read","settings:write","retention:write","integrations:read","integrations:write","operations:read","audit:read"]}},"siteIds":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"allSites":{"type":"boolean"},"expiresAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","scopes","siteIds","allSites","expiresAt"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"token":{"type":"string"},"hint":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"siteIds":{"type":"array","items":{"type":"string"}},"allSites":{"type":"boolean"},"createdAt":{"type":"number"},"expiresAt":{"type":"number"}},"required":["id","name","token","hint","scopes","siteIds","allSites","createdAt","expiresAt"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/api-keys/{keyId}":{"delete":{"operationId":"revoke_api_key","description":"Revoke a credential immediately.","security":[{"ownerSession":[]}],"x-yaap-scopes":[],"parameters":[{"name":"keyId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/audit-log":{"get":{"operationId":"list_audit_log","description":"List authorized management audit records without secrets.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["audit:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"siteId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actorId":{"type":"string"},"siteId":{"anyOf":[{"type":"string"},{"type":"null"}]},"operation":{"type":"string"},"resourceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"fields":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"number"}},"required":["id","actorId","siteId","operation","resourceId","fields","createdAt"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites":{"get":{"operationId":"list_sites","description":"Find authorized websites by name.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["sites:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"search","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"origin":{"type":"string"},"createdAt":{"type":"number"},"revision":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","origin","createdAt","revision","timezone"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"post":{"operationId":"create_site","description":"Create a website and add it to this credential's site grants.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["sites:create"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"origin":{"type":"string","maxLength":512},"timezone":{"type":"string","maxLength":100}},"required":["name","origin"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"origin":{"type":"string"},"createdAt":{"type":"number"},"revision":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","origin","createdAt","revision","timezone"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}":{"get":{"operationId":"get_site","description":"Read website details and its revision before editing.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["sites:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"origin":{"type":"string"},"createdAt":{"type":"number"},"revision":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","origin","createdAt","revision","timezone"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"patch":{"operationId":"update_site","description":"Update website name, origin or reporting timezone; preserves history and ID.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["sites:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"origin":{"type":"string","maxLength":512},"timezone":{"type":"string","maxLength":100}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"origin":{"type":"string"},"createdAt":{"type":"number"},"revision":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","origin","createdAt","revision","timezone"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/tracking-rules":{"get":{"operationId":"get_tracking_rules","description":"Read origin/exclusion/bot rules and revision.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["settings:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"additionalOrigins":{"type":"array","items":{"type":"string"}},"allowAllDomains":{"type":"boolean"},"excludedPaths":{"type":"array","items":{"type":"string"}},"excludedHostnames":{"type":"array","items":{"type":"string"}},"excludeBots":{"type":"boolean"},"revision":{"type":"string"}},"required":["additionalOrigins","allowAllDomains","excludedPaths","excludedHostnames","excludeBots","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"patch":{"operationId":"update_tracking_rules","description":"Change rules for future collection; does not deploy a tracker or delete history.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["settings:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"additionalOrigins":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":512}},"allowAllDomains":{"type":"boolean"},"excludedPaths":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":512}},"excludedHostnames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":253}},"excludeBots":{"type":"boolean"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"additionalOrigins":{"type":"array","items":{"type":"string"}},"allowAllDomains":{"type":"boolean"},"excludedPaths":{"type":"array","items":{"type":"string"}},"excludedHostnames":{"type":"array","items":{"type":"string"}},"excludeBots":{"type":"boolean"},"revision":{"type":"string"}},"required":["additionalOrigins","allowAllDomains","excludedPaths","excludedHostnames","excludeBots","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/installation":{"get":{"operationId":"get_installation","description":"Generate a tracking snippet. The website implementer must install it; this does not change a running tracker.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["settings:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["full","anonymous","paused"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"siteId":{"type":"string"},"mode":{"type":"string","enum":["full","anonymous","paused"]},"trackerUrl":{"type":"string"},"snippet":{"type":"string"},"eventExample":{"type":"string"},"paymentEndpoint":{"type":"string"},"deploymentRequired":{"type":"boolean","const":true}},"required":["siteId","mode","trackerUrl","snippet","eventExample","paymentEndpoint","deploymentRequired"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/retention":{"get":{"operationId":"get_retention","description":"Read independent event/payment retention policies and revision.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["settings:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"eventRetentionDays":{"type":"number"},"paymentRetentionDays":{"type":"number"},"lastCleanupAt":{"anyOf":[{"type":"number"},{"type":"null"}]},"revision":{"type":"string"}},"required":["eventRetentionDays","paymentRetentionDays","lastCleanupAt","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"patch":{"operationId":"update_retention","description":"Change retention. Future cleanup deletes expired history permanently; 0 disables expiration.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["retention:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventRetentionDays":{"anyOf":[{"type":"number","const":0},{"type":"number","const":30},{"type":"number","const":90},{"type":"number","const":180},{"type":"number","const":365}]},"paymentRetentionDays":{"anyOf":[{"type":"number","const":0},{"type":"number","const":30},{"type":"number","const":90},{"type":"number","const":180},{"type":"number","const":365}]}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"eventRetentionDays":{"type":"number"},"paymentRetentionDays":{"type":"number"},"lastCleanupAt":{"anyOf":[{"type":"number"},{"type":"null"}]},"revision":{"type":"string"}},"required":["eventRetentionDays","paymentRetentionDays","lastCleanupAt","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/ingestion-status":{"get":{"operationId":"get_ingestion_status","description":"Inspect available delivery counters and freshness over the last 24 hours.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["operations:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"start":{"type":"number"},"asOf":{"type":"number"},"counters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"lastQueuedAt":{"anyOf":[{"type":"number"},{"type":"null"}]},"lastStoredAt":{"anyOf":[{"type":"number"},{"type":"null"}]},"hours":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}}},"required":["start","asOf","counters","lastQueuedAt","lastStoredAt","hours"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/overview":{"get":{"operationId":"get_overview","description":"Read headline traffic, browser and session metrics.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"object","properties":{"pageviews":{"type":"number"},"pagesViewed":{"type":"number"},"identifiedPageviews":{"type":"number"},"visitors":{"type":"number"},"sessions":{"type":"number"},"customEvents":{"type":"number"},"sessionMetrics":{"type":"object","properties":{"sessions":{"type":"number"},"pageviewSessions":{"type":"number"},"bouncedSessions":{"type":"number"},"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"averageDurationSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"entryPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}},"exitPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}}},"required":["sessions","pageviewSessions","bouncedSessions","bounceRate","averageDurationSeconds","entryPages","exitPages"],"additionalProperties":{}}},"required":["pageviews","pagesViewed","identifiedPageviews","visitors","sessions","customEvents","sessionMetrics"],"additionalProperties":{}},"comparison":{"anyOf":[{"type":"object","properties":{"pageviews":{"type":"number"},"pagesViewed":{"type":"number"},"identifiedPageviews":{"type":"number"},"visitors":{"type":"number"},"sessions":{"type":"number"},"customEvents":{"type":"number"},"sessionMetrics":{"type":"object","properties":{"sessions":{"type":"number"},"pageviewSessions":{"type":"number"},"bouncedSessions":{"type":"number"},"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"averageDurationSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"entryPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}},"exitPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}}},"required":["sessions","pageviewSessions","bouncedSessions","bounceRate","averageDurationSeconds","entryPages","exitPages"],"additionalProperties":{}}},"required":["pageviews","pagesViewed","identifiedPageviews","visitors","sessions","customEvents","sessionMetrics"],"additionalProperties":{}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/audience":{"get":{"operationId":"get_audience_report","description":"Read new/returning browsers and session frequency from retained history.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"object","properties":{"visitors":{"type":"number"},"newVisitors":{"type":"number"},"returningVisitors":{"type":"number"},"oneSession":{"type":"number"},"twoOrThreeSessions":{"type":"number"},"fourPlusSessions":{"type":"number"},"sessionsPerVisitor":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","newVisitors","returningVisitors","oneSession","twoOrThreeSessions","fourPlusSessions","sessionsPerVisitor"],"additionalProperties":{}},"comparison":{"anyOf":[{"type":"object","properties":{"visitors":{"type":"number"},"newVisitors":{"type":"number"},"returningVisitors":{"type":"number"},"oneSession":{"type":"number"},"twoOrThreeSessions":{"type":"number"},"fourPlusSessions":{"type":"number"},"sessionsPerVisitor":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","newVisitors","returningVisitors","oneSession","twoOrThreeSessions","fourPlusSessions","sessionsPerVisitor"],"additionalProperties":{}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/sessions":{"get":{"operationId":"get_session_report","description":"Read bounce rate, observed duration in seconds, and top entry/exit pages.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"object","properties":{"sessions":{"type":"number"},"pageviewSessions":{"type":"number"},"bouncedSessions":{"type":"number"},"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"averageDurationSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"entryPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}},"exitPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}}},"required":["sessions","pageviewSessions","bouncedSessions","bounceRate","averageDurationSeconds","entryPages","exitPages"],"additionalProperties":{}},"comparison":{"anyOf":[{"type":"object","properties":{"sessions":{"type":"number"},"pageviewSessions":{"type":"number"},"bouncedSessions":{"type":"number"},"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"averageDurationSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"entryPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}},"exitPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"number"}},"required":["path","sessions"],"additionalProperties":{}}}},"required":["sessions","pageviewSessions","bouncedSessions","bounceRate","averageDurationSeconds","entryPages","exitPages"],"additionalProperties":{}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/timeseries":{"get":{"operationId":"get_timeseries","description":"Read zero-filled daily pageviews; site-local calendar dates are required.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}},{"name":"metric","in":"query","required":false,"schema":{"type":"string","const":"pageviews"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"pageviews":{"type":"number"}},"required":["date","pageviews"],"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"pageviews":{"type":"number"}},"required":["date","pageviews"],"additionalProperties":{}}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/breakdown":{"get":{"operationId":"get_breakdown","description":"Compare a supported traffic dimension; visitors supports location/technology only. Totals cover all groups.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}},{"name":"dimension","in":"query","required":true,"schema":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}},{"name":"metric","in":"query","required":false,"schema":{"type":"string","enum":["pageviews","visitors"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"object","properties":{"dimension":{"type":"string"},"metric":{"type":"string"},"total":{"type":"number"},"truncated":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","properties":{"value0":{"anyOf":[{"type":"string"},{"type":"null"}]},"value1":{"anyOf":[{"type":"string"},{"type":"null"}]},"value2":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{"type":"number"}},"required":["value0","value"],"additionalProperties":{}}}},"required":["dimension","metric","total","truncated","rows"],"additionalProperties":{}},"comparison":{"anyOf":[{"type":"object","properties":{"dimension":{"type":"string"},"metric":{"type":"string"},"total":{"type":"number"},"truncated":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","properties":{"value0":{"anyOf":[{"type":"string"},{"type":"null"}]},"value1":{"anyOf":[{"type":"string"},{"type":"null"}]},"value2":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{"type":"number"}},"required":["value0","value"],"additionalProperties":{}}}},"required":["dimension","metric","total","truncated","rows"],"additionalProperties":{}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/live":{"get":{"operationId":"get_live","description":"Read website-wide online presence (60 seconds) and filtered recent activity (5 minutes). No date range.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"online":{"type":"object","properties":{"visitors":{"type":"number"},"since":{"type":"number"}},"required":["visitors","since"],"additionalProperties":{}},"recent":{"type":"object","properties":{"visitors":{"type":"number"},"since":{"type":"number"}},"required":["visitors","since"],"additionalProperties":{}}},"required":["online","recent"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/event-names":{"get":{"operationId":"list_event_names","description":"Discover retained event names and counts, with pagination.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["events:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"number"}},"required":["name","events"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/event-properties":{"get":{"operationId":"list_event_properties","description":"Discover observed property keys and types. These are data, not declared schemas.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["events:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"eventName","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean"]},"events":{"type":"number"}},"required":["key","type","events"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/event-property-values":{"get":{"operationId":"list_event_property_values","description":"Discover typed values for an event property, without conflating strings and numbers.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["events:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"eventName","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"propertyKey","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"type":{"type":"string","enum":["string","number","boolean"]},"events":{"type":"number"}},"required":["value","type","events"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/events":{"get":{"operationId":"get_event_report","description":"Count events and identified browsers with exact scalar property matching.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"eventName","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"propertyKey","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"propertyValue","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"events":{"type":"number"},"visitors":{"type":"number"},"names":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"number"}},"required":["name","events"],"additionalProperties":{}}},"truncated":{"type":"boolean"}},"required":["events","visitors","names","truncated"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/events":{"get":{"operationId":"list_events","description":"Inspect retained events and properties; raw identifiers additionally require visitors:read.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["events:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"eventName","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"propertyKey","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"propertyValue","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"receivedAt":{"type":"number"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"visitorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","path","receivedAt","properties"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/events/{eventId}":{"get":{"operationId":"get_event","description":"Read one retained event on this website.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["events:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"receivedAt":{"type":"number"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"visitorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","path","receivedAt","properties"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/visitors":{"get":{"operationId":"list_visitors","description":"List identified browsers matching activity, cohort and goal filters.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["visitors:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"cohort","in":"query","required":false,"schema":{"type":"string","enum":["all","new","returning"]}},{"name":"goalId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"visitorId":{"type":"string"},"firstSeen":{"type":"number"},"lastSeen":{"type":"number"},"sessions":{"type":"number"},"pageviews":{"type":"number"}},"required":["visitorId","firstSeen","lastSeen","sessions","pageviews"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/visitors/{visitorId}":{"get":{"operationId":"get_visitor","description":"Read a retained browser's activity summary; this is not verified person identity.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["visitors:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"visitorId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"visitorId":{"type":"string"},"firstSeen":{"type":"number"},"lastSeen":{"type":"number"},"sessions":{"type":"number"},"events":{"type":"number"}},"required":["visitorId","firstSeen","lastSeen","sessions","events"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/visitors/{visitorId}/journey":{"get":{"operationId":"get_visitor_journey","description":"Inspect session-grouped retained activity in pages of 100; payments require payments:read.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["visitors:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"visitorId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"visitorId":{"type":"string"},"firstSeen":{"type":"number"},"lastSeen":{"type":"number"},"sessions":{"type":"number"},"eventCount":{"type":"number"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"receivedAt":{"type":"number"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"visitorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","path","receivedAt","properties"],"additionalProperties":{}}},"payments":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"provider":{"type":"string","enum":["api","stripe"]},"mode":{"type":"string","enum":["test","live"]},"currency":{"type":"string"},"amount":{"type":"number"},"refundedAmount":{"type":"number"},"paidAt":{"type":"number"},"visitorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"landingPage":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["externalId","provider","mode","currency","amount","refundedAmount","paidAt"],"additionalProperties":{}}}},"required":["visitorId","firstSeen","lastSeen","sessions","eventCount","events"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/goals":{"get":{"operationId":"list_goals","description":"List goal definitions without evaluating reports.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["goals:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["false","true","all"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"eventName":{"type":"string"},"path":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["id","siteId","name","icon","archived","createdAt","revision","eventName","path","conditions"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"post":{"operationId":"create_goal","description":"Create a goal; exact typed conditions apply to the same event.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["goals:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"icon":{"type":"string","maxLength":64},"eventName":{"type":"string","maxLength":64},"path":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"conditions":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"eventName":{"type":"string"},"path":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["id","siteId","name","icon","archived","createdAt","revision","eventName","path","conditions"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/goals/{goalId}":{"get":{"operationId":"get_goal","description":"Read a goal definition and revision.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["goals:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"goalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"eventName":{"type":"string"},"path":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["id","siteId","name","icon","archived","createdAt","revision","eventName","path","conditions"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"patch":{"operationId":"update_goal","description":"Edit or archive/restore a goal. Edits recalculate retained historical results.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["goals:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"goalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"icon":{"type":"string","maxLength":64},"eventName":{"type":"string","maxLength":64},"path":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"conditions":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}},"archived":{"type":"boolean"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"eventName":{"type":"string"},"path":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["id","siteId","name","icon","archived","createdAt","revision","eventName","path","conditions"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/funnels":{"get":{"operationId":"list_funnels","description":"List funnel definitions without evaluating reports.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["funnels:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["false","true","all"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"scope":{"type":"string","enum":["visitor","session"]},"windowHours":{"type":"number"},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","value"],"additionalProperties":{}}},"updatedAt":{"type":"number"}},"required":["id","siteId","name","icon","archived","createdAt","revision","scope","windowHours","steps","updatedAt"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"post":{"operationId":"create_funnel","description":"Create a funnel; exact typed conditions apply to the same event.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["funnels:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"icon":{"type":"string","maxLength":64},"scope":{"type":"string","enum":["visitor","session"]},"windowHours":{"anyOf":[{"type":"number","const":1},{"type":"number","const":24},{"type":"number","const":168},{"type":"number","const":720}]},"steps":{"minItems":2,"maxItems":8,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string","maxLength":1024},"conditions":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","value"],"additionalProperties":false}}},"required":["name","scope","windowHours","steps"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"scope":{"type":"string","enum":["visitor","session"]},"windowHours":{"type":"number"},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","value"],"additionalProperties":{}}},"updatedAt":{"type":"number"}},"required":["id","siteId","name","icon","archived","createdAt","revision","scope","windowHours","steps","updatedAt"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/funnels/{funnelId}":{"get":{"operationId":"get_funnel","description":"Read a funnel definition and revision.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["funnels:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"funnelId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"scope":{"type":"string","enum":["visitor","session"]},"windowHours":{"type":"number"},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","value"],"additionalProperties":{}}},"updatedAt":{"type":"number"}},"required":["id","siteId","name","icon","archived","createdAt","revision","scope","windowHours","steps","updatedAt"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"patch":{"operationId":"update_funnel","description":"Edit or archive/restore a funnel. Edits recalculate retained historical results.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["funnels:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"funnelId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"icon":{"type":"string","maxLength":64},"scope":{"type":"string","enum":["visitor","session"]},"windowHours":{"anyOf":[{"type":"number","const":1},{"type":"number","const":24},{"type":"number","const":168},{"type":"number","const":720}]},"steps":{"minItems":2,"maxItems":8,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string","maxLength":1024},"conditions":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":256},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","value"],"additionalProperties":false}},"archived":{"type":"boolean"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"siteId":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"number"},"revision":{"type":"string"},"scope":{"type":"string","enum":["visitor","session"]},"windowHours":{"type":"number"},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","value"],"additionalProperties":{}}},"updatedAt":{"type":"number"}},"required":["id","siteId","name","icon","archived","createdAt","revision","scope","windowHours","steps","updatedAt"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/goals":{"get":{"operationId":"get_goal_report","description":"Read goal completions, converted sessions, explicit denominator and conversion rate.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}},{"name":"goalId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"completions":{"type":"number"},"identifiedCompletions":{"type":"number"},"convertedSessions":{"type":"number"},"eligibleSessions":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","name","completions","identifiedCompletions","convertedSessions","eligibleSessions","conversionRate"],"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"completions":{"type":"number"},"identifiedCompletions":{"type":"number"},"convertedSessions":{"type":"number"},"eligibleSessions":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","name","completions","identifiedCompletions","convertedSessions","eligibleSessions","conversionRate"],"additionalProperties":{}}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/funnels/{funnelId}/report":{"get":{"operationId":"get_funnel_report","description":"Evaluate one ordered funnel and its drop-off. Do not automatically poll this expensive report.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["reports:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"funnelId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"funnelId":{"type":"string"},"current":{"type":"object","properties":{"entrants":{"type":"number"},"completed":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"reached":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"stepConversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"dropOff":{"type":"number"},"dropOffRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["kind","value","reached","conversionRate","stepConversionRate","dropOff","dropOffRate"],"additionalProperties":{}}}},"required":["entrants","completed","conversionRate","steps"],"additionalProperties":{}},"comparison":{"anyOf":[{"type":"object","properties":{"entrants":{"type":"number"},"completed":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["page","event"]},"value":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"reached":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"stepConversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"dropOff":{"type":"number"},"dropOffRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["kind","value","reached","conversionRate","stepConversionRate","dropOff","dropOffRate"],"additionalProperties":{}}}},"required":["entrants","completed","conversionRate","steps"],"additionalProperties":{}},{"type":"null"}]}},"required":["funnelId","current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/revenue":{"get":{"operationId":"get_revenue_report","description":"Read revenue/refunds/net by currency in minor units; never sum currencies. Attribution uses per-payment snapshots with model, lookback, pending/finalized status and unmatched reason.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["revenue:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}},{"name":"mode","in":"query","required":true,"schema":{"type":"string","enum":["test","live"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"},"refunds":{"type":"number"},"net":{"type":"number"},"payments":{"type":"number"},"customers":{"type":"number"}},"required":["currency","amount","refunds","net","payments","customers"],"additionalProperties":{}}},"comparison":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"},"refunds":{"type":"number"},"net":{"type":"number"},"payments":{"type":"number"},"customers":{"type":"number"}},"required":["currency","amount","refunds","net","payments","customers"],"additionalProperties":{}}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/reports/revenue/breakdown":{"get":{"operationId":"get_revenue_breakdown","description":"Break down attributed revenue by source, campaign or landing page, retaining currencies.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["revenue:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"compare","in":"query","required":false,"schema":{"type":"string","const":"previous_period"}},{"name":"mode","in":"query","required":true,"schema":{"type":"string","enum":["test","live"]}},{"name":"dimension","in":"query","required":true,"schema":{"type":"string","enum":["source","campaign","landingPage"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"object","properties":{"dimension":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"},"refunds":{"type":"number"},"net":{"type":"number"},"payments":{"type":"number"},"customers":{"type":"number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["currency","amount","refunds","net","payments","customers","label"],"additionalProperties":{}}},"truncated":{"type":"boolean"}},"required":["dimension","rows","truncated"],"additionalProperties":{}},"comparison":{"anyOf":[{"type":"object","properties":{"dimension":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"},"refunds":{"type":"number"},"net":{"type":"number"},"payments":{"type":"number"},"customers":{"type":"number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["currency","amount","refunds","net","payments","customers","label"],"additionalProperties":{}}},"truncated":{"type":"boolean"}},"required":["dimension","rows","truncated"],"additionalProperties":{}},{"type":"null"}]}},"required":["current","comparison"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/payments":{"get":{"operationId":"list_payments","description":"Inspect recorded analytics payments; this does not charge or refund customers.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["payments:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"path","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"browser","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"os","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"device","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"referrer","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"unknown","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"maxItems":11,"type":"array","items":{"type":"string","enum":["country","path","browser","source","os","device","referrer","campaign","region","city"]}}]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"mode","in":"query","required":true,"schema":{"type":"string","enum":["test","live"]}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","enum":["api","stripe"]}},{"name":"visitorId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"provider":{"type":"string","enum":["api","stripe"]},"mode":{"type":"string","enum":["test","live"]},"currency":{"type":"string"},"amount":{"type":"number"},"refundedAmount":{"type":"number"},"paidAt":{"type":"number"},"visitorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"landingPage":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["externalId","provider","mode","currency","amount","refundedAmount","paidAt"],"additionalProperties":{}}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/payments/{provider}/{mode}/{externalId}":{"get":{"operationId":"get_payment","description":"Read a payment using its provider, mode and external ID.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["payments:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["api","stripe"]}},{"name":"mode","in":"path","required":true,"schema":{"type":"string","enum":["test","live"]}},{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"externalId":{"type":"string"},"provider":{"type":"string","enum":["api","stripe"]},"mode":{"type":"string","enum":["test","live"]},"currency":{"type":"string"},"amount":{"type":"number"},"refundedAmount":{"type":"number"},"paidAt":{"type":"number"},"visitorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"landingPage":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["externalId","provider","mode","currency","amount","refundedAmount","paidAt"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/payment-integration":{"get":{"operationId":"get_payment_integration","description":"Read integration status, webhook URLs and revision, never secrets.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["integrations:read"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"apiKeyHint":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeTest":{"type":"boolean"},"stripeLive":{"type":"boolean"},"revision":{"type":"string"},"webhooks":{"type":"object","properties":{"test":{"type":"string"},"live":{"type":"string"}},"required":["test","live"],"additionalProperties":{}}},"required":["apiKeyHint","stripeTest","stripeLive","revision","webhooks"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/payment-integration/stripe/{mode}":{"put":{"operationId":"set_stripe","description":"Configure a Stripe webhook signing secret.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["integrations:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"mode","in":"path","required":true,"schema":{"type":"string","enum":["test","live"]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string","minLength":1,"maxLength":262}},"required":["secret"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"updated":{"type":"boolean","const":true},"revision":{"type":"string"},"token":{"type":"string"},"disconnected":{"type":"boolean"}},"required":["updated","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"delete":{"operationId":"disconnect_stripe","description":"Disconnect Stripe ingestion for one mode; future deliveries cannot be verified.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["integrations:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"mode","in":"path","required":true,"schema":{"type":"string","enum":["test","live"]}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"updated":{"type":"boolean","const":true},"revision":{"type":"string"},"token":{"type":"string"},"disconnected":{"type":"boolean"}},"required":["updated","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}},"/sites/{siteId}/payment-integration/api-key":{"post":{"operationId":"rotate_payment_ingestion_key","description":"Rotate the payment ingestion key. Existing senders need the returned replacement.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["integrations:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"updated":{"type":"boolean","const":true},"revision":{"type":"string"},"token":{"type":"string"},"disconnected":{"type":"boolean"}},"required":["updated","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}},"delete":{"operationId":"revoke_payment_ingestion_key","description":"Revoke payment ingestion; existing senders will stop working.","security":[{"bearerAuth":[]}],"x-yaap-scopes":["integrations:write"],"parameters":[{"name":"siteId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"updated":{"type":"boolean","const":true},"revision":{"type":"string"},"token":{"type":"string"},"disconnected":{"type":"boolean"}},"required":["updated","revision"],"additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"apiVersion":{"type":"string"},"metricSemanticsVersion":{"type":"string"},"asOf":{"type":"number"},"revision":{"type":"string"}},"required":["requestId","apiVersion","metricSemanticsVersion","asOf"],"additionalProperties":{}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nextCursor"],"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":{}}}}},"default":{"description":"Structured error with code, message and requestId","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"ownerSession":{"type":"apiKey","in":"cookie","name":"os-analytics.session_token"}}}}