Files
Browse and manage files and directories. Supports multi-mount storage (internal, SD card, USB).
Type Definitions
type File {
name: String!
path: String!
permission: String! # "rw" | "r"
createdAt: String # ISO 8601, null on some filesystems
updatedAt: String! # ISO 8601
size: Long! # 0 for directories
isDir: Boolean!
children: Int! # 0 for files; child count for directories
mediaId: String! # media store ID, empty when unavailable
}
type StorageMount {
id: String!
name: String!
path: String!
mountPoint: String!
fsType: String!
totalBytes: Long!
usedBytes: Long!
freeBytes: Long!
remote: Boolean!
alias: String!
}
type FileInfo {
path: String!
updatedAt: String!
size: Long!
tags: [Tag!]!
data: MediaFileInfo # image/video/audio metadata, null for other types
}
type MediaFileInfo {
# Union-like structure; fields vary by media type (image / video / audio)
width: Int
height: Int
duration: Int # milliseconds (video / audio)
artist: String
album: String
title: String
}
type FavoriteFolder {
rootPath: String!
fullPath: String!
alias: String # optional display alias, empty when not set
}Operations
mounts
List all available storage volumes (internal, SD card, USB).
query GetMounts {
mounts {
id name path mountPoint fsType totalBytes usedBytes freeBytes remote alias
}
}recentFiles
List recently modified files across all storage. Source of the "Recent" view in the Files UI.
query GetRecentFiles {
recentFiles {
name path permission createdAt updatedAt size isDir children mediaId
}
}files
List and search files under a root path with pagination. Pass an empty query to list all.
query GetFiles($root: String!, $offset: Int!, $limit: Int!, $query: String!, $sortBy: FileSortBy!) {
files(root: $root, offset: $offset, limit: $limit, query: $query, sortBy: $sortBy) {
name path permission createdAt updatedAt size isDir children mediaId
}
}fileInfo
Get stat + media metadata + tags for a single file. Pass fileName so the server can detect image/video/audio and load width, height, duration, etc.
query GetFileInfo($id: ID!, $path: String!, $fileName: String!) {
fileInfo(id: $id, path: $path, fileName: $fileName) {
path updatedAt size
tags { id name }
data { width height duration artist album title }
}
}fileIds
Resolve a list of filesystem paths to their media-store IDs (empty string when not indexed).
query GetFileIds($paths: [String!]!) {
fileIds(paths: $paths)
}uploadedChunks
List chunk indexes that have already been received for a resumable chunked upload. Used to resume interrupted uploads.
query GetUploadedChunks($fileId: String!) {
uploadedChunks(fileId: $fileId)
}createDir
Create a new directory and return it as a File object.
mutation CreateDir($path: String!) {
createDir(path: $path) {
name path permission createdAt updatedAt size isDir children mediaId
}
}renameFile
Rename a file or directory.
mutation RenameFile($path: String!, $name: String!) {
renameFile(path: $path, name: $name)
}writeTextFile
Write text content to a file. Set overwrite=false to append a "(1)" suffix when the file already exists.
mutation WriteTextFile($path: String!, $content: String!, $overwrite: Boolean!) {
writeTextFile(path: $path, content: $content, overwrite: $overwrite) {
name path size updatedAt
}
}deleteFiles
Delete one or more files or directories by exact path.
mutation DeleteFiles($paths: [String!]!) {
deleteFiles(paths: $paths)
}copyFile
Copy a file or directory to a destination path. Set overwrite to replace an existing file.
mutation CopyFile($src: String!, $dst: String!, $overwrite: Boolean!) {
copyFile(src: $src, dst: $dst, overwrite: $overwrite)
}moveFile
Move a file or directory to a destination path. Set overwrite to replace an existing file.
mutation MoveFile($src: String!, $dst: String!, $overwrite: Boolean!) {
moveFile(src: $src, dst: $dst, overwrite: $overwrite)
}addFavoriteFolder
Bookmark a folder for quick access. Returns the updated list of all bookmarked folders.
mutation AddFavoriteFolder($rootPath: String!, $fullPath: String!) {
addFavoriteFolder(rootPath: $rootPath, fullPath: $fullPath) {
rootPath fullPath alias
}
}removeFavoriteFolder
Remove a bookmarked folder. Returns the updated list of remaining folders.
mutation RemoveFavoriteFolder($fullPath: String!) {
removeFavoriteFolder(fullPath: $fullPath) {
rootPath fullPath alias
}
}setFavoriteFolderAlias
Set or update the alias shown for a bookmarked folder. Pass an empty string to clear the alias.
mutation SetFavoriteFolderAlias($fullPath: String!, $alias: String!) {
setFavoriteFolderAlias(fullPath: $fullPath, alias: $alias) {
rootPath fullPath alias
}
}deleteChunks
Delete all stored chunks for a chunked upload fileId. Use after a cancelled or failed upload to free up disk space.
mutation DeleteChunks($fileId: String!) {
deleteChunks(fileId: $fileId)
}mergeChunks
Merge previously uploaded chunks into the final file. Pass isAppFile=true to import the result into PlainApp's content-addressable AppFile store (used by chat attachments).
mutation MergeChunks($fileId: String!, $totalChunks: Int!, $path: String!, $replace: Boolean!, $isAppFile: Boolean!) {
mergeChunks(fileId: $fileId, totalChunks: $totalChunks, path: $path, replace: $replace, isAppFile: $isAppFile)
}