lastModifiedDate.
The pattern
- Remember the timestamp of your last successful sync (
lastSync). - Each run, query for documents modified since then, with a small overlap to absorb clock skew:
rangeFilter: without it, fromDate is only applied together with
untilDate. Add includeActive=true&includeArchived=true to also see
tickets that were archived (deleted) since the last run.
3. Page through all results (page increments until you’ve consumed hits).
4. Upsert into your system, keyed on _id. Updates are idempotent, so the
overlap window is harmless.
5. Store the new lastSync only after the run completes successfully.
Detecting completion
A common reason to poll is “tell me when this is finished”. Tickets and audits record that in different fields, with different vocabularies — and in both cases the finished value occurs in two spellings, because a few thousand older documents were never migrated. Filters match the value exactly, so a query that asks for only one spelling silently misses those documents.Tickets — state.state
Writes through the API are normalised:
PATCH accepts any casing and stores
lower case, and rejects anything outside the three states with 422.
Audits — status
New audits start
In Progress. The status changes when someone finishes the
audit, in the app or through the audit update (PUT).
Filtering on it
Pass both spellings, comma-separated:status on the ticket endpoints.
Practical guidance
- Poll per project (
database), not across all projects — result sets stay small and one failing project doesn’t block the rest. - A 5–15 minute interval is plenty for most integrations; tickets change at human speed.
- Detect deletions and archiving by occasionally doing a full reconcile
(compare
_idsets), since soft-deleted documents simply stop appearing in results. - Watch the 10,000-result pagination cap: if a single window exceeds it,
narrow the window (
untilDate) and continue.
