Appearance
Actions HTTP API
This is the reference for the Actions HTTP surface. It maps each operation to its OpenAPI schema, its authentication seam, and the contracts the handlers enforce. The wire-contract origin is api/openapi/plexsphere-v1.yaml; this doc is a map, not a duplicate contract. For the domain model — the Execution aggregate, the per-Node ActionInvocation entities, the closed invocation state machine, the two-tier output contract, the ReBAC act matrix, and the Problem-code catalogue — see the bounded-context reference under ../../contexts/actions/.
An Execution is one dispatch of a named action — a built-in shipped with the Node agent or a user-declared hook — to a target cohort inside the owning Project. The dispatch fans out to one ActionInvocation per target Node, and each invocation reports its progress back through a unique per-Node callback URL. The surface adds four operations: the dispatch verb, a cursor-paginated list, a single read, and the Node-side callback. The carrying OpenAPI tag is actions.
Operations
| Method | Path | Operation ID | Auth |
|---|---|---|---|
| POST | /v1/projects/{project_id}/executions:dispatch | DispatchExecution | operator bearer |
| GET | /v1/projects/{project_id}/executions | ListExecutions | operator bearer |
| GET | /v1/projects/{project_id}/executions/{execution_id} | GetExecution | operator bearer |
| POST | /v1/nodes/{id}/executions/{exec_id} | PostNodeExecutionCallback | NSK bearer |
DispatchExecutionruns the dispatch ReBAC check on the Project before any persistence write, resolves the target cohort (a singlenode_idor the Nodes matching an opaque labelselector), gates the dispatch on capability availability and hook integrity, then mints one Execution that fans out to one per-Node invocation. Each invocation carries a unique callback URL under/v1/nodes/{id}/executions/{exec_id}. A gated dispatch surfaces as409 hook_integrity_violation,422 selector_empty_cohort, or429 capacity_exceeded(the per-Domain live-execution ceiling); the full trigger-to-code catalogue lives in the context reference.ListExecutionsreturns a creation-ordered, metadata-only page of Execution lifecycle projections, optionally narrowed by aggregatestatusand/oraction_name. The execution-read ReBAC check runs on the Project before the persistence read. The pagination cursor is opaque and HMAC-signed by the server, so a tampered cursor surfaces as400on the next call.GetExecutionreturns the metadata-only projection of one Execution; the same execution-read ReBAC check runs before the persistence read. The projection carries the action identity, the aggregate status, and the per-Node targets — no secret or token columns.PostNodeExecutionCallbackaccepts the per-Node result callback from plexd and drives the addressed invocation through the closed status state machine. An out-of-order or repeated transition surfaces as409; an over-cap output payload surfaces as413.
Authentication
The three Project-scoped operations use the platform operator bearer scheme. The callback does not: like the heartbeat and endpoint-observation surfaces, it authenticates the Node against the per-Node Node Secret Key (NSK) plaintext supplied in the Authorization: Bearer header, refusing a revoked credential with 401 and cross-Node use of a leaked NSK with 403 (nsk_node_mismatch).
Error envelope
All error responses use the shared Problem envelope (application/problem+json). Every operation carries the 501 arm for a build whose Actions surface is not provisioned. The closed per-sentinel Problem.code taxonomy — including the dispatch gate codes for an empty cohort, a missing capability, a hook-integrity violation, and the per-Domain live-execution cap — is catalogued in the context reference's ReBAC-and-Problem-codes section.
Cross-references
../../contexts/actions/model.md— the Execution aggregate, the invocation state machine, the two-tier output contract, and the Problem-code catalogue.../../contexts/actions/events.md— the domain events the dispatch pipeline emits../node-events.md— the mesh surfaces that share the per-Node NSK authentication seam with the callback../labels.md— the label selectors a cohort dispatch resolves through../index.md— platform-wide/v1HTTP surface map.../../../api/openapi/plexsphere-v1.yaml— authoritative OpenAPI contract; this doc is a map, not a duplicate.