AdminBackfill the aggregate registry from R2

Backfill the aggregate registry from R2

Scans the R2 event store and upserts a registry row for every aggregate found (optionally limited to one type). Idempotent. Requires dual admin auth (X-Admin-API-Key + JWT with an allowed email domain).

curl -X POST "https://api.spkey.co/admin/aggregates/backfill?type=example_string" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "scannedTypes": [
    "example_string"
  ],
  "upserted": 3.14,
  "byType": {},
  "truncated": true,
  "durationMs": 3.14
}
POST
/admin/aggregates/backfill
POST
Base URLstring

Target server for requests. Edit to use your own host.

⚠️Authentication configuration error - security schemes not found
query
typestring

Limit the scan to one aggregate type or slug.

Request Preview
Response

Response will appear here after sending the request

Query Parameters

typestring

Limit the scan to one aggregate type or slug.

Responses

successboolean
Required
scannedTypesstring[]
Required
upsertednumber
Required
byTypeobject
Required
truncatedboolean
Required
durationMsnumber
Required