Syncing
Every Esper QA deployment is a separate source. Store the deployment value from
GET /meta with everything you sync.
GET /calls/changes?updated_since=… returns every call created or changed after that time,
oldest change first: new calls, finished evaluations, re-scores and reviewer overrides.
- First run: start from the oldest date you care about.
- Page through with
next_cursoruntil it isnull, upserting byid. - Remember the largest
updated_atyou stored and pass it asupdated_sincenext time.
A call can appear several times as it moves through processing; the latest copy wins. The
feed includes answering-machine calls and later legs of multi-recording calls; filter them
with is_voice_machine and parent_call_id if you do not want them.
Daily figures
Section titled “Daily figures”GET /meta: iffacts_timezonechanged, resync all daily figures.GET /facts/days?day_from&day_to: one row per day with itscomputed_at.- For each day whose
computed_atdiffers from yours, page throughGET /facts/agent-dailyfor that day and replace everything you hold for it. Delete days that are missing from the manifest. - If a page returns a different
computed_atthan the manifest, the day was rebuilt during your download: restart that day.
Today is rebuilt during the day and the last 3 days nightly; older days do not change. Every 15 minutes is often enough.
Directory and lead details
Section titled “Directory and lead details”GET /directory/*: small lists; refresh hourly and replace your copy.GET /leads/details?updated_since=…andGET /coaching-cases?updated_since=…sync the same way as calls.