{"openapi":"3.1.0","info":{"title":"datacub analytics API","version":"1.0.0","description":"Read the analytics of your projects with the same typed questions the datacub dashboard asks. Sign in with a read key (rk_) for a session cookie, or connect an AI agent to the MCP server at /mcp with a token (datacub_mcp_) from Settings, MCP and AI."},"servers":[{"url":"/","description":"This datacub: the same origin as the dashboard"}],"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"xs"},"mcpToken":{"type":"http","scheme":"bearer","description":"datacub_mcp_ token"}},"schemas":{"Query":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"overview"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"browser","type":"string","enum":["browser","person"]},"compare":{"default":true,"type":"boolean"},"returning":{"default":true,"type":"boolean"}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"trend"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"browser","type":"string","enum":["browser","person"]},"interval":{"default":"day","type":"string","enum":["hour","day","week","month"]},"measure":{"default":"events","type":"string","enum":["events","pageviews","visitors","known_users","sessions"]},"breakdown":{"type":"string","maxLength":220},"compare":{"default":false,"type":"boolean"}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"breakdown"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"browser","type":"string","enum":["browser","person"]},"by":{"type":"string","maxLength":220},"measure":{"default":"visitors","type":"string","enum":["events","pageviews","visitors","known_users","sessions"]},"limit":{"default":10,"type":"integer","minimum":1,"maximum":100},"search":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","range","by"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"funnel"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]},"steps":{"minItems":2,"maxItems":6,"type":"array","items":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":400},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["event"],"additionalProperties":false}},"conditions":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["did","not","new","returning"]},"event":{"type":"string","minLength":1,"maxLength":200},"period":{"type":"string","enum":["range","ever","today","yesterday","7d","30d","90d","week","month","since"]}},"required":["type","period"],"additionalProperties":false}},"window":{"default":{"value":1,"unit":"day"},"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":10000},"unit":{"type":"string","enum":["minute","hour","day"]}},"required":["value","unit"],"additionalProperties":false},"entry":{"default":"attempts","type":"string","enum":["attempts","first"]},"breakdown":{"type":"string","maxLength":220},"limit":{"default":10,"type":"integer","minimum":1,"maximum":25}},"required":["kind","range","steps"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"funnel_people"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]},"steps":{"minItems":2,"maxItems":6,"type":"array","items":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":400},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["event"],"additionalProperties":false}},"conditions":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["did","not","new","returning"]},"event":{"type":"string","minLength":1,"maxLength":200},"period":{"type":"string","enum":["range","ever","today","yesterday","7d","30d","90d","week","month","since"]}},"required":["type","period"],"additionalProperties":false}},"window":{"default":{"value":1,"unit":"day"},"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":10000},"unit":{"type":"string","enum":["minute","hour","day"]}},"required":["value","unit"],"additionalProperties":false},"entry":{"default":"attempts","type":"string","enum":["attempts","first"]},"step":{"type":"integer","minimum":1,"maximum":6},"who":{"default":"at","type":"string","enum":["at","reached","dropped","pending"]},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["browser","user"]},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["type","id"],"additionalProperties":false}},"required":["kind","range","steps","step"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"funnel_next"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]},"steps":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":400},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["event"],"additionalProperties":false}},"conditions":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["did","not","new","returning"]},"event":{"type":"string","minLength":1,"maxLength":200},"period":{"type":"string","enum":["range","ever","today","yesterday","7d","30d","90d","week","month","since"]}},"required":["type","period"],"additionalProperties":false}},"window":{"default":{"value":1,"unit":"day"},"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":10000},"unit":{"type":"string","enum":["minute","hour","day"]}},"required":["value","unit"],"additionalProperties":false},"stopped":{"type":"integer","minimum":1,"maximum":5},"limit":{"default":8,"type":"integer","minimum":1,"maximum":20}},"required":["kind","range","steps"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"retention"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]},"period":{"default":"week","type":"string","enum":["day","week","month"]},"periods":{"default":8,"type":"integer","minimum":1,"maximum":31},"start":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":400},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["event"],"additionalProperties":false},"return":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":400},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["event"],"additionalProperties":false},"mode":{"default":"exact","type":"string","enum":["exact","on_or_after"]}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lifecycle"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]},"interval":{"default":"week","type":"string","enum":["day","week","month"]}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"active"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"stickiness"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]},"engagement":{"type":"object","properties":{"activity":{"$ref":"#/components/schemas/__schema0"},"filters":{"$ref":"#/components/schemas/__schema0"},"cohort":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"active"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"days"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"min":{"type":"integer","minimum":1,"maximum":31},"max":{"type":"integer","minimum":1,"maximum":31}},"required":["kind","from","to","min","max"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lifecycle"},"interval":{"type":"string","enum":["day","week","month"]},"period":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"state":{"type":"string","enum":["new","returning","resurrecting","dormant","inactive"]}},"required":["kind","interval","period","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"retention"},"period":{"type":"string","enum":["day","week","month"]},"cohort":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"offset":{"type":"integer","minimum":1,"maximum":31},"returned":{"type":"boolean"},"mode":{"default":"exact","type":"string","enum":["exact","on_or_after"]},"last":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","period","cohort","offset","returned"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"when"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"weekday":{"type":"integer","minimum":0,"maximum":6},"hour":{"type":"integer","minimum":0,"maximum":23}},"required":["kind","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"status"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"state":{"type":"string","enum":["new","returning","stopped","back"]}},"required":["kind","from","to","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"success"},"event":{"type":"string","minLength":1,"maxLength":200},"days":{"type":"integer","minimum":1,"maximum":30},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reached":{"type":"boolean"}},"required":["kind","event","days","from","to","reached"],"additionalProperties":false}]}},"required":["activity","cohort"],"additionalProperties":false}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"activation"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"activity":{"$ref":"#/components/schemas/__schema0"},"event":{"type":"string","minLength":1,"maxLength":200},"days":{"default":7,"type":"integer","minimum":1,"maximum":30}},"required":["kind","range","activity","event"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"engagement"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"section":{"type":"string","enum":["active","when","returns","frequency","lifecycle","visits","did"]},"every":{"default":"month","type":"string","enum":["week","month"]},"engagement":{"type":"object","properties":{"activity":{"$ref":"#/components/schemas/__schema0"},"filters":{"$ref":"#/components/schemas/__schema0"},"cohort":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"active"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"days"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"min":{"type":"integer","minimum":1,"maximum":31},"max":{"type":"integer","minimum":1,"maximum":31}},"required":["kind","from","to","min","max"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lifecycle"},"interval":{"type":"string","enum":["day","week","month"]},"period":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"state":{"type":"string","enum":["new","returning","resurrecting","dormant","inactive"]}},"required":["kind","interval","period","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"retention"},"period":{"type":"string","enum":["day","week","month"]},"cohort":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"offset":{"type":"integer","minimum":1,"maximum":31},"returned":{"type":"boolean"},"mode":{"default":"exact","type":"string","enum":["exact","on_or_after"]},"last":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","period","cohort","offset","returned"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"when"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"weekday":{"type":"integer","minimum":0,"maximum":6},"hour":{"type":"integer","minimum":0,"maximum":23}},"required":["kind","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"status"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"state":{"type":"string","enum":["new","returning","stopped","back"]}},"required":["kind","from","to","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"success"},"event":{"type":"string","minLength":1,"maxLength":200},"days":{"type":"integer","minimum":1,"maximum":30},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reached":{"type":"boolean"}},"required":["kind","event","days","from","to","reached"],"additionalProperties":false}]}},"required":["activity","cohort"],"additionalProperties":false}},"required":["kind","range","section"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"rhythm"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"person","type":"string","enum":["browser","person"]}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"actions"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"activity":{"$ref":"#/components/schemas/__schema0"},"limit":{"default":8,"type":"integer","minimum":1,"maximum":20}},"required":["kind","range","activity"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"sessions"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"browser","type":"string","enum":["browser","person"]},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"events"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"identity":{"default":"browser","type":"string","enum":["browser","person"]},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100},"cursor":{"type":"string","maxLength":200}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"people"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"search":{"type":"string","minLength":1,"maxLength":128},"funnel":{"type":"object","properties":{"steps":{"minItems":2,"maxItems":6,"type":"array","items":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":400},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["event"],"additionalProperties":false}},"window":{"default":{"value":1,"unit":"day"},"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":10000},"unit":{"type":"string","enum":["minute","hour","day"]}},"required":["value","unit"],"additionalProperties":false},"filters":{"$ref":"#/components/schemas/__schema0"},"conditions":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["did","not","new","returning"]},"event":{"type":"string","minLength":1,"maxLength":200},"period":{"type":"string","enum":["range","ever","today","yesterday","7d","30d","90d","week","month","since"]}},"required":["type","period"],"additionalProperties":false}},"step":{"type":"integer","minimum":1,"maximum":6},"who":{"default":"reached","type":"string","enum":["at","reached","dropped","pending"]}},"required":["steps","step"],"additionalProperties":false},"status":{"default":"all","type":"string","enum":["all","identified","anonymous"]},"conditions":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["did","not","new","returning"]},"event":{"type":"string","minLength":1,"maxLength":200},"period":{"type":"string","enum":["range","ever","today","yesterday","7d","30d","90d","week","month","since"]}},"required":["type","period"],"additionalProperties":false}},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["browser","user"]},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["type","id"],"additionalProperties":false},"power":{"default":false,"type":"boolean"},"engagement":{"type":"object","properties":{"activity":{"$ref":"#/components/schemas/__schema0"},"filters":{"$ref":"#/components/schemas/__schema0"},"cohort":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"active"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"days"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"min":{"type":"integer","minimum":1,"maximum":31},"max":{"type":"integer","minimum":1,"maximum":31}},"required":["kind","from","to","min","max"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lifecycle"},"interval":{"type":"string","enum":["day","week","month"]},"period":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"state":{"type":"string","enum":["new","returning","resurrecting","dormant","inactive"]}},"required":["kind","interval","period","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"retention"},"period":{"type":"string","enum":["day","week","month"]},"cohort":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"offset":{"type":"integer","minimum":1,"maximum":31},"returned":{"type":"boolean"},"mode":{"default":"exact","type":"string","enum":["exact","on_or_after"]},"last":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","period","cohort","offset","returned"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"when"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"weekday":{"type":"integer","minimum":0,"maximum":6},"hour":{"type":"integer","minimum":0,"maximum":23}},"required":["kind","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"status"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"state":{"type":"string","enum":["new","returning","stopped","back"]}},"required":["kind","from","to","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"success"},"event":{"type":"string","minLength":1,"maxLength":200},"days":{"type":"integer","minimum":1,"maximum":30},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reached":{"type":"boolean"}},"required":["kind","event","days","from","to","reached"],"additionalProperties":false}]}},"required":["activity","cohort"],"additionalProperties":false},"sort":{"default":"last_seen","type":"string","enum":["last_seen","events","sessions"]},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100},"cursor":{"type":"string","maxLength":300}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"paths"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"},"start":{"type":"string","minLength":1,"maxLength":400},"goal":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":400},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["event"],"additionalProperties":false},"depth":{"default":3,"type":"integer","minimum":2,"maximum":5},"width":{"default":5,"type":"integer","minimum":2,"maximum":8}},"required":["kind","range"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"timeline"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["browser","user"]},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["type","id"],"additionalProperties":false},"limit":{"default":200,"type":"integer","minimum":1,"maximum":500}},"required":["kind","range","subject"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"journey"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["browser","user"]},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["type","id"],"additionalProperties":false},"sessions":{"default":10,"type":"integer","minimum":1,"maximum":50},"cursor":{"type":"string","maxLength":200}},"required":["kind","range","subject"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"values"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"field":{"type":"string","maxLength":220},"limit":{"default":20,"type":"integer","minimum":1,"maximum":50}},"required":["kind","range","field"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"schema"},"range":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"timezone":{"type":"string","maxLength":64},"filters":{"$ref":"#/components/schemas/__schema0"}},"required":["kind","range"],"additionalProperties":false}]},"__schema0":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","maxLength":220},"op":{"type":"string","enum":["eq","neq","in","not_in","gt","gte","lt","lte","between","contains","not_contains","starts_with","ends_with","exists","not_exists"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]},{"minItems":1,"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}}]}},"required":["field","op"],"additionalProperties":false},{"type":"object","properties":{"and":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/__schema0"}}},"required":["and"],"additionalProperties":false},{"type":"object","properties":{"or":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/__schema0"}}},"required":["or"],"additionalProperties":false}]}}},"paths":{"/api/session":{"post":{"summary":"Open a session with a read key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^rk_(live|test)_[A-Za-z0-9]{32}$"}},"required":["key"]}}}},"responses":{"200":{"description":"Sets the xs session cookie"},"401":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Close the session","security":[{"session":[]}],"responses":{"200":{"description":"Closed"}}}},"/api/projects":{"get":{"summary":"The organisation's projects","security":[{"session":[]}],"responses":{"200":{"description":"Projects and your role","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"enum":["owner","admin","analyst","viewer"]},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string"}}}}}}}}},"401":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/projects/{id}/query":{"post":{"summary":"Ask one analytics question","description":"The body is a typed query model (never SQL). People, event and session lists need the analyst role. Errors are codes such as invalid_query, range_too_long, busy (429) or timeout (504).","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Query"}}}},"responses":{"200":{"description":"{meta, data}; data depends on the kind","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"object"},"data":{}},"required":["meta","data"]}}}},"400":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/mcp":{"post":{"summary":"MCP server (Streamable HTTP, JSON-RPC 2.0)","description":"Model Context Protocol for AI agents. Read only unless the token has write:events. Aggregates only; groups under 10 people come back as null.","security":[{"mcpToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"JSON-RPC response"},"401":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"A typed error code; no SQL, value or stack ever leaves","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}