AgentWorks API, CLI, and configuration reference
An AgentWorks 1.15.0 runtime serves one versioned API for running agents: deployments to start runs on, runs and their events, human interactions, sessions, and durable operations. It does not serve an API to create agents, build releases, or promote them; a headless runtime reads those from its runtime file and a connected one from Flightdeck. Use this page to find the right surface, and the runtime's own OpenAPI document for every field.
Where is the exact API contract?
Every runtime publishes its OpenAPI 3.1 document without authentication:
curl --fail http://127.0.0.1:8080/api/v1/openapi.yaml -o agentworks-openapi.yaml
Every other operation needs a bearer credential: a caller key or an identity provider's token that the runtime file names, or Flightdeck's token on an enrolled runtime. The credential decides the workspace; no header or body can choose another one.
| Task | Operations |
|---|---|
| Find deployments | GET /api/v1/deployments |
| Start a run | POST /api/v1/deployments/{deploymentId}/runs (needs RUN_ADMIT; takes Idempotency-Key) |
| Read runs | GET /api/v1/runs, GET /api/v1/runs/{id}, .../steps, .../events, .../stream, .../context |
| Control runs | POST /api/v1/runs/{id}/cancel, .../pause, .../resume |
| Replay | GET /api/v1/runs/{id}/replay/plan, POST /api/v1/runs/{id}/replay |
| Human interactions | GET /api/v1/interactions, GET .../{interactionId}, POST .../response, .../expire, .../cancel, .../revoke |
| Sessions | POST and GET /api/v1/sessions, GET .../{sessionId}, POST and GET .../{sessionId}/messages, GET .../messages/{messageId} |
| Durable operations | GET /api/v1/operations, GET .../{operationId}, POST .../cancel; providers report results to POST /api/v1/operation-callbacks/{workspaceId}/{operationId} with their own token |
| Run control audit | GET /api/v1/administrative-audit |
| MCP connection health | GET /api/v1/mcp-connections |
Outside /api/v1, a deployment exposed as an A2A agent answers JSON-RPC at POST /a2a/<id> and publishes its Agent
Card at GET /a2a/<id>/.well-known/agent-card.json. Readiness is GET /actuator/health/readiness.
How do errors, paging, and streams behave?
Errors are RFC 9457 problem documents. Check the stable code first: AUTHENTICATION_FAILED (401) for a bad
credential, ACCESS_DENIED (403) for a missing permission, NOT_FOUND (404) for something outside the caller's
workspace, and a typed 409 such as RUN_TERMINAL for an action in the wrong state. A credential in the URL is
refused with CREDENTIAL_IN_URL.
Lists return {"items": [...], "nextCursor": "..."}. Pass nextCursor back unchanged as cursor; never build one.
The run stream is Server-Sent Events with event ids <runId>:<sequence>; reconnect with Last-Event-ID, and reload
the paged history if the stream says the old position is no longer available.
Reusing an Idempotency-Key with the same request returns the original result, and with different content is
refused with IDEMPOTENCY_KEY_REUSED.
Which CLI commands exist?
The agentworks CLI calls the same API. It needs Python 3.11 or newer on Linux or macOS and is built from the private
release tag, which requires authorized access. Point a profile at a runtime and keep the credential out of the
profile:
agentworks profile set local --server http://127.0.0.1:8080 --token-env AGENTWORKS_TOKEN
agentworks profile use local
export AGENTWORKS_TOKEN="<caller-key>"
agentworks deploy list
| Group | Commands |
|---|---|
profile | set, use, list, remove |
deploy | list |
run | start, show, list, pause, resume, cancel |
events, stream | events list, stream <run-id> |
replay | plan, start |
interaction | list, show, respond, expire, cancel, revoke |
operation | list, show, cancel |
validate | validate <runtime-file> |
test, simulate | test run, simulate run, on your machine with no server |
diagnostic | context, openapi |
Use --output json in scripts: each command prints one JSON object, and a stream prints one per event. Exit code 0
is success; 3 is an authentication or authorization failure, 4 a refused request, 19 an unreachable runtime, 20
a stream that cannot resume, 21 a lifecycle conflict, and 22 a runtime file with problems.
How do you check a runtime file?
agentworks validate runs the runtime's own reader from the server jar, so it reports exactly the problems a start
would, each with where it is, and starts nothing. It needs Java 25 and the 1.15.0 server jar, given with --jar or
AGENTWORKS_SERVER_JAR:
export AGENTWORKS_SERVER_JAR=<path-to-agentworks-server-1.15.0.jar>
agentworks validate agentworks.yaml --without-keys
--without-keys skips caller keys whose variables are not set, for CI, and names them. A file with problems ends with
exit code 22 and RUNTIME_FILE_INVALID, with every problem in detail.problems. Without the CLI, the released image
runs the same check; it exits 0 for a good file, 1 for a file with problems, and 2 for a wrong command line:
docker run --rm -v "$PWD:/etc/agentworks:ro" ghcr.io/dvarahq/dvara-agentworks-ee:1.15.0 \
validate --without-keys /etc/agentworks/agentworks.yaml
A model gateway or a tool binding that the file needs is checked only when the runtime starts, because it depends on the runtime, not the file.
Which configuration keys matter most?
Settings are Spring Boot properties, so agentworks.config.file can also be the environment variable
AGENTWORKS_CONFIG_FILE. Keep secrets in mounted files or a secret manager, never in the runtime file.
| Area | Key | Default and meaning |
|---|---|---|
| Headless mode | agentworks.config.file | Unset. The runtime file; setting it selects headless mode. |
| Headless mode | agentworks.config.reload-interval | 5s. How often the file is read again. |
| Run store | agentworks.storage.local.path | data/run-plane.db. The SQLite file; put it on a durable volume. |
| Workers | agentworks.runs.worker.enabled, .threads | false and 1. Runs stay queued until workers are on. |
| Workers | agentworks.runs.worker.lease-duration | 30 seconds. Raise it for slow local models. |
| Cleanup evidence | agentworks.runs.cleanup-evidence.path | data/runtime-cleanup.pending. Keep it on the durable volume. |
| Model gateways | agentworks.gateway.gateways.<id>.type, .base-url, .credential-ref, .models[n].alias, .models[n].model | A named gateway, such as openai-compatible. |
| Model gateways | agentworks.gateway.gateways.<id>.private-network | false. Allows plain HTTP to a non-loopback host on a trusted network. |
| Credentials | agentworks.credentials.environment.<id>.variable, .scope | Resolves env://<id> from an environment variable; the scope is required. |
| Flightdeck | agentworks.enrolment.base-url, .runtime-id, .token, .directory | Unset; setting base-url selects connected mode. directory defaults to data/enrolment. |
| Flightdeck | agentworks.security.flightdeck.issuer, .audience | Filled from Flightdeck's bundle; audience agents. |
| A2A | agentworks.a2a.exposures.<id>.environment, .deployment, .url, .wait-timeout | Exposes one deployment as an A2A agent; wait-timeout defaults to 60s. |
| A2A | agentworks.idempotency.active-key-version, .hmac-keys.<version> | Required for A2A message/send, which otherwise answers IDEMPOTENCY_UNAVAILABLE. |
| DVARA Gateway | agentworks.gateway.dvarahq.a2a.origin, agentworks.gateway.dvarahq.mcp.origin | Unset. Turn on call_agent and DVARA Gateway MCP tools. |
| Entity memory | agentworks.memory.entity.time-to-live | 90d. Applies where entity memory is kept. |
| Release evidence | agentworks.release-evidence.trusted-public-keys.<id>, .revoked-key-ids | Keys the runtime verifies evidence with. |
| Request size | agentworks.security.requests.max-body-size | 1048576 bytes. |
| Startup policy | agentworks.configuration.unknown-keys | error. An unknown agentworks.* key stops startup. |
agentworks.storage.run-plane and agentworks.storage.control-plane are set for you by the mode you choose; do not set
them. Set exactly one of agentworks.config.file and agentworks.enrolment.base-url: a runtime with neither, or
both, refuses to start.
Which settings stop a 1.15.0 runtime?
A removed setting stops startup and names what replaced it; it is never silently ignored. That includes any
removed spring.datasource.* or agentworks.planes.* setting (a runtime has no database), agentworks.console.enabled (the
AgentWorks pages are in Flightdeck), the session, sign-in, bootstrap, and API-token settings, and the control-plane
settings agentworks.lifecycle.default-credential-references.<name>, agentworks.release-evidence.required,
.active-key-id, and .private-key. A runtime file names each deployment's credential references under its
credentials instead.