Routes, Outcomes, and Runs. Policies enforce cross-cutting rules. Audit events log every state change.
See the Machine Markets overview for base path, auth model, and common envelopes.
Every endpoint below that names a machine (in the path, the body, or the machineId query) requires the machine to be active and identity-verified. Errors MACHINE_NOT_ACTIVE and MACHINE_NOT_ACTIVATED are uniform across that group. Policies and audit events are not tied to a machine and skip this check.
Runtime endpoints
GET /machines/:machineId/runtime-endpoints
GET /machines/:machineId/runtime-endpoints/:providerKey
PUT /machines/:machineId/runtime-endpoints/:providerKey
Upsert a manual runtime endpoint. source is forced to manual. Returns 201 on create, 200 on update. The server lowercases providerKey in the path.
VALIDATION_ERROR (invalid URL).
DELETE /machines/:machineId/runtime-endpoints/:providerKey
Returns 204. Errors: NOT_FOUND.
RuntimeEndpointView
The view never echoes authToken. Use hasAuthToken to check whether one is stored.
Machine-side agents
POST /machines/:machineId/agents/enrollment
Enrols a new runtime agent. Returns the agent record plus a one-time agentToken.
POST /machine-agents/heartbeat
Heartbeat from an on-machine runtime agent. Auth via agentToken body field or x-agent-pairing-token / Authorization: Bearer header. Upserts one or many endpoints with source: "agent" and a lease.
VALIDATION_ERROR, NOT_FOUND, AGENT_PAIRING_INACTIVE (status revoked), AGENT_AUTH_REQUIRED, AGENT_AUTH_INVALID, AGENT_POLICY_DENIED (provider key not in agent.allowedProviderKeys).
Side effects: agent status flips to active, lastSeenAt updates, each endpoint upserts with leaseExpiresAt = now + leaseSeconds.
MachineAgentView
Graph
GET /machines/:machineId/graph
POST /machines/:machineId/graph/nodes
PATCH /machines/:machineId/graph/nodes/:nodeId
All fields optional; data is shallow-merged. Status accepted: "draft" | "active" | "blocked" | "degraded".
DELETE /machines/:machineId/graph/nodes/:nodeId
Returns 204.
POST /machines/:machineId/graph/edges
PATCH /machines/:machineId/graph/edges/:edgeId / DELETE /machines/:machineId/graph/edges/:edgeId
Standard patch and delete semantics.
Graph types
Tasks
Tasks model the discover-resolve-execute pipeline that orders ride on.POST /market/orders/:orderId/execute materialises an order as a task internally, but tasks can also be driven directly.
GET /machines/:machineId/tasks
POST /machines/:machineId/tasks
GET /machines/:machineId/tasks/:taskId
POST /machines/:machineId/tasks/:taskId/discover
Runs discovery against the catalogue for a queued task.
POST /machines/:machineId/tasks/:taskId/resolve
Picks a route and persists it. Returns 201.
POST /machines/:machineId/tasks/:taskId/execute
Executes the resolved route. HTTP status propagates from the inner execution result.
ROUTE_REQUIRED (no route resolved), plus all downstream skill-runtime errors.
Task types
Routes, outcomes, runs
GET /machines/:machineId/routes
GET /machines/:machineId/outcomes
GET /runs?machineId={id}&...
GET /runs/:runId
Route / Outcome / Run types
Policies
Policies enforce cross-cutting rules above and beyond a ’s .GET /policies
POST /policies
GET /policies/:policyId / PATCH /policies/:policyId
Standard get and patch semantics.
PolicyRecord
Audit events
GET /audit-events
runtime-endpoint.upserted, runtime-endpoint.deleted, machine-agent.enrolled, machine-agent.heartbeat, graph.node.created, graph.node.updated, graph.node.deleted, graph.edge.created, graph.edge.updated, graph.edge.deleted, task.created, task.resolved, task.executed, task.execution-failed, task.handoff-recorded, policy.created, policy.updated, market.order.created, market.payment.intent-created, market.payment.proof-recorded, market.payment.settlement-recorded, market.order.executed, market.order.confirmed, market.order.disputed, market.payment.escrow-held, market.payment.released, market.payment.refunded.

