Files and folders: list (with recursive listing and cursor paging), metadata, search, create, move, copy, delete, restore, revisions, and the batch variants that run as async jobs.
Paths are Dropbox paths (/Reports/Q3.pdf, case-insensitive), ids
(id:a4ayc_80_OEAAAAAAAAAYa) or rev:...; the root is "" (see
::dropbox/normalize-path). Results are Dropbox's metadata Maps
(.tag = file, folder or deleted); ::dropbox/to-doc-file
gives the provider-neutral record.
Batch jobs. delete-batch, copy-batch, move-batch and
create-folder-batch may finish at once or return an async job id.
Nothing here waits: each returns a BatchJob (state is
"complete" or "async"); poll later with the matching check-*
function from a schedule or a task retry policy, and stop when
is-done is true.
Scopes. files.metadata.read for listing, metadata and search;
files.content.write for writes; files.permanent_delete is not used.
Values
LIST_LOCAL_KEYS
LIST_LOCAL_KEYS: Vec []
SEARCH_OPTION_KEYS
SEARCH_OPTION_KEYS: Vec [
"path",
"max_results",
"order_by",
"file_status",
"filename_only",
"file_extensions",
"file_categories",
"account_id"
]
Functions
batch-failures
fn (job: Map): Vec
The failed entries of a complete BatchJob (each {".tag": "failure", failure: <error union>}).
Example
job {entries: [{".tag": "success"}, {".tag": "failure", failure: {".tag": "too_many_write_operations"}}]}
length(::dropbox::files/batch-failures(job)) // 1
check-copy-batch
fn (job-id: Str): BatchJob
fn (job-id: Str, opts: Map): BatchJob
POST files/copy_batch/check_v2 - the status of a copy batch job, as a
BatchJob.
Example
job ::dropbox::files/check-copy-batch("dbjid:AAB")
::dropbox::files/is-done(job)
check-create-folder-batch
fn (job-id: Str): BatchJob
fn (job-id: Str, opts: Map): BatchJob
POST files/create_folder_batch/check - the status of a create-folder
batch job, as a BatchJob.
Example
job ::dropbox::files/check-create-folder-batch("dbjid:AAB")
job.entries
check-delete-batch
fn (job-id: Str): BatchJob
fn (job-id: Str, opts: Map): BatchJob
POST files/delete_batch/check - the status of a delete batch job, as a
BatchJob.
Example
job ::dropbox::files/check-delete-batch("dbjid:AAB")
job.state
check-move-batch
fn (job-id: Str): BatchJob
fn (job-id: Str, opts: Map): BatchJob
POST files/move_batch/check_v2 - the status of a move batch job, as a
BatchJob.
Example
job ::dropbox::files/check-move-batch("dbjid:AAB")
::dropbox::files/is-done(job)
copy-batch
fn (pairs: Vec): BatchJob
fn (pairs: Vec, opts: Map): BatchJob
POST files/copy_batch_v2 - copy up to 1000 [from, to] pairs (or
{from_path, to_path} Maps) in one job. Options: autorename. Returns
a BatchJob; poll check-copy-batch later when async.
Example
job ::dropbox::files/copy-batch([["/a.txt", "/Archive/a.txt"], ["/b.txt", "/Archive/b.txt"]], {autorename: true})
job.state
copy-path
fn (from-path: Str, to-path: Str): Map
fn (from-path: Str, to-path: Str, opts: Map): Map
POST files/copy_v2 - copy a file or folder. Returns the copy's metadata.
Options: autorename.
Example
copied ::dropbox::files/copy-path("/Reports/Q3.pdf", "/Archive/Q3.pdf")
copied.id
create-folder
fn (path: Str): Map
fn (path: Str, opts: Map): Map
POST files/create_folder_v2 - create a folder (and any missing parents).
Returns its metadata. Options: autorename (pick a free name instead of
failing on a conflict). A 409 path/conflict/folder means it already
exists.
Example
folder ::dropbox::files/create-folder("/Reports/2026")
folder.id
// Pick a free name instead of failing on a conflict
copy ::dropbox::files/create-folder("/Reports/2026", {autorename: true})
copy.name
create-folder-batch
fn (paths: Vec): BatchJob
fn (paths: Vec, opts: Map): BatchJob
POST files/create_folder_batch - create up to 10,000 folders. Options:
autorename, force_async. Returns a BatchJob; poll
check-create-folder-batch later when async.
Example
job ::dropbox::files/create-folder-batch(["/Reports/2026", "/Reports/2027"], {force_async: true})
job.job-id
delete-batch
fn (paths: Vec): BatchJob
fn (paths: Vec, opts: Map): BatchJob
POST files/delete_batch - delete up to 1000 paths in one job. Returns
a BatchJob; when state is "async", poll check-delete-batch(job.job-id)
later (from a schedule or a task retry), not in a loop.
job ::dropbox::files/delete-batch(["/tmp/a.txt", "/tmp/b.txt"])
status if(eq(job.state, "async"), ::dropbox::files/check-delete-batch(job.job-id), job)
::dropbox::files/is-done(status)
delete-path
fn (path: Str): Map
fn (path: Str, opts: Map): Map
POST files/delete_v2 - delete a file or folder (with its contents).
Deleted files can be restored with restore-file within the account's
version-history window. Returns the deleted entry's metadata. Options:
parent_rev (only delete if the file is still at that rev; files only).
Example
deleted ::dropbox::files/delete-path("/tmp/a.txt")
deleted.name
// Only if the file has not changed
::dropbox::files/delete-path("/tmp/b.txt", {parent_rev: "a1c10ce0dd78"})
ensure-folder
fn (path: Str): Map
fn (path: Str, opts: Map): Map
Create a folder unless it already exists. Returns its metadata either way.
Example
folder ::dropbox::files/ensure-folder("/Reports/2026")
folder.id
entry-metadata
fn (entry: Map): Map?
The metadata of a successful batch entry (pure): handles {".tag": "success", metadata: {...}} and {".tag": "success", success: {...}}.
Null for failures.
Example
::dropbox::files/entry-metadata({".tag": "success", metadata: {name: "a.txt"}}) // {name: "a.txt"}
::dropbox::files/entry-metadata({".tag": "failure"}) // null
exists
fn (path: Str): Bool
fn (path: Str, opts: Map): Bool
True when something exists at path, false on 409 not_found; other
failures are returned as the Err.
Example
if(::dropbox::files/exists("/Reports/Q3.pdf"), "found", "missing")
get-doc-file
fn (path: Str): ::dropbox/DocFile
fn (path: Str, opts: Map): ::dropbox/DocFile
get-metadata as a DocFile.
Example
file ::dropbox::files/get-doc-file("/Reports/Q3.pdf")
file.content-hash
get-metadata
fn (path: Str): Map
fn (path: Str, opts: Map): Map
POST files/get_metadata - metadata for a file or folder by path, id or
rev:. Options: include_deleted (return metadata for a deleted
entry instead of a 409 path/not_found), include_media_info,
include_has_explicit_shared_members. The root folder has no metadata.
meta-data ::dropbox::files/get-metadata("/Reports/Q3.pdf")
meta-data.rev
is-done
fn (job: Map): Bool
True when a BatchJob (or a raw launch/check result) has finished,
successfully or not.
Example
::dropbox::files/is-done({state: "in_progress"}) // false
::dropbox::files/is-done({".tag": "complete", entries: []}) // true
list-all
fn (path: Str?): Vec
fn (path: Str?, opts: Map): Vec
fn (path: Str?, opts: Map, limit: Int?): Vec
Every entry under path (all pages), or at most limit (null for
no limit). Options as for list-folder.
files filter(::dropbox::files/list-all("/Contracts", {recursive: true}, 5000), ::dropbox/is-file)
list-files
fn (path: Str?): Vec
fn (path: Str?, opts: Map): Vec
The files (not folders) under path, as DocFiles, all pages. Options
as for list-folder (pass {recursive: true} for the tree).
Example
files ::dropbox::files/list-files("/Reports", {recursive: true})
map(files, %.path)
list-folder
fn (path: Str?): Map
fn (path: Str?, opts: Map): Map
POST files/list_folder - one page of a folder's entries:
{entries, cursor, has_more}. Pass {recursive: true} for the whole
tree. Follow cursor with list-folder-continue, or use list-all.
page ::dropbox::files/list-folder("/Reports", {limit: 500})
page.entries
list-folder-arg
fn (path: Str?, opts: Map): Map
The files/list_folder argument (pure): path (normalised; "" is
the root) plus Dropbox options from opts: recursive, limit
(1..2000, approximate), include_deleted, include_mounted_folders,
include_non_downloadable_files, include_has_explicit_shared_members,
include_restorable_info, shared_link ({url, password?}).
Example
::dropbox::files/list-folder-arg("Reports/", {recursive: true, retry: false}) // {path: "/Reports", recursive: true}
list-folder-continue
fn (cursor: Str): Map
fn (cursor: Str, opts: Map): Map
POST files/list_folder/continue - the next page after cursor. A 409
reset (check ::dropbox::api/is-reset) means the cursor is no longer
valid: list again from list-folder.
Example
page ::dropbox::files/list-folder("/Reports")
more if(page.has_more, ::dropbox::files/list-folder-continue(page.cursor), null)
list-revisions
fn (path: Str): Map
fn (path: Str, opts: Map): Map
POST files/list_revisions - a file's revisions, newest first:
{is_deleted, entries, server_deleted?}. Options: limit (1..100,
default 10), mode ("path" (default) or "id"), before_rev (path
mode only).
Example
revisions ::dropbox::files/list-revisions("/Reports/Q3.pdf", {limit: 50})
map(revisions.entries, %.rev)
match-metadata
fn (match-entry: Map): Map?
The metadata entry of a search match (pure): match.metadata.metadata,
or null.
Example
::dropbox::files/match-metadata({metadata: {metadata: {name: "a.txt"}}}) // {name: "a.txt"}
move-batch
fn (pairs: Vec): BatchJob
fn (pairs: Vec, opts: Map): BatchJob
POST files/move_batch_v2 - move up to 1000 [from, to] pairs in one
job. Options: autorename, allow_ownership_transfer. Returns a
BatchJob; poll check-move-batch later when async.
Example
job ::dropbox::files/move-batch([["/Inbox/a.txt", "/Done/a.txt"], ["/Inbox/b.txt", "/Done/b.txt"]])
job.state
move-path
fn (from-path: Str, to-path: Str): Map
fn (from-path: Str, to-path: Str, opts: Map): Map
POST files/move_v2 - move or rename a file or folder (a folder moves
with its contents). Returns the moved entry's metadata. Options:
autorename, allow_ownership_transfer.
Example
moved ::dropbox::files/move-path("/Inbox/Q3.pdf", "/Reports/Q3.pdf", {autorename: true})
moved.path_display
relocation-arg
fn (from-path: Str, to-path: Str, opts: Map): Map
The files/move_v2 / copy_v2 argument (pure): from_path, to_path
plus autorename, allow_ownership_transfer from opts.
Example
::dropbox::files/relocation-arg("a.txt", "/b/a.txt", {autorename: true})
// {from_path: "/a.txt", to_path: "/b/a.txt", autorename: true}
relocation-entries
fn (pairs: Vec): Vec
Batch relocation entries (pure): a Vec of [from, to] pairs or
{from_path, to_path} Maps becomes [{from_path, to_path}] with
normalised paths.
Example
::dropbox::files/relocation-entries([["a.txt", "/b/a.txt"]]) // [{from_path: "/a.txt", to_path: "/b/a.txt"}]
restore-file
fn (path: Str, rev: Str): Map
fn (path: Str, rev: Str, opts: Map): Map
POST files/restore - restore a file to revision rev (from
list-revisions), deleted or not. Returns the restored file's metadata.
Example
revisions ::dropbox::files/list-revisions("/Reports/Q3.pdf")
oldest last(revisions.entries)
::dropbox::files/restore-file("/Reports/Q3.pdf", oldest.rev)
search
fn (query: Str): Map
fn (query: Str, opts: Map): Map
POST files/search_v2 - one page of search results: {matches, has_more, cursor?}. Each match has metadata.metadata (the entry)
and match_type; use match-metadata or search-all. Dropbox
returns at most 10,000 matches in total. Results lag recent changes
by a few minutes (the index is eventually consistent).
page ::dropbox::files/search("quarterly plan", {path: "/Reports", file_extensions: ["pdf", "docx"]})
search-all
fn (query: Str): Vec
fn (query: Str, opts: Map): Vec
fn (query: Str, opts: Map, limit: Int?): Vec
Every match's metadata entry for query (all pages), or at most limit
(null for no limit). Options as for search.
Example
entries ::dropbox::files/search-all("quarterly plan", {path: "/Reports"}, 200)
map(entries, %.path_display)
search-arg
fn (query: Str, opts: Map): Map
The files/search_v2 argument (pure). query is at most 1000
characters. Flat options are moved where Dropbox wants them:
path, max_results (1..1000, default 100), order_by
("relevance", "last_modified_time"), file_status ("active",
"deleted"), filename_only, file_extensions, file_categories
("pdf", "document", "spreadsheet", ...), account_id go into
options; include_highlights goes into match_field_options. An
options Map in opts is merged too.
Example
::dropbox::files/search-arg("plan", {path: "Reports", max_results: 10})
// {query: "plan", options: {path: "/Reports", max_results: 10}}
search-continue
fn (cursor: Str): Map
fn (cursor: Str, opts: Map): Map
POST files/search/continue_v2 - the next page of a search after
cursor.
Example
page ::dropbox::files/search("quarterly plan")
more if(page.has_more, ::dropbox::files/search-continue(page.cursor), null)
to-batch-job
fn (result: Map): BatchJob
Normalise a batch launch ({".tag": "async_job_id" | "complete", ...})
or check result (in_progress / complete / failed) into a
BatchJob (pure).
Example
::dropbox::files/to-batch-job({".tag": "async_job_id", async_job_id: "dbjid:AAB"}).state // "async"
::dropbox::files/to-batch-job({".tag": "async_job_id", async_job_id: "dbjid:AAB"}).job-id // "dbjid:AAB"
Types
BatchJob
BatchJob type {
state: Str,
job-id: Str?,
entries: Vec,
error: Any,
raw: Any
}
A batch job launch or status, normalised (pure; see to-batch-job).
state-"async"(launched; poll withjob-id),"in_progress","complete"or"failed"job-id- the async job id (launches only)entries- per-item results when complete (each.tagissuccessorfailure)error- the failure union whenstateis"failed"raw- the Dropbox response