v1

latestOpenAPI 3.1.02026-07-17254060.5 KB
files

Read or list files

Read the contents of files or list files from the remote system.

get/v1/files

Query parameters

action'list' | 'read' required

Action to perform.

pathstring required

For "read": Absolute file path to read. To read multiple files, specify this parameter multiple times.

For "list": Absolute path to the directory to list.

patternstring

Glob pattern to filter files/directories for the "list" action.

itself'false' | 'true'

For the "list" action, itself specifies whether to return information about the directory itself ("true") or list the contents of the directory ("false").

Response

For "list": JSON array of file information.

For "read": Multipart form data response with file contents and metadata. Raw multipart response example:

Content-Type: multipart/form-data; boundary=01234567890123456789012345678901\r
--01234567890123456789012345678901\r
Content-Disposition: form-data; name="files"; filename="/etc/hosts"\r
\r
127.0.0.1 localhost  # \xf0\x9f\x98\x80\nfoo\r\nbar\r
--01234567890123456789012345678901\r
Content-Disposition: form-data; name="response"\r
\r
{
    "result": [{"path": "/etc/hosts"}],
    "status": "OK",
    "status-code": 200,
    "type": "sync"
}\r
--01234567890123456789012345678901--\r
typestring

Response type, "sync".

status-codeinteger

HTTP response status code.

statusstring

The description of the HTTP status code.

See the IANA list.