{"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. AI tools connect to the MCP server at /mcp with OAuth sign-in (Settings, Connect and AI); a datacub_mcp_ token still works."},"servers":[{"url":"/","description":"This datacub: the same origin as the dashboard"}],"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"xs","description":"session cookie from POST /api/session"},"readKey":{"type":"http","scheme":"bearer","description":"rk_ read key allowed to handle person requests; server only"},"mcpToken":{"type":"http","scheme":"bearer","description":"an OAuth access token (the client signs in through /.well-known/oauth-protected-resource/mcp), or a 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":"speed"},"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":{"default":"pathname","type":"string","maxLength":220},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100},"compare":{"default":true,"type":"boolean"},"goal":{"type":"string","minLength":1,"maxLength":200}},"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":400},"max":{"type":"integer","minimum":1,"maximum":400}},"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","time_pages","did","often","days"]},"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":400},"max":{"type":"integer","minimum":1,"maximum":400}},"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":400},"max":{"type":"integer","minimum":1,"maximum":400}},"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":"heatmap"},"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"},"pathname":{"type":"string","minLength":1,"maxLength":400},"split":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":200}},"required":["event"],"additionalProperties":false},"who":{"type":"object","properties":{"did":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["did"],"additionalProperties":false}},"required":["kind","range","pathname"],"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},"page":{"type":"integer","minimum":1,"maximum":10000},"order":{"default":"newest","type":"string","enum":["newest","oldest"]}},"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","not_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":"Your projects, each with your role on it","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"public_id":{"type":"string","description":"the 8-character project ID"},"name":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string"},"role":{"enum":["owner","admin","analyst","viewer"]}}}}}}}}},"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"]}}}}}}},"/api/backend/projects/{id}/persons/{type}/{pid}":{"delete":{"summary":"Delete a person's data","description":"A Registered user (type user) with every browser and phone linked to them, or a Guest (type browser)","security":[{"readKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["user","browser"]}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"},"description":"the user ID passed to identify, or the Guest ID from the datacub_id cookie"}],"responses":{"202":{"description":"{id, status}: status deleted, or held during a legal hold","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"enum":["deleted","held"]}}}}}},"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"]}}}},"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"]}}}}}}},"/api/backend/projects/{id}/persons/{type}/{pid}/export":{"get":{"summary":"Export a person's data","description":"Everything datacub holds about them, as one JSON document","security":[{"readKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["user","browser"]}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"},"description":"the user ID passed to identify, or the Guest ID from the datacub_id cookie"}],"responses":{"200":{"description":"datacub.person_export.v1"},"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"]}}}},"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"]}}}}}}},"/api/backend/projects/{id}/consent/revoke":{"post":{"summary":"Report a withdrawal of consent","description":"Deletes what was collected about the person, as a deletion does","security":[{"readKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string"},"anon_id":{"type":"string"}}}}}},"responses":{"202":{"description":"{id, status}: status deleted, or held during a legal hold","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"enum":["deleted","held"]}}}}}},"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"]}}}},"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"]}}}}}}},"/api/backend/projects/{id}/tombstones/user/{pid}":{"delete":{"summary":"Allow a deleted user ID again","description":"Events for this user ID are accepted again from now on; nothing deleted returns","security":[{"readKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ok: true}"},"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 tools. Every number is exact, the same as the dashboard, and every answer carries a url to the same view. Read only unless the connection was allowed to make changes (scope write:events) and the person is an analyst or above. People one by one (find_people, get_person) need the analyst role; email, name and phone never leave. ?readonly=1, ?features=<areas> and ?tools=<names> narrow the tools. 300 requests a minute per connection.","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"]}}}}}}}}}