Daily cohort retention for the last 14 days
curl -X POST https://oc-acme.ap-south-1.originchain.ai/v1/sql \
-H "Authorization: Bearer $OC_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT date_trunc(''day'', u.joined_at) AS cohort_day, COUNT(DISTINCT e.user_id) AS readers FROM users u JOIN events e ON e.user_id = u.user_id WHERE e.ts > now() - interval ''14 days'' GROUP BY 1 ORDER BY 1"}' {
"rows": [
{ "cohort_day": "2026-04-19", "readers": 41028 },
{ "cohort_day": "2026-04-20", "readers": 39812 }
],
"meta": { "latency_ms": 78 }
}