On this page

List tracked folders

GET/tracked-dirs

Operation listTrackedDirsAuthBearer token

Responses

StatusDescriptionBody
200Tracked foldersTrackedDirsList
maxDepthrequiredinteger
directoriesrequiredarray<TrackedDirEntry>
4 fields of directories
pathrequiredstring

As stored in settings.trackedDirectories

existsrequiredboolean
agentCountrequiredinteger

.adf files an autostart scan finds (maxDirectoryScanDepth)

loadedCountrequiredinteger

Of those, loaded in this daemon

Errors 401 · 403 · 503
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
503The subsystem is not configured on this daemon

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/tracked-dirs" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Track a folder and autostart its agents

POST/tracked-dirs

Operation trackDirAuthBearer token

1. path must be an absolute, existing directory; it is stored canonicalized (resolved, symlinks and 8.3 names expanded, no trailing separator). 2. It is persisted to settings.trackedDirectories; a new parent replaces tracked subfolders it covers (absorbed). 3. The live daemon (mesh tracked roots) is updated at once. 4. The folder gets the same autostart pass as daemon boot, with the review gate: unreviewed agents are not loaded and are listed in needsReview (accept with POST /agents/review/accept). agents is every agent in the folder after the pass. Tracking never creates, moves or deletes files; scans use maxDirectoryScanDepth (default 5).

Request bodyapplication/json · TrackDirBody · required

FieldTypeDescription
pathrequiredstring

Absolute path to an existing directory

Responses

StatusDescriptionBody
201TrackedTrackDirResult
entryrequiredobject
4 fields of entry · TrackedDirEntry
pathrequiredstring

As stored in settings.trackedDirectories

existsrequiredboolean
agentCountrequiredinteger

.adf files an autostart scan finds (maxDirectoryScanDepth)

loadedCountrequiredinteger

Of those, loaded in this daemon

directoriesrequiredarray<string>

The tracked list after the change

absorbedrequiredarray<string>

Tracked subfolders the new folder replaced

autostartrequiredobject
4 fields of autostart · AutostartReport
scannedrequiredinteger

.adf files found

startedrequiredarray<object>
4 fields of started
agentIdrequiredstring
filePathrequiredstring
namerequiredstring
startupTriggeredrequiredboolean
skippedrequiredarray<object>
4 fields of skipped
filePathrequiredstring
namerequiredstring
reasonrequiredstring

One of already_loaded, not_autostart, password_protected, unreviewed

agentIdstring
failedrequiredarray<object>
3 fields of failed
filePathrequiredstring
namerequiredstring
errorrequiredstring
needsReviewrequiredarray<object>

Autostart skips with reason unreviewed

agentsrequiredarray<FolderAgent>
7 fields of agents
filePathrequiredstring
namerequiredstring
agentIdstring
statusrequiredstring

One of loaded, needs_review, not_autostart, stopped, password_protected, unreadable

autostartrequiredboolean
reviewedrequiredboolean
errorstring

Load error or why the file is unreadable

Errors 400 · 401 · 403 · 405 · 409 · 500 · 503
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
405Settings store is read-onlyTrackedDirErrorResponse
errorrequiredstring
coveredBystring

409 only: the tracked folder that already covers the path

409Already tracked, itself or through a parent (coveredBy)TrackedDirErrorResponse
errorrequiredstring
coveredBystring

409 only: the tracked folder that already covers the path

500Unexpected runtime failure
503The subsystem is not configured on this daemon

Error bodies use the error format.

Example

Request
curl -X POST "http://127.0.0.1:7385/tracked-dirs" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path":"/home/me/agents"}'

Untrack a folder (files are never deleted)

DELETE/tracked-dirs

Operation untrackDirAuthBearer token

path matches the stored string exactly or names the same folder under another spelling; a folder gone from disk can still be untracked by its stored string. unload=true also unloads every loaded agent whose file is under it (files stay on disk); the default leaves them running.

Query parameters

NameTypeDescription
pathrequiredstring

The tracked folder

unloadstring

Also unload the agents loaded from under it

One of true, false

Responses

StatusDescriptionBody
200UntrackedUntrackDirResult
removedrequiredstring
directoriesrequiredarray<string>
unloadedrequiredarray<object>
3 fields of unloaded
agentIdrequiredstring
filePathrequiredstring
namerequiredstring
Errors 400 · 401 · 403 · 404 · 405 · 500 · 503
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
404Not a tracked folderTrackedDirErrorResponse
errorrequiredstring
coveredBystring

409 only: the tracked folder that already covers the path

405Settings store is read-onlyTrackedDirErrorResponse
errorrequiredstring
coveredBystring

409 only: the tracked folder that already covers the path

500Unexpected runtime failure
503The subsystem is not configured on this daemon

Error bodies use the error format.

Example

Request
curl -X DELETE "http://127.0.0.1:7385/tracked-dirs?path=PATH" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

The agents of one tracked folder and what each needs

GET/tracked-dirs/agents

Operation listTrackedDirAgentsAuthBearer token

status: loaded; needs_review (never reviewed here: POST /agents/review/accept); not_autostart (reviewed, loads on request); stopped (should have loaded but did not: error has the load error when known); password_protected; unreadable (error says why).

Query parameters

NameTypeDescription
pathrequiredstring

The tracked folder

example: /home/me/agents

Responses

StatusDescriptionBody
200Folder agentsFolderAgentsList
pathrequiredstring
agentsrequiredarray<FolderAgent>
7 fields of agents
filePathrequiredstring
namerequiredstring
agentIdstring
statusrequiredstring

One of loaded, needs_review, not_autostart, stopped, password_protected, unreadable

autostartrequiredboolean
reviewedrequiredboolean
errorstring

Load error or why the file is unreadable

Errors 400 · 401 · 403 · 404 · 500 · 503
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
404Not a tracked folderTrackedDirErrorResponse
errorrequiredstring
coveredBystring

409 only: the tracked folder that already covers the path

500Unexpected runtime failure
503The subsystem is not configured on this daemon

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/tracked-dirs/agents?path=/home/me/agents" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Every tracked folder with its agents

GET/tracked-dirs/agents/all

Operation listAllTrackedAgentsAuthBearer token

One read for a fleet view that lists stopped agents next to loaded ones. Each .adf is peeked read-only (sidecars a peek creates are removed), cached per file by the modification time and size of the file and its -wal, so polling opens only files that changed. The last load error an autostart pass hit (boot, POST /agents/autostart, POST /tracked-dirs) stays as error until the agent loads.

Responses

StatusDescriptionBody
200Folders with agentsTrackedAgentsList
maxDepthrequiredinteger
foldersrequiredarray<object>
5 fields of folders
pathrequiredstring

As stored in settings.trackedDirectories

existsrequiredboolean
agentCountrequiredinteger

.adf files an autostart scan finds (maxDirectoryScanDepth)

loadedCountrequiredinteger

Of those, loaded in this daemon

agentsrequiredarray<FolderAgent>
7 fields of agents
filePathrequiredstring
namerequiredstring
agentIdstring
statusrequiredstring

One of loaded, needs_review, not_autostart, stopped, password_protected, unreadable

autostartrequiredboolean
reviewedrequiredboolean
errorstring

Load error or why the file is unreadable

Errors 401 · 403 · 500 · 503
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
500Unexpected runtime failure
503The subsystem is not configured on this daemon

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/tracked-dirs/agents/all" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"