POST
/
api
/
filesystem
/
search
curl --request POST \
  --url http://localhost:4242/{computer_name}/api/filesystem/search \
  --header 'Content-Type: application/json' \
  --data '{
  "include_hidden": false,
  "max_results": 100,
  "pattern": "*.txt",
  "root_path": "/home/user"
}'
[
  {
    "name": "document.txt",
    "path": "/home/user/documents/document.txt",
    "type": "file",
    "size": 1024,
    "modified_time": "2024-03-10T12:34:56",
    "is_hidden": false,
    "extension": "txt"
  }
]

Body

application/json
root_path
string
required

Root directory to start search from

Example:

"/home/user"

pattern
string
required

Glob pattern to search for

Example:

"*.txt"

max_results
integer
default:100

Maximum number of results to return

Required range: x > 0
Example:

100

include_hidden
boolean
default:false

Whether to include hidden files/directories

Example:

false

Response

200
application/json
Successfully searched for files
name
string
required

File or directory name

Example:

"document.txt"

path
string
required

Full path to the file or directory

Example:

"/home/user/documents/document.txt"

type
string
required

Type of entry: 'file' or 'directory'

Example:

"file"

size
integer
required

Size in bytes

Example:

1024

modified_time
string
required

Last modification time

Example:

"2024-03-10T12:34:56"

is_hidden
boolean
required

Whether the file/directory is hidden

Example:

false

extension
string | null

File extension if applicable

Example:

"txt"