Agents
Load, start, stop and inspect agents: status, config, tools, metadata, local tables, logs and usage.
On this page
List loaded agents
/agentsResponses
| Status | Description | Body | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Loaded agents | AgentList · array<AgentSummary> | |||||||||||||||
| |||||||||||||||||
Errors 401 · 403
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Load an agent from an .adf file
/agents/loadLoading an already-loaded file returns its existing reference. Direct loads bypass the review gate unless requireReview is true.
Request bodyapplication/json · LoadAgentBody · required
| Field | Type | Description |
|---|---|---|
filePathrequired | string | Absolute path of the .adf file |
requireReview | boolean | Enforce the review gate for this load (direct loads bypass it by default) |
Responses
| Status | Description | Body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | The loaded agent | AgentRef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
paramsarray<object> | 2 fields of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keyrequired | string | |
valuerequired | string |
provider_paramsinstructionsrequiredcontextrequiredcompact_threshold, audit, dynamic_instructions
toolsrequiredTool declarations
5 fields of tools
namerequired | string | |
enabledrequired | boolean | |
visible | boolean | |
restricted | boolean | |
locked | boolean |
triggersrequiredon_startup, on_inbox, on_outbox, on_file_change, on_chat, on_timer, on_tool_call, on_task_create, on_task_complete, on_logs, on_llm_call
3 fields of triggers
enabledrequired | boolean | ||||||||||||||||||||||||||||||||||
targetsrequired | array<TriggerTarget> | ||||||||||||||||||||||||||||||||||
11 fields of | |||||||||||||||||||||||||||||||||||
scoperequired | string | |
lambda | string | System scope: |
command | string | System scope: shell command (alternative to lambda) |
warm | boolean | |
filter | object | |
debounce_ms | integer | |
interval_ms | integer | |
batch_ms | integer | |
batch_count | integer | |
locked | boolean | |
loop | string | Cognition loop this target wakes; absent = main |
lockedsecurityrequiredlimitsrequiredmessagingrequiredmode (proactive | respond_only | listen_only), receive, network, …
mcp2 fields of mcp
serversrequired | array<McpServerConfig> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 fields of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
namerequired | string | ||||||||||
transportrequired | string | ||||||||||
command | string | ||||||||||
args | array<string> | ||||||||||
url | string | ||||||||||
oauth | boolean | ||||||||||
headers | map<string, string> | ||||||||||
header_env | array<object> | ||||||||||
bearer_token_env_var | string | ||||||||||
env | map<string, string> | ||||||||||
env_keys | array<string> | ||||||||||
env_schema | array<object> | ||||||||||
npm_package | string | ||||||||||
pypi_package | string | ||||||||||
source | string | ||||||||||
available_tools | array<object> | ||||||||||
tool_call_timeout_ms | integer | ||||||||||
restricted | boolean | ||||||||||
run_location | string | ||||||||||
credential_files | array<object> | ||||||||||
3 fields of | |||||||||||
pathrequired | string | |
required | boolean | |
write_back | boolean |
new_tools_restrictedadaptersChannel adapters by type
4 fields of adapters
enabledrequired | boolean | ||||
config | object | Adapter-specific settings (no secrets: tokens are credentials) | |||
policy | object | ||||
limits | object | ||||
1 field of | |||||
max_attachment_size | integer | Bytes |
providers8 fields of providers
idrequired | string |
| ||||||
typerequired | string | |||||||
namerequired | string | |||||||
baseUrlrequired | string | |||||||
preset | string | |||||||
defaultModel | string | |||||||
params | array<object> | |||||||
2 fields of | ||||||||
keyrequired | string | |
valuerequired | string |
requestDelayMsloopsInner (side) loops; main is implicit
8 fields of loops
namerequired | string | |
goalrequired | string | Becomes the loop's instructions |
enabledrequired | boolean | |
autostart | boolean | |
autonomous | boolean | |
model | object | |
compact_threshold | integer | null | |
tools | array<string> | Absolute allow-list, intersected with the host's enabled tools |
ws_connectionsservinglocked_fieldsmetadatarequiredcreated_at, updated_at, author, tags, version
Errors 400 · 401 · 403 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |||||||||||||||||||||||||||||||
| 401 | Missing or wrong bearer token (unauthorized) | |||||||||||||||||||||||||||||||
| 403 | The .adf must be reviewed on this machine before it loads (AGENT_REVIEW_REQUIRED), or the request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin) | ReviewRequiredResponse | ErrorResponse | ||||||||||||||||||||||||||||||
Option 2object | Every error body. Some routes add fields (e.g. 2 fields of | |||||||||||||||||||||||||||||||
errorrequired | string | Human-readable message |
code | string | Stable machine-readable code. Every error body has one: route-specific where listed, else the status default (400 bad_request, 403 forbidden, 404 not_found, 405 not_supported, 409 conflict, 500 internal_error, 502 upstream_error, 503 unavailable) |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/load" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"filePath":"/home/me/agents/agent-1.adf"}'Create an agent from a template, then load it
/agents/createStudio's "new agent", headless: template instance → sealed identity with owner/runtime stamps and attestations → marked reviewed → directory tracked → loaded (and started with start: true). Needs a ready owner identity; 409 identity_not_ready carries identity so a client can offer create / restore / unlock. load_failed (422) means the file was created, reviewed and tracked but could not load (e.g. no provider configured): fix it, then POST /agents/load.
Request bodyapplication/json · CreateAgentBody · optional
| Field | Type | Description |
|---|---|---|
name | string | File name (<= 64 chars). Omitted: a generated adjective-plant name. |
directory | string | Absolute, existing directory. Default: settings.agentsFolder, else ~/Documents/adf-agents. |
template | string | Template id (GET /templates). Default: settings.defaultTemplateId, else |
provider | string | App provider id (must exist in settings.providers) |
model | string | |
start | boolean |
Responses
| Status | Description | Body | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 201 | Created (and loaded; started when start) | CreateAgentResponse | |||||||||||||||
| |||||||||||||||||
Errors 400 · 401 · 403 · 409 · 422 · 500 · 503
| 400 | Invalid field (bad_request) | AgentCreateErrorResponse | |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| 401 | Missing or wrong bearer token (unauthorized) | ||||||||||||||||||||||||||||||||||
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | ||||||||||||||||||||||||||||||||||
| 409 | Owner identity not ready (identity_not_ready) or the name is taken in that directory (name_taken)identity_not_readyname_taken | AgentCreateErrorResponse | |||||||||||||||||||||||||||||||||
| 422 | The template was refused (template_missing, template_unreviewed, template_invalid) or the new file could not load (load_failed) | AgentCreateErrorResponse | |||||||||||||||||||||||||||||||||
| 500 | Unexpected runtime failure | ||||||||||||||||||||||||||||||||||
| 503 | The subsystem is not configured on this daemon | ||||||||||||||||||||||||||||||||||
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/create" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"agent-1","template":"standard","start":true}'{
"agentId": "Xk3v9QpLm2",
"name": "agent-1",
"filePath": "/home/me/Documents/adf-agents/agent-1.adf",
"did": "did:key:z6Mk…",
"started": true
}Scan folders and autostart their reviewed agents
/agents/autostartSame rules as daemon boot: autostart agents that are reviewed and not password-protected; others are reported in skipped.
Request bodyapplication/json · AutostartBody · required
| Field | Type | Description |
|---|---|---|
trackedDirsrequired | array<string> | |
maxDepth | integer |
Responses
| Status | Description | Body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | What was started, skipped and failed | AutostartReport | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
skippedrequiredarray<object> | 4 fields of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
filePathrequired | string | |
namerequired | string | |
reasonrequired | string | |
agentId | string |
failedrequired3 fields of failed
filePathrequired | string | |
namerequired | string | |
errorrequired | string |
Errors 400 · 401 · 403 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/autostart" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"trackedDirs":["/home/me/agents"],"maxDepth":5}'{
"scanned": 2,
"started": [
{
"agentId": "Xk3v9QpLm2",
"filePath": "/home/me/agents/agent-1.adf",
"name": "agent-1",
"startupTriggered": true
}
],
"skipped": [
{
"filePath": "/home/me/agents/agent-2.adf",
"name": "agent-2",
"reason": "unreviewed"
}
],
"failed": []
}Review information for an .adf file
/agents/reviewQuery parameters
| Name | Type | Description |
|---|---|---|
filePathrequired | string | Absolute path of the .adf file |
Responses
| Status | Description | Body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Review summary | ReviewInfo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mcpServersrequiredarray<object> | triggersrequiredarray<object> | 3 fields of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
typerequired | string | |
enabledrequired | boolean | |
targetCountrequired | integer |
codeExecutionrequiredmessagingrequired1 field of messaging
moderequired | string |
networkrequiredsecurityrequiredErrors 400 · 401 · 403 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/review?filePath=/home/me/agents/agent-2.adf" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Mark an .adf file's agent as reviewed
/agents/review/acceptRequest bodyapplication/json · ReviewAcceptBody · required
| Field | Type | Description |
|---|---|---|
filePathrequired | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Reviewed | ReviewInfo |
Fields as in ReviewInfo above. | ||
Errors 400 · 401 · 403 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/review/accept" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"filePath":"/home/me/agents/agent-2.adf"}'A loaded agent's reference (id, file, config)
/agents/{id}Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Agent reference | AgentRef |
Fields as in AgentRef above. | ||
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Agent runtime status
/agents/{id}/statusPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Status | AgentStatus | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/status" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"{
"id": "Xk3v9QpLm2",
"filePath": "/home/me/agents/agent-1.adf",
"name": "agent-1",
"handle": "agent-1",
"autostart": true,
"runtimeState": "idle",
"targetState": null,
"loopCount": 1
}Start an agent, loading it from a tracked folder when needed
/agents/{id}/startid may also name an agent that is not loaded: an .adf path, or an id / handle / name found in the tracked folders. The daemon loads it (review gate applies: 403) and starts it; loaded says whether it did. startupTriggered is true when the agent's start state fired its startup event. An identifier that matches several files answers 409 ambiguous_agent with the candidates: start one by its file path. No body.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Started | StartAgentResponse | ||||||||||||
| ||||||||||||||
Errors 401 · 403 · 404 · 409 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |||||||||||||||||||||||||||||||
| 403 | The .adf must be reviewed on this machine before it loads (AGENT_REVIEW_REQUIRED), or the request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin) | ReviewRequiredResponse | ErrorResponse | ||||||||||||||||||||||||||||||
Option 2object | Every error body. Some routes add fields (e.g. 2 fields of | |||||||||||||||||||||||||||||||
errorrequired | string | Human-readable message |
code | string | Stable machine-readable code. Every error body has one: route-specific where listed, else the status default (400 bad_request, 403 forbidden, 404 not_found, 405 not_supported, 409 conflict, 500 internal_error, 502 upstream_error, 503 unavailable) |
ambiguous_agent)errorrequired | string | Human-readable message | |||||||||
code | string | Stable machine-readable code. Every error body has one: route-specific where listed, else the status default (400 bad_request, 403 forbidden, 404 not_found, 405 not_supported, 409 conflict, 500 internal_error, 502 upstream_error, 503 unavailable) | |||||||||
candidatesrequired | array<object> | ||||||||||
3 fields of | |||||||||||
namerequired | string | |
handlerequired | string | null | |
filePathrequired | string |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/start" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"{
"success": true,
"loaded": false,
"startupTriggered": true,
"agent": {
"id": "Xk3v9QpLm2",
"filePath": "/home/me/agents/agent-1.adf",
"name": "agent-1",
"autostart": true,
"runtimeState": "idle",
"targetState": null,
"loopCount": 1
}
}Stop and unload an agent
/agents/{id}/stopGraceful: a running turn gets a 5 s grace period, then the agent is unloaded (its file stays on disk). No body.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||
|---|---|---|---|---|---|
| 200 | Stopped and unloaded | SuccessResponse | |||
| |||||
Errors 401 · 403 · 404 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/stop" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"{
"success": true
}Unload an agent (alias of stop)
/agents/{id}/unloadNo body.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||
|---|---|---|---|---|---|
| 200 | Unloaded | SuccessResponse | |||
| |||||
Errors 401 · 403 · 404 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/unload" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"{
"success": true
}Abort the current turn without unloading
/agents/{id}/abortA hard stop: the executor of main (or the named inner loop) is left stopped and runs no further turns, triggers or timers until the agent is reloaded. To end a turn and keep working, use /interrupt. Chats still queued behind the turn are discarded, never silently: a chat.discarded event names their turnIds and a System notice lands in the loop. Unknown loop 404; a loop with no running executor 409.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Query parameters
| Name | Type | Description |
|---|---|---|
loop | string | Cognition loop to address. Absent = main. Unknown loops answer 404. |
Request bodyapplication/json · LoopBody · optional
Optional; ?loop= wins.
| Field | Type | Description |
|---|---|---|
loop | string | Cognition loop; absent = main. The |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 200 | Aborted | AbortResponse | ||||||
| ||||||||
Errors 401 · 403 · 404 · 409 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 409 | The resource is in a state that does not allow this now | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/abort" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Interrupt the running turn and leave the loop idle
/agents/{id}/interruptEnds main's (or the named loop's) running turn and sets that executor idle; it keeps accepting chats, triggers and timers. Unlike /abort it never stops the executor, and chats queued behind the turn are kept and run next. interrupted is false when nothing was running; 409 when the loop is stopped or errored.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Query parameters
| Name | Type | Description |
|---|---|---|
loop | string | Cognition loop to address. Absent = main. Unknown loops answer 404. |
Request bodyapplication/json · LoopBody · optional
Optional; ?loop= wins.
| Field | Type | Description |
|---|---|---|
loop | string | Cognition loop; absent = main. The |
Responses
| Status | Description | Body | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Interrupted (or nothing to interrupt) | InterruptResponse | |||||||||
| |||||||||||
Errors 401 · 403 · 404 · 409 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 409 | The resource is in a state that does not allow this now | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/interrupt" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"success": true,
"interrupted": true,
"loop": "main"
}Move the running agent's display state
/agents/{id}/stateFleet-map semantics, not persisted to the .adf: a config.state change via PUT …/config does not move the running agent; this does.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Request bodyapplication/json · DisplayStateBody · required
| Field | Type | Description |
|---|---|---|
staterequired | string | Display (fleet-map) state of an agent |
Responses
| Status | Description | Body | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | State set | DisplayStateResponse | |||||||||
| |||||||||||
Errors 400 · 401 · 403 · 404 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/state" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"state":"idle"}'Read the agent config
/agents/{id}/configPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 200 | Config | AgentConfigResponse | ||||||
| ||||||||
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/config" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Replace the agent config
/agents/{id}/configValidated against the ADF config schema, persisted and applied to the running executor, trigger evaluator and loops. A changed state does not move the running agent (it is the persisted start state); use POST …/state. Owner locks (locked, locked_fields) bind the agent's own sys_update_config, not this route.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Request bodyapplication/json · AgentConfig · required
The agent's ADF v0.2 config (adf_config). Only the most used fields are listed; the full shape is the ADF spec's AgentConfig. Secret values never appear here.
Fields as in AgentConfig above.
Responses
| Status | Description | Body | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Saved | AgentConfigUpdateResponse | |||||||||
| |||||||||||
Errors 400 · 401 · 403 · 404 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X PUT "http://127.0.0.1:7385/agents/agent-1/config" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"adf_version": "0.2",
"id": "string",
"name": "string",
"description": "string",
"state": "active",
"autonomous": true,
"model": {
"provider": "anthropic",
"model_id": "claude-sonnet-4-5"
},
"instructions": "string",
"context": {},
"tools": [],
"triggers": {},
"security": {},
"limits": {},
"messaging": {},
"metadata": {}
}'The agent's tool catalog
/agents/{id}/toolsEvery built-in tool the main registry holds, every MCP tool its servers advertise and every declared tool, sorted by name, with declared state and description (what sys_get_config gives the agent). Read-only: change tools with PUT …/config.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Tools | AgentToolsResponse | |||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||
Errors 401 · 403 · 404 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/tools" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"List metadata entries (adf_meta)
/agents/{id}/metaPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Entries | MetaResponse | ||||||||||||||||||
| ||||||||||||||||||||
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/meta" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Set a metadata value
/agents/{id}/meta/{key}Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
keyrequired | string | Metadata key |
Request bodyapplication/json · MetaSetBody · required
| Field | Type | Description |
|---|---|---|
valuerequired | string | |
protection | string |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 200 | Saved | AgentSuccess | ||||||
| ||||||||
Errors 400 · 401 · 403 · 404 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X PUT "http://127.0.0.1:7385/agents/agent-1/meta/KEY" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"value":"42"}'{
"agentId": "Xk3v9QpLm2",
"success": true
}Delete a metadata value
/agents/{id}/meta/{key}Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
keyrequired | string | Metadata key |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 200 | success is false when nothing was deleted | AgentSuccess | ||||||
| ||||||||
Errors 401 · 403 · 404 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X DELETE "http://127.0.0.1:7385/agents/agent-1/meta/KEY" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"{
"agentId": "Xk3v9QpLm2",
"success": true
}Set a metadata key's protection
/agents/{id}/meta/{key}/protectionPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
keyrequired | string | Metadata key |
Request bodyapplication/json · MetaProtectionBody · required
| Field | Type | Description |
|---|---|---|
protectionrequired | string |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 200 | Saved | AgentSuccess | ||||||
| ||||||||
Errors 400 · 401 · 403 · 404 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X PATCH "http://127.0.0.1:7385/agents/agent-1/meta/KEY/protection" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"protection":"none"}'{
"agentId": "Xk3v9QpLm2",
"success": true
}List the agent's local tables
/agents/{id}/tablesPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Tables | TablesResponse | |||||||||||||||
| |||||||||||||||||
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/tables" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Read rows of a local table
/agents/{id}/tables/{table}Only local_* tables and adf_audit are readable (anything else: 400 "Invalid table name"); read the inbox and outbox through their own routes. limit default 100 (1–1000), offset default 0.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
tablerequired | string | Local table name ( |
Query parameters
| Name | Type | Description |
|---|---|---|
limit | integer | Maximum rows to return |
offset | integer | Rows to skip |
Responses
| Status | Description | Body | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Rows | TableQueryResponse | |||||||||
| |||||||||||
Errors 400 · 401 · 403 · 404 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/tables/TABLE" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Drop a local table
/agents/{id}/tables/{table}Only local_* tables can be dropped.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
tablerequired | string | Local table name ( |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 200 | Dropped | AgentSuccess | ||||||
| ||||||||
Errors 401 · 403 · 404 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X DELETE "http://127.0.0.1:7385/agents/agent-1/tables/TABLE" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"{
"agentId": "Xk3v9QpLm2",
"success": true
}Recent agent logs (adf_logs)
/agents/{id}/logslimit default 50 (clamped 1–500).
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Query parameters
| Name | Type | Description |
|---|---|---|
limit | integer | Maximum rows to return |
origin | string | Only this origin (e.g. |
event | string | Only this event name |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Log rows, newest last | AgentLogsResponse | |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
Errors 400 · 401 · 403 · 404
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/logs" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Clear the agent's logs
/agents/{id}/logsPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 200 | Cleared | AgentSuccess | ||||||
| ||||||||
Errors 401 · 403 · 404 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X DELETE "http://127.0.0.1:7385/agents/agent-1/logs" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"{
"agentId": "Xk3v9QpLm2",
"success": true
}Log rows after an id (tail)
/agents/{id}/logs/afterPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Query parameters
| Name | Type | Description |
|---|---|---|
afterIdrequired | integer | Return rows with id greater than this |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Newer rows | AgentLogsResponse |
Fields as in AgentLogsResponse above. | ||
Errors 400 · 401 · 403 · 404
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/logs/after?afterId=AFTER_ID" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Token usage from the agent's persisted loop rows
/agents/{id}/usageA rollup of adf_loop.tokens (compaction summary rows included). It excludes model_invoke and any provider call that created no loop row; the per-call usage/cost channel is the llm.completed umbilical event. input already includes cacheRead and cacheWrite; total = input + output.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Usage | AgentUsageResponse | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
byModelrequiredarray<object> | 7 fields of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
inputrequired | integer | |
outputrequired | integer | |
cacheReadrequired | integer | |
cacheWriterequired | integer | |
totalrequired | integer | |
modelrequired | string | |
rowsrequired | integer |
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/usage" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"