SFTP List Directory
List directory contents on a VPS. Returns file names, types, sizes, and modification times.
Request
GET /api/v1/vps/{id}/sftp/list?path=/var/log
Required scope: vps:manage
Path Parameters
| Parameter |
Type |
Description |
id |
string |
The VPS ID |
Query Parameters
| Parameter |
Type |
Required |
Description |
path |
string |
Yes |
Absolute path of the directory to list |
Headers
| Header |
Required |
Value |
Authorization |
Yes |
Bearer YOUR_API_KEY |
Response
{
"data": {
"entries": [
{
"name": "syslog",
"isDirectory": false,
"size": 524288,
"modifiedAt": "2025-01-15T10:30:00+00:00"
},
{
"name": "nginx",
"isDirectory": true,
"size": 4096,
"modifiedAt": "2025-01-14T08:00:00+00:00"
}
]
}
}
Response Fields
| Field |
Type |
Description |
entries |
array |
List of directory entries |
entries[].name |
string |
File or directory name |
entries[].isDirectory |
boolean |
Whether the entry is a directory |
entries[].size |
number |
Size in bytes |
entries[].modifiedAt |
string |
Last modification timestamp (ISO 8601) |
Errors
| Status |
Code |
Description |
| 400 |
MISSING_PATH |
The path query parameter is missing |
| 400 |
INVALID_PATH |
Path is not absolute |
| 400 |
LIST_ERROR |
Directory could not be listed (e.g. does not exist) |
| 404 |
NOT_FOUND |
VPS not found or not accessible |
| 408 |
TIMEOUT |
Directory listing timed out |
| 502 |
SSH_AUTH_ERROR |
SSH authentication failed |
| 502 |
SSH_CONNECTION_ERROR |
Could not connect to VPS |
Example
curl "https://site.quest/api/v1/vps/699cdea2ab57a244bb5273fd/sftp/list?path=/var/log" \
-H "Authorization: Bearer YOUR_API_KEY"
MCP
This action is also available via the list_files MCP tool.