Issuing commands
Commands are how you ask EvidentSource to do something. Every command is routed to a State Change component, whose decide function validates it and returns the events to append.
Command shape
Section titled “Command shape”Every command has:
type— the command name (e.g.CreateTodo)subject— the entity the command is aboutdata— the command-specific payloadmetadata(optional) — correlation IDs, effective time, caller context
The schema for a command is defined by whatever State Change component handles it.
curl -X POST https://sandbox.evidentsource.com/v1/commands \ -H "Content-Type: application/json" \ -d '{ "database": "todomvc", "command": { "type": "CreateTodo", "subject": "todo-123", "data": { "title": "Try the Sandbox" } } }'The response includes the revision number assigned to the resulting event(s).
Use the AppendCommand RPC on the EventStore service. See gRPC API.
From an SDK
Section titled “From an SDK”Every SDK exposes a typed sendCommand / send_command method. See Connecting with an SDK.
Concurrency and errors
Section titled “Concurrency and errors”Commands carry DCB conditions at the decide layer. If a condition fails at append time, the call returns a conflict error — the SDK lets you retry with fresh state. If decide itself rejects the command, you get a structured error with the rejection reason.
- Reading state views — read back what your commands produced.