GET /v1/events returns your organization’s changes in order. You hold the
position, so a consumer that dies mid-stream resumes exactly where it stopped.
Webhooks push the same events to you. The change feed
lets you pull them, which is what you want for a consumer that can be offline,
or one that needs to replay.
Read the feed
Response
next_cursor back as cursor to get the next page. Omit cursor to start
at the oldest event still inside the retention window.
results and has_more are always present. An empty page returns the cursor you
sent, unchanged, so a poller can keep the same value and call again.
The three things that will bite you
Fields on an event
seq is monotonic per organization, so it orders events across namespaces. Use
cursor to resume; use seq when you need to compare two events’ order.
Batch ingest is covered, and how to trust it
Documents created by batch processing appear in the feed the same way direct API writes do. After the pipeline confirms a flush of documents into storage, onecollection.documents.written event lands per flushed chunk, carrying
namespace_id, collection_id, batch_id, document_ids and count. A
large batch produces hundreds of chunk events rather than one event per
document, so project by fetching the listed ids.
When the batch finishes, the feed carries one terminal
collection.documents.batch_completed event per collection the batch wrote,
with a total_documents count taken from the store itself. If the store count
fails, total_documents is null. It is never a guess.
A terminal marker
document_ids across the batch’s chunk events and compare its size
against total_documents. A match means you saw every write. A mismatch means
some chunk events were lost, and the fix is to list the collection’s documents
filtered by that batch_id and reconcile.
Related
- Webhooks for push delivery of the same events
- Observability

