Skip to main content

List Files

Lists files in a specific directory.

Both /api/list/files and /api/list/dirs inspect the physical storage directly. The endpoint is non-recursive and only returns files directly inside the requested directory. Subdirectories are not included in the result set.

Required Scope

file.list

Endpoint

POST /api/list/files

Example Request (HTTPie)

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

Raw JSON Body

{
"Params": "/my docs/webtest/"
}

Request Parameters

ParameterTypeDescription
ParamsstringDirectory path to list files from

If Params is omitted it will default to root /.

Example Response

[
{
"lastModified": 1778904174199,
"name": "my-text-file.txt",
"size": 484,
"type": "file"
},
{
"lastModified": 1778872438722,
"name": "a photo.jpg",
"size": 120865,
"type": "file"
},
{
"lastModified": 1778819733676,
"name": "index.html",
"size": 355,
"type": "file"
}
]

Response Fields

FieldTypeDescription
namestringFile name
sizeintegerFile size in bytes
typestringAlways file
lastModifiedintegerUNIX timestamp in milliseconds

Notes

  • The endpoint is non-recursive
  • Only files are returned
  • Directories are not included in the response
  • Paths are UNIX-style paths
  • Paths may contain spaces and UTF-8 characters
  • If the directory does not exist, an empty result or error may be returned depending on context
  • The root path / lists files from the storage root