On this page

Display chat history of a loop

GET/agents/{id}/chat

Operation getAgentChatAuthBearer token

Display entries derived from the most recent loop rows. limit default 200 (clamped 1–500).

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Query parameters

NameTypeDescription
limitinteger

Maximum rows to return

loopstring

Cognition loop to address. Absent = main. Unknown loops answer 404.

Responses

StatusDescriptionBody
200Chat history (null when none)ChatHistoryResponse
agentIdrequiredstring

Agent id

looprequiredstring
chatHistoryrequiredobject | null
5 fields of chatHistory
versionrequiredinteger
uiLogrequiredarray<DisplayEntry>
5 fields of uiLog
idrequiredstring
typerequiredstring

One of user, text, tool_call, tool_result, thinking, error, trigger, compaction, context

contentrequiredstring
timestamprequiredinteger
metadataobject
llmMessagesrequiredarray<any>
totalrequiredinteger
earlierCountrequiredinteger
Errors 400 · 401 · 403 · 404 · 500
400Invalid 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
401Missing or wrong bearer token (unauthorized)
403The 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
404Unknown agent (or the named resource: loop, task, file, …)
500Unexpected runtime failure

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/agents/agent-1/chat" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Queue a user chat turn

POST/agents/{id}/chat

Operation chatAgentAuthBearer token

The 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

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · ChatBody · required

FieldTypeDescription
textrequiredstring
loopstring

Cognition loop to talk to; absent = main. Unknown loop: 404; disabled loop: 409.

Responses

StatusDescriptionBody
202QueuedAcceptedTurn
acceptedrequiredboolean

Value true

turnIdrequiredstring

Correlation id: the events of the turn that handles this request carry it as event.turn_id on GET /events

Errors 400 · 401 · 403 · 404 · 409 · 500
400Invalid 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
401Missing or wrong bearer token (unauthorized)
403The 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
404Unknown agent (or the named resource: loop, task, file, …)
409The resource is in a state that does not allow this now
500Unexpected runtime failure

Error bodies use the error format.

Example

Request
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."}'
Response 202
{
  "accepted": true,
  "turnId": "turn_V1StGXR8_Z5j"
}

Clear a loop's persisted chat / loop history

DELETE/agents/{id}/chat

Operation clearAgentChatAuthBearer token

Clears one loop's stream (default main, never all of them) and resets its in-memory session.

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Query parameters

NameTypeDescription
loopstring

Cognition loop to address. Absent = main. Unknown loops answer 404.

Responses

StatusDescriptionBody
200ClearedChatClearResponse
agentIdrequiredstring

Agent id

looprequiredstring
successrequiredboolean

Value true

Errors 401 · 403 · 404 · 409 · 500
401Missing or wrong bearer token (unauthorized)
403The 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
404Unknown agent (or the named resource: loop, task, file, …)
409The resource is in a state that does not allow this now
500Unexpected runtime failure

Error bodies use the error format.

Example

Request
curl -X DELETE "http://127.0.0.1:7385/agents/agent-1/chat" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Queue an ADF event dispatch

POST/agents/{id}/trigger

Operation triggerAgentAuthBearer token

Accepts 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

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · TriggerBody · AdfEventDispatch | AdfBatchDispatch | object | AdfEvent · required

A dispatch, { dispatch: … }, a bare event, or a batch dispatch.

FieldTypeDescription
Option 1object

Target fields may sit at the top level or under target (default scope: agent).

7 fields of Option 1 · AdfEventDispatch
eventrequiredobject
6 fields of event · AdfEvent
idstring

Default: generated

typerequiredstring

One of inbox, outbox, file_change, chat, timer, tool_call, task_create, task_complete, log_entry, startup, llm_call

sourcestring

Default: daemon:http

timestring

ISO 8601; default: now

dataany

Event payload; required (use null) for every type except startup. data.message.source: "user" and the internal flags skip_loop_append / pre_appended_loop are refused.

correlationIdstring
targetobject
5 fields of target · DispatchTarget
scopestring

One of agent, system

lambdastring
commandstring
warmboolean
loopstring
scopestring

One of agent, system

lambdastring
commandstring
warmboolean
loopstring
Option 2object
8 fields of Option 2 · AdfBatchDispatch
eventsrequiredarray<AdfEvent>

items: ≥ 1

6 fields of events
idstring

Default: generated

