Build
Events & Sync
How Arke's event system works for real-time sync and change tracking.
Overview
Arke emits events when entities are created, updated, or deleted. Events are stored in D1 and can be consumed for real-time sync, webhooks, and audit trails.
Event Types
| Event | Triggered When |
|---|---|
entity.created | New entity is created |
entity.updated | Entity is updated (new version) |
entity.deleted | Entity is tombstoned |
relationship.added | Relationship is added |
relationship.removed | Relationship is removed |
Consuming Events
GET /events?since=2026-01-28T00:00:00Z
Authorization: Bearer <token>Query Parameters
| Parameter | Description |
|---|---|
since | ISO 8601 timestamp -- return events after this time |
collection_id | Filter events by collection |
type | Filter by event type |
limit | Maximum events to return |
Event Sharding
Events are stored in monthly D1 databases (D1_API_EVENTS_MAIN_2026_01, etc.) for performance and cost management. The API transparently routes to the correct database based on the query timeframe.