Event Checkpoints
Server-managed cursors for stateless event stream consumers.
In most cases, checkpoints are not needed. If your system can persist data locally (e.g. in a database, file, or key-value store), store the cursor value from GET /event yourself and pass it as start_cursor on the next request.
When to use checkpoints:
Use this endpoint if your system runs in an environment that cannot reliably persist state between invocations — for example, a stateless function, a script with no backing store, or a system that delegates position tracking to TreasurySpring entirely.
A checkpoint is a named record stored server-side that remembers where your last successful sync run ended. Instead of storing the cursor yourself, you store it here and retrieve it at the start of each sync run:
- Create a checkpoint once:
PUT /event/checkpoint/{name}— the cursor is initialised to the current end of the event stream. - Read the checkpoint at the start of each sync run:
GET /event/checkpoint/{name}→cursor,checkpointVersion. - Fetch events from that cursor:
GET /event?start_cursor={cursor}. - Advance the checkpoint after successful processing:
PATCH /event/checkpoint/{name}withexpectedCheckpointVersionandnewCursor. ThecheckpointVersionacts as a safety check — if another process has already advanced the checkpoint since you last read it, the request returns a 409 Conflict with the current state so you can reconcile before retrying.
Checkpoints are scoped to the authenticated API user.
List event checkpoints
Return all event checkpoints for the authenticated user, ordered by name.
Delete an event checkpoint
Delete a named event checkpoint.
Get an event checkpoint by name
Return a single event checkpoint by name.
Advance an event checkpoint cursor
Advance the checkpoint to a new cursor position.
Create or get an event checkpoint
Create a new named event checkpoint, or return the existing one if it already exists.