Chat
Chat turns, event triggers and the agent's message inbox / outbox.
On this page
Display chat history of a loop
/agents/{id}/chatDisplay entries derived from the most recent loop rows. limit default 200 (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 |
loop | string | Cognition loop to address. Absent = main. Unknown loops answer 404. |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Chat history (null when none) | ChatHistoryResponse | |||||||||||||||||||||||||||||||||||||||||||||
llmMessagesrequiredarray<any> | totalrequiredinteger | earlierCountrequiredinteger | | ||||||||||||||||||||||||||||||||||||||||||||
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/chat" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Queue a user chat turn
/agents/{id}/chatThe owner's voice into main or any inner loop. Answers 202 at once (scheduling, not completion); follow the turn on GET /events, …/status or …/loop. An unknown loop answers 404 and a disabled one 409, before anything is queued. Match the returned turnId against event.turn_id on GET /events to follow this request's turn. Chats sent while the loop is busy queue in arrival order and none is ever dropped: the first interrupts the running turn, then the oldest queued chat runs as the next turn (its own turnId) and the others join it as consecutive user rows before its first model call, listed right away on a chat.delivered event (payload.turn_ids). Every turnId ends on a turn.completed (as its turn_id or in absorbed_turn_ids) or an agent.error; only /abort, unload or an off transition discard queued chats, announced by chat.discarded.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Request bodyapplication/json · ChatBody · required
| Field | Type | Description |
|---|---|---|
textrequired | string | |
loop | string | Cognition loop to talk to; absent = main. Unknown loop: 404; disabled loop: 409. |
Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 202 | Queued | AcceptedTurn | ||||||
| ||||||||
Errors 400 · 401 · 403 · 404 · 409 · 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, …) | |
| 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/chat" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text":"Summarize today'\''s inbox."}'{
"accepted": true,
"turnId": "turn_V1StGXR8_Z5j"
}Clear a loop's persisted chat / loop history
/agents/{id}/chatClears one loop's stream (default main, never all of them) and resets its in-memory session.
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. |
Responses
| Status | Description | Body | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Cleared | ChatClearResponse | |||||||||
| |||||||||||
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 DELETE "http://127.0.0.1:7385/agents/agent-1/chat" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Queue an ADF event dispatch
/agents/{id}/triggerAccepts a dispatch, a wrapped { dispatch }, a bare event (target fields at the top level or under target) or a batch (events). The daemon fills missing id, time and source. Event types: inbox, outbox, file_change, chat, timer, tool_call, task_create, task_complete, log_entry, startup, llm_call; data is required except for startup. Answers 202 at once.
Bypasses the TriggerEvaluator: the dispatch goes straight to the executor, with no enabled check, target/scope gate, filter, timing modifier, state gating or self-suppression. An inbox dispatch creates no adf_inbox row; for a real inbound message use the mesh server's POST /agents/{handle}/inbox.
No owner voice: data.message.source: "user" is refused (400; use POST …/chat, or source api / mesh), as are the internal flags skip_loop_append and pre_appended_loop. Match the returned turnId against event.turn_id on GET /events to follow this request's turn.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Request bodyapplication/json · TriggerBody · AdfEventDispatch | AdfBatchDispatch | object | AdfEvent · required
A dispatch, { dispatch: … }, a bare event, or a batch dispatch.
| Field | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Option 1 | object | Target fields may sit at the top level or under | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 fields of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eventrequired | object | |||||||||||||||||||
6 fields of | ||||||||||||||||||||
id | string | Default: generated |
typerequired | string | |
source | string | Default: |
time | string | ISO 8601; default: now |
data | any | Event payload; required (use null) for every type except startup. |
correlationId | string |
target5 fields of target · DispatchTarget
scope | string | |
lambda | string | |
command | string | |
warm | boolean | |
loop | string |
scopelambdacommandwarmloopOption 28 fields of Option 2 · AdfBatchDispatch
eventsrequired | array<AdfEvent> | |||||||||||||||||||
6 fields of | ||||||||||||||||||||
id | string | Default: generated |
typerequired | string | |
source | string | Default: |
time | string | ISO 8601; default: now |
data | any | Event payload; required (use null) for every type except startup. |
correlationId | string |
counttarget5 fields of target · DispatchTarget
scope | string | |
lambda | string | |
command | string | |
warm | boolean | |
loop | string |
scopelambdacommandwarmloopOption 31 field of Option 3
dispatchrequired | AdfEventDispatch | AdfBatchDispatch | |||||||
2 variants of | ||||||||
Option 1 | object | Target fields may sit at the top level or under |
Option 2 | object |
Option 4Responses
| Status | Description | Body | ||||||
|---|---|---|---|---|---|---|---|---|
| 202 | Queued | AcceptedTurn | ||||||
| ||||||||
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 -X POST "http://127.0.0.1:7385/agents/agent-1/trigger" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event": {
"type": "chat",
"data": {
"text": "ping"
}
},
"target": {
"scope": "agent"
}
}'{
"accepted": true,
"turnId": "turn_V1StGXR8_Z5j"
}List inbox messages
/agents/{id}/inboxPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Query parameters
| Name | Type | Description |
|---|---|---|
status | string | Only this status |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Messages | InboxResponse | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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/inbox" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Delete all inbox messages
/agents/{id}/inboxAudit snapshots are kept when the agent's audit config requires them.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Cleared | InboxClearResponse | |||||||||
| |||||||||||
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/inbox" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"List outbox messages
/agents/{id}/outboxPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Query parameters
| Name | Type | Description |
|---|---|---|
status | string | Only this status |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Messages | OutboxResponse | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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/outbox" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"