typerequiredstring

One of inbox, outbox, file_change, chat, timer, tool_call, task_create, task_complete, log_entry, startup, llm_call

sourcestring

Default: daemon:http

timestring

ISO 8601; default: now

dataany

Event payload; required (use null) for every type except startup. data.message.source: "user" and the internal flags skip_loop_append / pre_appended_loop are refused.

correlationIdstring
countinteger
targetobject
5 fields of target · DispatchTarget
scopestring

One of agent, system

lambdastring
commandstring
warmboolean
loopstring
scopestring

One of agent, system

lambdastring
commandstring
warmboolean
loopstring
Option 3object
1 field of Option 3
dispatchrequiredAdfEventDispatch | AdfBatchDispatch
2 variants of dispatch
Option 1object

Target fields may sit at the top level or under target (default scope: agent).

Fields as in AdfEventDispatch above.

Option 2object

Fields as in AdfBatchDispatch above.

Option 4object

Fields as in AdfEvent above.

Responses

StatusDescriptionBody
202QueuedAcceptedTurn
acceptedrequiredboolean

Value true

turnIdrequiredstring

Correlation id: the events of the turn that handles this request carry it as event.turn_id on GET /events

Errors 400 · 401 · 403 · 404
400Invalid 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
401Missing or wrong bearer token (unauthorized)
403The 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
404Unknown agent (or the named resource: loop, task, file, …)

Error bodies use the error format.

Example

Request
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"
  }
}'
Response 202
{
  "accepted": true,
  "turnId": "turn_V1StGXR8_Z5j"
}

List inbox messages

GET/agents/{id}/inbox

Operation getAgentInboxAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Query parameters

NameTypeDescription
statusstring

Only this status

One of unread, read, archived

Responses

StatusDescriptionBody
200MessagesInboxResponse
agentIdrequiredstring

Agent id

messagesrequiredarray<InboxMessage>
24 fields of messages
idrequiredstring
fromrequiredstring
tostring
reply_tostring
networkstring
thread_idstring
parent_idstring
subjectstring
contentrequiredstring
content_typestring
attachmentsarray<object>
metaobject
sender_aliasstring
recipient_aliasstring
message_idstring
ownerstring
cardstring
return_pathstring
sourcestring
source_contextobject
sent_atinteger
received_atrequiredinteger
statusrequiredstring

One of unread, read, archived

original_messagestring
Errors 400 · 401 · 403 · 404
400Invalid 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
401Missing or wrong bearer token (unauthorized)
403The 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
404Unknown agent (or the named resource: loop, task, file, …)

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/agents/agent-1/inbox" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Delete all inbox messages

DELETE/agents/{id}/inbox

Operation clearAgentInboxAuthBearer token

Audit snapshots are kept when the agent's audit config requires them.

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Responses

StatusDescriptionBody
200ClearedInboxClearResponse
agentIdrequiredstring

Agent id

successrequiredboolean

Value true

deletedrequiredinteger
Errors 401 · 403 · 404 · 500
401Missing or wrong bearer token (unauthorized)
403The 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
404Unknown agent (or the named resource: loop, task, file, …)
500Unexpected runtime failure

Error bodies use the error format.

Example

Request
curl -X DELETE "http://127.0.0.1:7385/agents/agent-1/inbox" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

List outbox messages

GET/agents/{id}/outbox

Operation getAgentOutboxAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Query parameters

NameTypeDescription
statusstring

Only this status

One of pending, sent, delivered, failed

Responses

StatusDescriptionBody
200MessagesOutboxResponse
agentIdrequiredstring

Agent id

messagesrequiredarray<OutboxMessage>
24 fields of messages
idrequiredstring
fromrequiredstring
torequiredstring
addressstring
reply_tostring
networkstring
thread_idstring
parent_idstring
subjectstring
contentrequiredstring
content_typestring
attachmentsarray<object>
metaobject
sender_aliasstring
recipient_aliasstring
message_idstring
ownerstring
cardstring
return_pathstring
status_codeinteger
created_atrequiredinteger
delivered_atinteger
statusrequiredstring

One of pending, sent, delivered, failed

original_messagestring
Errors 400 · 401 · 403 · 404
400Invalid 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
401Missing or wrong bearer token (unauthorized)
403The 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
404Unknown agent (or the named resource: loop, task, file, …)

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/agents/agent-1/outbox" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"