Skip to navigation

Event feed and consumer groups

Read every event your application may see from a cursor, resume after downtime, and share the work between instances.

The event feed is the durable record behind realtime and webhooks: the same events, with the same eventId, kept for 7 days. Poll it with a cursor; nothing is lost while you are away.

Read the feed

GET /partner/v1/events answers a page of events after a cursor.

ParameterMeaning
afterOptional, opaque cursor — an item’s cursor, a page’s nextCursor, or a consumer-group lease’s cursor. Omit it to start at the oldest retained event.
limit1 to 1000 items, default 100.
curl -sS "https://api.evvahub.com/partner/v1/events?limit=100&after=$CURSOR" \
-H "Authorization: Bearer $TOKEN"
200 OK
{
"items": [
{
"eventId": "evt_01EXAMPLE",
"type": "message.received",
"schemaVersion": 1,
"occurredAt": "2026-12-01T10:00:00.000Z",
"publishedAt": "2026-12-01T10:00:00.120Z",
"applicationId": "app_EXAMPLE",
"agencyId": "agency_EXAMPLE",
"creatorId": "creator_EXAMPLE",
"conversationId": "conversation_EXAMPLE",
"correlationId": null,
"cursor": "opaque-cursor-1",
"data": { "messageId": "message_EXAMPLE", "senderRole": "USER", "buyerRef": "buyer_EXAMPLE" }
}
],
"nextCursor": "opaque-cursor-2",
"hasMore": false
}

How to read it

  • Save a cursor after you handle an event, not before. Every item carries its own cursor, so you can checkpoint mid-page; nextCursor is always present and safe to resume from once the whole page is handled.
  • hasMore: true with fewer than limit items is normal. One call examines a bounded number of rows; ask again.
  • Deduplicate on eventId. Delivery is at least once; a crash between handling and saving re-delivers.
  • The order is deterministic. Reading again from the same cursor, replaying from the start or resuming a consumer group after a takeover returns the same events in the same order. Within a creator the order never changes; across creators no order is promised.
  • Never order by occurredAt. It is informational, not the delivery order, and two events can share an instant.
  • Cursors are opaque. A cursor is encrypted and works only for your application, in its agency and environment. It shows neither its position nor whether it moved, and two cursors for the same position differ, so never compare them. Events carry no sequence.
  • Visibility is decided when you read. Each event is shown only if your grants, the creator’s consent and your token cover its type’s scopes at that moment. An event hidden when its page is read is still passed by the cursor: granting access later does not replay history into the feed — use the REST reads for history.

When a cursor stops working

AnswerMeaningWhat to do
410 CURSOR_EXPIREDYour cursor points before the 7-day retention.Resynchronise what you depend on through the REST API, then read again without after.
400 INVALID_CURSORMalformed, tampered with, issued to another application, or a webhook’s whc1. correlation cursor.Use a cursor this feed gave you.
503 FEED_UNAVAILABLEThe feed is not available on this deployment right now.Retry after Retry-After.

Consumer groups

When several instances of your application read the feed, a consumer group splits the work and keeps one shared position. Events are spread over 16 partitions by creator, so each creator’s events stay in order inside one partition. A group is identified by your application and a name you choose (consumer).

1

Lease partitions

GET /partner/v1/events/checkpoints with consumer and, optionally, partitions (all 16 when omitted). You get a lease — cursor, fencingToken, leaseExpiresAt, partitions — when no other member holds a live lease on any of them; otherwise 409 LEASE_HELD with Retry-After.

2

Read with the lease's cursor

Pass the lease’s cursor as after. It covers exactly your partitions. A partition never committed starts at the oldest retained event.

3

Commit and renew

POST /partner/v1/events/checkpoints with consumer, the cursor you reached and your fencingToken. That records the position and renews the lease. To renew without committing, call the GET again with your fencingToken.

4

Renew before the lease runs out

Leases last about 30 seconds by default — read leaseExpiresAt. A lapsed lease can be taken over by another member, which receives a new, higher fencing token.

RefusalMeaning
409 LEASE_HELDAnother member holds a live lease on a partition you asked for. Wait Retry-After, or ask for other partitions.
409 STALE_FENCING_TOKENYour lease was taken over. Stop processing those partitions and lease again.
409 NOT_LEASEDThe cursor covers a partition this group never leased.
400 INVALID_CURSORThe cursor was issued to another application.

Checkpoints hold positions only, never event data.

The PHP SDK’s ServerCheckpointStore uses consumer groups directly, so several PHP workers can share one position. In the other SDKs, a CheckpointStore on your own database does the same job.

Next steps