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

revisioninteger

W3-F: the resource's revision (monotonic per agent and resource; never reused across daemon restarts). Pass it as baseRevision (or If-Match) on the next write.

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

baseRevisioninteger

W3-F: write only over this revision of the resource (from a read or the last write). Another current revision answers 409 stale_revision. Without it (and without If-Match) the write replaces whatever is there.

range: ≥ 0

Header parameters

NameTypeDescription
If-Matchstring

W3-F: the base revision, as baseRevision (quotes and W/ are accepted; * is no base). Takes precedence over the query parameter and the body field.

example: "1792000000000001"

If-None-Matchstring

W3-F: * makes the write a create: refused with 409 stale_revision when the file exists. As the body's mustNotExist.

One of *

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

baseRevisioninteger

W3-F: write only over this revision (else 409 stale_revision); as the baseRevision query parameter

mustNotExistboolean

W3-F: create only: refused (409 stale_revision, with the existing file's revision) when the file exists. As If-None-Match: *.

Responses

StatusDescriptionBody
200WrittenRevisionedSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
revisioninteger

W3-F: the resource's revision (monotonic per agent and resource; never reused across daemon restarts). Pass it as baseRevision (or If-Match) on the next write.

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, …)
409W3-F: the resource changed since the write's base revision (stale_revision); nothing was written. A write to a document another runtime holds answers 409 agent_leased (or file_moving during a move) instead.StaleRevisionError
errorrequiredstring

Human-readable message

coderequiredstring

Value stale_revision

resourcerequiredstring

config, document, or the internal file path

revisionrequiredinteger

The current revision: a write with it as the base overwrites

baseRevisionrequiredinteger

The base the write named

writerrequiredResourceWriter | null

Who made the current revision (null: nobody known since the daemon first saw it)

2 fields of writer
kindrequiredstring

One of agent, client, cli

clientstring

client only

sizeinteger | null

Current size in bytes (null for config)

hashrequiredstring

sha1 of the current content (absent for a missing 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"}'

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
revisioninteger

W3-F: the resource's revision (monotonic per agent and resource; never reused across daemon restarts). Pass it as baseRevision (or If-Match) on the next write.

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

Query parameters

NameTypeDescription
baseRevisioninteger

W3-F: write only over this revision of the resource (from a read or the last write). Another current revision answers 409 stale_revision. Without it (and without If-Match) the write replaces whatever is there.

range: ≥ 0

Header parameters

NameTypeDescription
If-Matchstring

W3-F: the base revision, as baseRevision (quotes and W/ are accepted; * is no base). Takes precedence over the query parameter and the body field.

example: "1792000000000001"

Request bodyapplication/json · TextContentBody · required

FieldTypeDescription
contentrequiredstring
baseRevisioninteger

W3-F: write only over this revision (else 409 stale_revision); as the baseRevision query parameter

Responses

StatusDescriptionBody
200SavedRevisionedSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
revisioninteger

W3-F: the resource's revision (monotonic per agent and resource; never reused across daemon restarts). Pass it as baseRevision (or If-Match) on the next write.

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, …)
409W3-F: the resource changed since the write's base revision (stale_revision); nothing was written. A write to a document another runtime holds answers 409 agent_leased (or file_moving during a move) instead.StaleRevisionError
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"}'

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
revisioninteger

W3-F: the resource's revision (monotonic per agent and resource; never reused across daemon restarts). Pass it as baseRevision (or If-Match) on the next write.

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

Query parameters

NameTypeDescription
baseRevisioninteger

W3-F: write only over this revision of the resource (from a read or the last write). Another current revision answers 409 stale_revision. Without it (and without If-Match) the write replaces whatever is there.

range: ≥ 0

Header parameters

NameTypeDescription
If-Matchstring

W3-F: the base revision, as baseRevision (quotes and W/ are accepted; * is no base). Takes precedence over the query parameter and the body field.

example: "1792000000000001"

Request bodyapplication/json · TextContentBody · required

FieldTypeDescription
contentrequiredstring
baseRevisioninteger

