Skip to content

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.

Every command has:

  • type — the command name (e.g. CreateTodo)
  • subject — the entity the command is about
  • data — the command-specific payload
  • metadata (optional) — correlation IDs, effective time, caller context

The schema for a command is defined by whatever State Change component handles it.

Terminal window
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.

Every SDK exposes a typed sendCommand / send_command method. See Connecting with an SDK.

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.