Palbase Analytics · API
/analytics/retentionRun a retention table
The people whose first first_event fell in each period (day, week, month), and how many of them did return_event in each period after — as many periods as the window holds, 31 at most. A period that has not fully passed is not counted as observable.
Called by your server, with the project's secret key.
Request body
first_eventstring · requiredThe event that puts a person in a cohort.period"day" | "week" | "month" · optionalA cohort's period (week unless said).periodsinteger · optionalPeriods after the cohort (8 unless said; 31 at most).return_eventstring · requiredThe event that counts as returning.window_secondsinteger · optionalHow far back (30 days unless said).curl -X POST "https://<your-ref>.palbase.studio/analytics/retention" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"first_event":"string","return_event":"string"}'Responses
200The cohorts
400The request is malformed, or what it sends breaks a limit (the error names which: the SDKs' codes)
401No key, or not a key of this project, or a token that is not valid (the edge's answer)
403Not the project's secret key
429The project is sending analytics faster than its per-second limit (rate_limited), or its quota for the period is used up (quota_exceeded); Retry-After says when to try again
503The platform could not take or answer this now; nothing was kept, and retrying is safe (Retry-After)
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation RunRetention of analytics's contract.