Choose the surface that fits your stack. Each API exposes identical primitives for appending events, inspecting aggregates, and verifying state.
# All APIs expect a bearer token
$ eventdbx token generate --group admin --user jane --expiration 3600
# Export token for reuse
$ export EVENTDBX_TOKEN=eyJhbGciOi...
# Health check
$ curl http://127.0.0.1:7070/health
Issue tokens through the CLI and pass them as bearer headers. Tokens are signed JWTs that encode user, group, and expiry.
Authorization: Bearer TOKEN.authorization: Bearer TOKEN due to lowercase metadata.Ideal for automation scripts and application backends. Payloads are JSON and follow predictable patterns.
# Append an event
curl -X POST http://127.0.0.1:7070/v1/events \
-H "Authorization: Bearer ${EVENTDBX_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"aggregate_type": "patient",
"aggregate_id": "p-002",
"event_type": "patient-updated",
"payload": {
"status": "inactive"
}
}'
# Inspect state
curl -H "Authorization: Bearer ${EVENTDBX_TOKEN}" \
http://127.0.0.1:7070/v1/aggregates/patient/p-002
GraphQL is perfect when you need aggregate snapshots and events in a single round trip. The Playground ships with the server for quick iteration.
# Query aggregates
curl -X POST http://127.0.0.1:7070/graphql \
-H "Authorization: Bearer ${EVENTDBX_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"query": "query Recent($take: Int!) { aggregates(take: $take) { aggregate_type aggregate_id version state } }",
"variables": { "take": 5 }
}'
# Append via mutation
curl -X POST http://127.0.0.1:7070/graphql \
-H "Authorization: Bearer ${EVENTDBX_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation Append($input: AppendEventInput!) { appendEvent(input: $input) { aggregate_type aggregate_id version } }",
"variables": {
"input": {
"aggregate_type": "patient",
"aggregate_id": "p-002",
"event_type": "patient-updated",
"payload": { "status": "inactive" }
}
}
}'
Protocol buffers provide strong typing and efficient encoding for multi-language services and workers.
# Append via grpcurl
grpcurl -H "authorization: Bearer ${EVENTDBX_TOKEN}" \
-d '{
"aggregate_type": "patient",
"aggregate_id": "p-002",
"event_type": "patient-updated",
"payload_json": "{\"status\":\"inactive\"}"
}' \
-plaintext 127.0.0.1:7070 eventdbx.api.EventService/AppendEvent
# Stream events
grpcurl -H "authorization: Bearer ${EVENTDBX_TOKEN}" \
-d '{ "aggregate_type": "patient", "aggregate_id": "p-002" }' \
-plaintext 127.0.0.1:7070 eventdbx.api.EventService/ListEvents
Pair these APIs with the CLI to roll out schemas, rotate tokens, and monitor health without manual toil.
Open the CLI reference