Tracked folders
Folders whose agents the daemon autostarts (settings.trackedDirectories).
On this page
List tracked folders
/tracked-dirsResponses
| Status | Description | Body | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Tracked folders | TrackedDirsList | |||||||||||||||||||||
| |||||||||||||||||||||||
Errors 401 · 403 · 503
| 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 | |
| 503 | The subsystem is not configured on this daemon |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/tracked-dirs" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Track a folder and autostart its agents
/tracked-dirs1. 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
| Field | Type | Description |
|---|---|---|
pathrequired | string | Absolute path to an existing directory |
Responses
| Status | Description | Body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 201 | Tracked | TrackDirResult | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
directoriesrequiredarray<string> | The tracked list after the change absorbedrequiredarray<string> | Tracked subfolders the new folder replaced autostartrequiredobject | 4 fields of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
scannedrequired | integer | .adf files found | ||||||||||||
startedrequired | array<object> | |||||||||||||
4 fields of | ||||||||||||||
agentIdrequired | string | |
filePathrequired | string | |
namerequired | string | |
startupTriggeredrequired | boolean |
skippedrequired4 fields of skipped
filePathrequired | string | |
namerequired | string | |
reasonrequired | string | |
agentId | string |
failedrequired3 fields of failed
filePathrequired | string | |
namerequired | string | |
errorrequired | string |
needsReviewrequiredAutostart skips with reason unreviewed
agentsrequired7 fields of agents
filePathrequired | string | |
namerequired | string | |
agentId | string | |
statusrequired | string | |
autostartrequired | boolean | |
reviewedrequired | boolean | |
error | string | Load error or why the file is unreadable |
Errors 400 · 401 · 403 · 405 · 409 · 500 · 503
| 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 | |||||||
| 405 | Settings store is read-only | TrackedDirErrorResponse | ||||||
| ||||||||
| 409 | Already tracked, itself or through a parent (coveredBy) | TrackedDirErrorResponse | ||||||
| ||||||||
| 500 | Unexpected runtime failure | |||||||
| 503 | The subsystem is not configured on this daemon | |||||||
Error bodies use the error format.
Example
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)
/tracked-dirspath 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
| Name | Type | Description |
|---|---|---|
pathrequired | string | The tracked folder |
unload | string | Also unload the agents loaded from under it |
Responses
| Status | Description | Body | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Untracked | UntrackDirResult | |||||||||||||||||||||
| |||||||||||||||||||||||
Errors 400 · 401 · 403 · 404 · 405 · 500 · 503
| 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 | Not a tracked folder | TrackedDirErrorResponse | ||||||
| ||||||||
| 405 | Settings store is read-only | TrackedDirErrorResponse | ||||||
| ||||||||
| 500 | Unexpected runtime failure | |||||||
| 503 | The subsystem is not configured on this daemon | |||||||
Error bodies use the error format.
Example
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
/tracked-dirs/agentsstatus: 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
| Name | Type | Description |
|---|---|---|
pathrequired | string | The tracked folder |
Responses
| Status | Description | Body | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Folder agents | FolderAgentsList | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
Errors 400 · 401 · 403 · 404 · 500 · 503
| 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 | Not a tracked folder | TrackedDirErrorResponse | ||||||
| ||||||||
| 500 | Unexpected runtime failure | |||||||
| 503 | The subsystem is not configured on this daemon | |||||||
Error bodies use the error format.
Example
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
/tracked-dirs/agents/allOne 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
| Status | Description | Body | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Folders with agents | TrackedAgentsList | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Errors 401 · 403 · 500 · 503
| 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 | |
| 500 | Unexpected runtime failure | |
| 503 | The subsystem is not configured on this daemon |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/tracked-dirs/agents/all" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"