Skip to content
You are viewing docs for v0.1.0. Switch to latest

Command REST API

Commands are executed through an aggregate-scoped endpoint rather than a global /api/commands/... route.

MethodRoute
POST/api/aggregates/{agg}/execute/{command}

Request body:

{
"params": {
"employee_id": "EMP-001",
"name": "Alice",
"grade": "L4"
}
}

Behavior:

  • Validates {agg} and {command} as identifiers
  • Confirms the aggregate exists
  • Confirms the command exists
  • Confirms the command resolves to a decision for the same aggregate
  • Translates the JSON body into a DeQL EXECUTE ... statement

Success response:

  • Usually Arrow IPC representing emitted events or rejection details
  • Status JSON only if execution returns a non-tabular status
StatusMeaning
400Invalid identifier or invalid parameter key
403Command belongs to a different aggregate, or server is read-only
404Aggregate, command, or decision binding not found
  • Boolean and numeric-looking values are emitted unquoted into the generated DeQL command.
  • Other values are single-quoted and escaped.
  • There is no standalone command metadata endpoint; use the DeReg API for command definitions.