Paginate and synchronize safely
Growing collections use filter-bound snapshot cursors so one traversal sees a stable upper watermark while records continue changing.
Read every page
Section titled “Read every page”- Send the first request with documented filters and
limit. - Process
data. - If
pagination.has_moreistrue, send another request with the exactpagination.next_cursor. - Keep the same endpoint and filters.
- Stop when
has_moreisfalseandnext_cursorisnull.
The default limit is 50 and the maximum is 200. Treat a cursor as opaque: do not decode, edit, persist beyond its synchronization cycle, or reuse it with a different endpoint, path identifier, filter, or ordering.
{ "data": [], "pagination": { "next_cursor": null, "has_more": false }}Run an incremental cycle
Section titled “Run an incremental cycle”Collections that document created_after or updated_after accept RFC 3339
UTC timestamps. The two parameters are mutually exclusive.
- Complete the current snapshot traversal.
- Store a safe synchronization watermark appropriate to your design.
- Start the next cycle with
updated_afterto include later creations and updates. - Traverse all returned cursors without changing that filter.
- Upsert by resource
idand tolerate at-least-once delivery.
Do not use client wall-clock time as proof that the server has returned every change. Avoid advancing a checkpoint before the entire cycle is durably processed.
Semester and lineage behavior
Section titled “Semester and lineage behavior”Halqa and student collections include records across semesters unless
semester_id or semester_status is supplied. Their id identifies the
semester-specific record. lineage_id identifies the continuing logical
halqa or learner across a semester carry-forward.
Choose keys deliberately:
- use
idfor API reads, writes, and exact record state; - use
lineage_idto correlate historical and successor records; - never substitute one for the other.
Collection differences
Section titled “Collection differences”- Semesters, halqas, students, sessions, recitation collections, Learning Plans, assignments, and attendance define snapshot pagination.
- The eligible-sheikh lookup is current discovery, not an incremental feed.
- Surah reference data is bounded and does not accept pagination or filters.
An invalid_query response means a filter, cursor binding, timestamp, or limit
does not match the contract. Restart a new traversal with valid filters rather
than modifying the cursor.