On this page

List the agent's files

GET/agents/{id}/files

Operation listAgentFilesAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Responses

StatusDescriptionBody
200Files (metadata)AgentFilesResponse
agentIdrequiredstring

Agent id

filesrequiredarray<FileListEntry>
7 fields of files
pathrequiredstring
sizerequiredinteger
mime_typestring
protectionrequiredstring

One of none, read_only, no_delete

authorizedrequiredboolean
created_atrequiredstring
updated_atrequiredstring
Errors 401 · 403 · 404
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/files" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Read one file

GET/agents/{id}/files/content

Operation getAgentFileContentAuthBearer token

Text-like files come back as encoding: "utf-8" with content; binary files as encoding: "base64" with content_base64.

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Query parameters

NameTypeDescription
pathrequiredstring

File path inside the agent

example: notes/today.md

Responses

StatusDescriptionBody
200File with content (utf-8) or content_base64FileContentResponse
agentIdrequiredstring

Agent id

pathrequiredstring
mime_typerequiredstring | null
sizerequiredinteger
protectionrequiredstring

One of none, read_only, no_delete

authorizedrequiredboolean
created_atrequiredstring
updated_atrequiredstring
encodingrequiredstring

One of utf-8, base64

contentstring

utf-8 files

content_base64string

Binary files

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/files/content?path=notes/today.md" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "path": "mind.md",
  "mime_type": "text/markdown",
  "size": 12,
  "protection": "none",
  "authorized": false,
  "created_at": "2026-09-01T10:00:00.000Z",
  "updated_at": "2026-09-01T10:00:00.000Z",
  "encoding": "utf-8",
  "content": "# Mind\n"
}

Write one file

PUT/agents/{id}/files/content

Operation writeAgentFileContentAuthBearer token

Text with content, binary with content_base64 (plus mime_type). Fires the agent's file-change triggers.

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Query parameters

NameTypeDescription
pathrequiredstring

File path inside the agent

example: notes/today.md

Request bodyapplication/json · FileWriteBody · required

One of content / content_base64 is required.

FieldTypeDescription
contentstring

Text content

content_base64string

Binary content (alias: contentBase64)

contentBase64string
mime_typestring

Alias: mimeType

mimeTypestring
protectionstring

One of none, read_only, no_delete

Responses

StatusDescriptionBody
200WrittenAgentSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
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 -X PUT "http://127.0.0.1:7385/agents/agent-1/files/content?path=notes/today.md" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"hello\n","mime_type":"text/plain"}'
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "success": true
}

Delete one file

DELETE/agents/{id}/files/content

Operation deleteAgentFileContentAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Query parameters

NameTypeDescription
pathrequiredstring

File path inside the agent

example: notes/today.md

Responses

StatusDescriptionBody
200success is false when nothing was deletedAgentSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
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 -X DELETE "http://127.0.0.1:7385/agents/agent-1/files/content?path=notes/today.md" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "success": true
}

Rename a file

POST/agents/{id}/files/rename

Operation renameAgentFileAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · FileRenameBody · required

FieldTypeDescription
oldPathrequiredstring
newPathrequiredstring

Responses

StatusDescriptionBody
200RenamedAgentSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
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 -X POST "http://127.0.0.1:7385/agents/agent-1/files/rename" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"oldPath":"string","newPath":"string"}'
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "success": true
}

Rename a folder (path prefix)

POST/agents/{id}/files/rename-folder

Operation renameAgentFolderAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · FolderRenameBody · required

FieldTypeDescription
oldPrefixrequiredstring
newPrefixrequiredstring

Responses

StatusDescriptionBody
200RenamedFolderRenameResponse
agentIdrequiredstring

Agent id

successrequiredboolean

Value true

countrequiredinteger

Files moved

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 -X POST "http://127.0.0.1:7385/agents/agent-1/files/rename-folder" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"oldPrefix":"string","newPrefix":"string"}'

Set a file's protection

PATCH/agents/{id}/files/protection

Operation setAgentFileProtectionAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · FileProtectionBody · required

FieldTypeDescription
pathrequiredstring
protectionrequiredstring

One of none, read_only, no_delete

Responses

StatusDescriptionBody
200SavedAgentSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
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 -X PATCH "http://127.0.0.1:7385/agents/agent-1/files/protection" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path":"string","protection":"none"}'
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "success": true
}

Mark a file as authorized code (or not)

PATCH/agents/{id}/files/authorized

Operation setAgentFileAuthorizedAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · FileAuthorizedBody · required

FieldTypeDescription
pathrequiredstring
authorizedrequiredboolean

Responses

StatusDescriptionBody
200SavedAgentSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
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 -X PATCH "http://127.0.0.1:7385/agents/agent-1/files/authorized" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path":"string","authorized":true}'
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "success": true
}

Read the primary document

GET/agents/{id}/document

Operation getAgentDocumentAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Responses

StatusDescriptionBody
200ContentTextContentResponse
agentIdrequiredstring

Agent id

contentrequiredstring
Errors 401 · 403 · 404
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/document" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Write the primary document

PUT/agents/{id}/document

Operation setAgentDocumentAuthBearer token

Fires the agent's file/document-change triggers.

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · TextContentBody · required

FieldTypeDescription
contentrequiredstring

Responses

StatusDescriptionBody
200SavedAgentSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
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 -X PUT "http://127.0.0.1:7385/agents/agent-1/document" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"# Notes\n"}'
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "success": true
}

Read mind.md

GET/agents/{id}/mind

Operation getAgentMindAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Responses

StatusDescriptionBody
200ContentTextContentResponse
agentIdrequiredstring

Agent id

contentrequiredstring
Errors 401 · 403 · 404
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/mind" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Write mind.md

PUT/agents/{id}/mind

Operation setAgentMindAuthBearer token

Path parameters

NameTypeDescription
idrequiredstring

Loaded agent: its id, handle or name.

example: agent-1

Request bodyapplication/json · TextContentBody · required

FieldTypeDescription
contentrequiredstring

Responses

StatusDescriptionBody
200SavedAgentSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
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 -X PUT "http://127.0.0.1:7385/agents/agent-1/mind" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"# Notes\n"}'
Response 200
{
  "agentId": "Xk3v9QpLm2",
  "success": true
}