Action Plans API¶
Validate and apply deterministic action plans over HTTP.
This is the same action-plan workflow used by:
runagents action validaterunagents action applyclient.actions.validate(...)client.actions.apply(...)- assistant tools such as
validate_planandapply_planin the RunAgents MCP server
Download the OpenAPI fragment:
Canonical plan schema and examples:
Validate A Plan¶
POST /actions/validate
Validates an action plan without mutating resources.
Request Body¶
| Field | Type | Required | Description |
|---|---|---|---|
plan_id | string | No | Optional correlation id |
continue_on_error | boolean | No | Apply-only flag preserved in the plan payload |
actions | array | Yes | Ordered action list |
Each action includes:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | Optional human-readable step id |
type | string | Yes | Action type |
idempotency_key | string | Yes | Stable key for retry safety |
params | object | No | Action-specific payload |
Supported action types:
tool.upsertmodel_provider.upsertpolicy.upsertdeploy_draft.create_or_patchdeploy.executestarter_kit.seed
Response (200 OK)¶
{
"plan_id": "bootstrap-payments-agent",
"namespace": "default",
"valid": true,
"results": [
{
"id": "tool-1",
"type": "tool.upsert",
"idempotency_key": "bootstrap.tool.payments.v1",
"valid": true,
"resource_ref": "/tools/payments-api"
}
]
}
Apply A Plan¶
POST /actions/apply
Validates the plan and, if valid, executes actions in order.
Response (200 OK)¶
{
"plan_id": "bootstrap-payments-agent",
"namespace": "default",
"applied": true,
"applied_count": 2,
"failed_count": 0,
"results": [
{
"id": "tool-1",
"type": "tool.upsert",
"idempotency_key": "bootstrap.tool.payments.v1",
"status": "applied",
"resource_ref": "/tools/payments-api"
},
{
"id": "draft-1",
"type": "deploy_draft.create_or_patch",
"idempotency_key": "bootstrap.draft.payments.v1",
"status": "applied",
"resource_ref": "/deploy-drafts/draft-payments-01"
}
]
}
Validation Failure (400 Bad Request)¶
When validation fails before mutation, the API returns an apply-shaped response with per-action invalid statuses:
{
"plan_id": "broken-plan",
"namespace": "default",
"applied": false,
"applied_count": 0,
"failed_count": 1,
"results": [
{
"id": "tool-1",
"type": "tool.upsert",
"idempotency_key": "dup-key",
"status": "invalid",
"error": "idempotency_key is required"
}
]
}
Notes¶
- Use
validatebeforeapplyin CI and assistant-driven workflows. - Keep
idempotency_keystable across safe retries of the same intent. - The canonical per-action payload rules still live in the Action Plan Schema.