W3-F: write only over this revision (else 409 stale_revision); as the baseRevision query parameter

Responses

StatusDescriptionBody
200SavedRevisionedSuccess
agentIdrequiredstring

Agent id

successrequiredboolean
revisioninteger

W3-F: the resource's revision (monotonic per agent and resource; never reused across daemon restarts). Pass it as baseRevision (or If-Match) on the next write.

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, …)
409W3-F: the resource changed since the write's base revision (stale_revision); nothing was written. A write to a document another runtime holds answers 409 agent_leased (or file_moving during a move) instead.StaleRevisionError
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"}'

Read an internal file's metadata

GET/agents/{id}/files/meta

Operation getAgentFileMetaAuthBearer token

Size, MIME type, protection and whether Studio reads it as text, without the content: a client decides before fetching bytes (GET …/files/raw with maxBytes).

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
200MetadataInternalFileMeta
agentIdrequiredstring
pathrequiredstring
mime_typestring | null
sizerequiredinteger
protectionstring
authorizedboolean
created_atstring
updated_atstring
textrequiredboolean

Studio's file viewer reads it as text (by extension)

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/meta?path=notes/today.md" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Download an internal file's bytes

GET/agents/{id}/files/raw

Operation getAgentFileRawAuthBearer token

The content as application/octet-stream (Content-Type is the file's MIME type). With maxBytes, a larger file answers 413 too_large with its size, before any byte is read.

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

maxBytesinteger

range: ≥ 0

Responses

StatusDescriptionBody
200The filestring
Errors 400 · 401 · 403 · 404 · 413
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, …)
413Larger than maxBytes

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/agents/agent-1/files/raw?path=notes/today.md" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Upload an internal file's bytes

PUT/agents/{id}/files/raw

Operation putAgentFileRawAuthBearer token

After receiving the body, the daemon revalidates the document and holds its lease through the write. A file moved while streaming returns 409 file_moving; a closed document returns 404; a lease acquired by another runtime returns 409 agent_leased. The body is the content (application/octet-stream, up to 64 MiB; ADF_DAEMON_RAW_BODY_LIMIT_MB). mimeType defaults by extension. unique=true keeps an existing file of that name and numbers the new one (the saved path is returned). 413 too_large, 415 for another content type. W3-F, as PUT /agents/{id}/files/content: a base revision (If-Match or baseRevision) that is not current, or a create (If-None-Match: * or mustNotExist=true) of a file that exists, answers 409 stale_revision and writes nothing; neither is taken with unique=true. The file_updated the write raises is not sent to the session named by X-ADF-Client-Session.

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

mimeTypestring
uniquestring

One of true, false

baseRevisioninteger

W3-F: write only over this revision of the resource (from a read or the last write). Another current revision answers 409 stale_revision. Without it (and without If-Match) the write replaces whatever is there.

range: ≥ 0

mustNotExiststring

W3-F: create only, as If-None-Match: *: refused (409 stale_revision) when the file exists

One of true, false

Header parameters

NameTypeDescription
If-Matchstring

W3-F: the base revision, as baseRevision (quotes and W/ are accepted; * is no base). Takes precedence over the query parameter and the body field.

example: "1792000000000001"

If-None-Matchstring

W3-F: * makes the write a create: refused with 409 stale_revision when the file exists. As the body's mustNotExist.

One of *

Request bodyapplication/octet-stream · string · required

No fields.

Responses

StatusDescriptionBody
200WrittenRawFileWriteResult
agentIdrequiredstring
successrequiredboolean

Value true

pathrequiredstring

Where it was saved (numbered with unique=true when the name was taken)

sizerequiredinteger
revisioninteger

W3-F: the revision of the written file (the writer is the request's client session, or cli)

Errors 400 · 401 · 403 · 404 · 409 · 413 · 415 · 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
413Larger than the upload limit
415Not application/octet-stream
500Unexpected runtime failure

Error bodies use the error format.

Example

Request
curl -X PUT "http://127.0.0.1:7385/agents/agent-1/files/raw?path=notes/today.md" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/octet-stream" \
  -d '"string"'