Skip to main content

List Directories

Lists directories recursively from a specific root path.

Both /api/list/files and /api/list/dirs inspect the physical storage directly. The endpoint returns all subdirectories below the requested path. Only directories are returned in the response.

Required Scope

file.list

Endpoint

POST /api/list/dirs

Example Request (HTTPie)

http POST https://webN.ftpgrid.com/api/list/dirs \
Authorization:"Bearer YOUR_TOKEN" \
Params="/my files"

Raw JSON Body

{
"Params": "/my files"
}

Request Parameters

ParameterTypeDescription
ParamsstringRoot path where directories should be listed recursively

If Params is omitted it will default to root /.

Example Response

[
{
"name": "documents",
"path": "/documents",
"type": "directory"
},
{
"name": "projects",
"path": "/documents/projects",
"type": "directory"
},
{
"name": "archive",
"path": "/documents/projects/archive",
"type": "directory"
}
]

Response Fields

FieldTypeDescription
namestringDirectory name
pathstringFull directory path
typestringAlways directory

Notes

  • The endpoint is recursive
  • Only directories are returned
  • Files are not included in the response
  • Paths are UNIX-style paths
  • Paths may contain spaces and UTF-8 characters
  • The root path / lists all directories recursively
  • Large directory structures may result in larger response payloads