Event envelope
Every durable event contains:
Process events in numeric
sequence order and deduplicate on id.
Credit claim events
credit_claim.created fires after Sparkles creates and reserves a unique claim. Its status is pending and claimedAt is null.
credit_claim.claimed fires after Sparkles adds the credits once to the recipient’s selected organization. Its status is claimed and claimedAt contains an ISO 8601 timestamp.
Both payloads contain:
Attributed lifecycle events
All lifecycle payloads containclaimId, leadId, variant, and occurredAt.
Attribution is immutable first touch. Project, task, and pull-request events use the first claimed offer for the exact recipient and selected organization. Paid conversion uses the first claimed offer for the selected organization. Redeeming a later claim does not replace either attribution.
Recover a sequence gap
Use the event feed only for backfills or webhook gap recovery:nextCursor only after processing every returned event successfully, then pass it as the next after value. The default and maximum limit is 100. An empty page preserves the supplied cursor.
Recovery loop
- Read your last durable cursor.
- Request events with
after=<cursor>. - Process each event in ascending sequence order.
- Deduplicate each event by UUID.
- Save
nextCursorafter the batch commits. - Repeat until
datais empty.