Register an Event Schema
Register an Event Schema
Schemas are managed by schema-registry on port 8089 in local development.
Writes require schemas.write or admin.
TOKEN="$(just dev-hydra-token)"
curl -sf -X POST http://localhost:8089/api/v1/schemas \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "page-view",
"name": "Page View",
"version": "1.0.0",
"jsonSchema": "{\"type\":\"object\",\"properties\":{\"example\":{\"type\":\"boolean\"}},\"required\":[\"example\"],\"additionalProperties\":true}",
"enabled": true,
"isActive": true
}'
Once active, events with eventTypeSlug: "page-view" and
schemaVersion: "1.0.0" validate against that schema.