{"service":"Agent Tools","endpoint":"/v1/cohort/retention","method":"POST","content_type":"application/json","inputSchema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","minItems":1,"maxItems":4000,"description":"Each event needs user_id and a timestamp (time_unix_s in seconds since 1970, or time as ISO 8601). Optional: type and value. Any other field name is rejected rather than guessed. The service caps the whole request body at 256 KB, so long records reach that limit before maxItems."},"period":{"type":"string","enum":["day","week","month"],"default":"week"},"periods":{"type":"integer","minimum":1,"maximum":52,"default":12,"description":"How many periods the table runs, period 0 being the entry period."},"week_start":{"type":"string","enum":["monday","sunday"],"default":"monday"},"timezone_offset_s":{"type":"integer","minimum":-50400,"maximum":50400,"default":0,"description":"Offset from UTC in seconds used to place period boundaries."},"activation_type":{"type":"string","maxLength":120,"description":"If set, only events of this type put a user into a cohort. Without it the first event of any type counts."},"retention_types":{"type":"array","maxItems":50,"items":{"type":"string"},"description":"If set, only events of these types count as being active. Without it every event counts."}}},"requestExample":{"events":[{"user_id":"u1","time_unix_s":1785110400,"type":"order","value":19.9},{"user_id":"u1","time_unix_s":1785715200,"type":"order","value":24.5},{"user_id":"u2","time_unix_s":1785110400,"type":"order","value":12},{"user_id":"u3","time_unix_s":1785715200,"type":"order","value":30}],"period":"week","periods":3},"operations":[{"method":"POST","inputSchema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","minItems":1,"maxItems":4000,"description":"Each event needs user_id and a timestamp (time_unix_s in seconds since 1970, or time as ISO 8601). Optional: type and value. Any other field name is rejected rather than guessed. The service caps the whole request body at 256 KB, so long records reach that limit before maxItems."},"period":{"type":"string","enum":["day","week","month"],"default":"week"},"periods":{"type":"integer","minimum":1,"maximum":52,"default":12,"description":"How many periods the table runs, period 0 being the entry period."},"week_start":{"type":"string","enum":["monday","sunday"],"default":"monday"},"timezone_offset_s":{"type":"integer","minimum":-50400,"maximum":50400,"default":0,"description":"Offset from UTC in seconds used to place period boundaries."},"activation_type":{"type":"string","maxLength":120,"description":"If set, only events of this type put a user into a cohort. Without it the first event of any type counts."},"retention_types":{"type":"array","maxItems":50,"items":{"type":"string"},"description":"If set, only events of these types count as being active. Without it every event counts."}}},"requestExample":{"events":[{"user_id":"u1","time_unix_s":1785110400,"type":"order","value":19.9},{"user_id":"u1","time_unix_s":1785715200,"type":"order","value":24.5},{"user_id":"u2","time_unix_s":1785110400,"type":"order","value":12},{"user_id":"u3","time_unix_s":1785715200,"type":"order","value":30}],"period":"week","periods":3}}]}