POST /api/telemetry/v2 and resumed with
GET /api/telemetry/v2?after=<cursor>&limit=<count>. Every request is bound to
one configured tenant and project. Event-supplied project IDs cannot cross that
boundary.
This endpoint is disabled until at least one ingest key is configured.
Configure an ingest key
Generate a high-entropy token and store only its SHA-256 digest in Engram:TOKEN in the sending agent’s secret store. Configure Engram with the
digest, tenant, and fixed project:
Authorization: Bearer <TOKEN>. Engram hashes the presented
token and uses a constant-time comparison against configured digests.
Send from an agent
The framework-neutral client validates events, preserves order, batches, and retries without removing failed events from its buffer:flush() at transaction boundaries and close() during graceful
shutdown. Each event needs a stable eventId; retries with the same ID are
reported as duplicates instead of creating another row.
Durable Supabase storage
Without either database variable, the API uses an in-process store. That is useful for local development only and can be lost on restart or serverless eviction. Supplying only a URL or only a secret fails closed instead of silently falling back to ephemeral storage. To use Supabase:- Apply
supabase/migrations/20260714181928_telemetry_ingestion.sql. - Set
SUPABASE_URLand the server-onlySUPABASE_SECRET_KEY. - Never prefix the secret with
NEXT_PUBLIC_or send it to a browser.
anon and
authenticated, and grants only SELECT and INSERT to service_role.
There are intentionally no browser policies. Current Supabase projects require
explicit Data API grants for new tables, so the service-role grant is part of
the migration in the Supabase API security guide.
Browser and operational boundaries
- Cross-origin browser access is denied by default. Add exact origins to
ENGRAM_INGEST_ALLOWED_ORIGINSonly when a browser client is intentional. - The ingest token authorizes both append and project-scoped resume reads.
- Raw tokens and Supabase secrets must stay in server or agent secret stores.
- A cursor records accepted ingest order. The source
sequenceremains part of the event and may expose network reordering. - The local store is not distributed rate limiting or durable storage. Use platform quotas and database monitoring in production.