Setu Recipes: reusable workflows across every app.Browse templates

Integrations / Dropbox

Dropbox

Cloud file storage: browse, search, organise and share files and folders.

8 actions OAuth 2 4 read3 write1 destructive Calls api.dropboxapi.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "dropbox" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

ScopeWhy it is requested
account_info.readIdentify the connected Dropbox account
files.metadata.readSee the names, paths and details of your files and folders
files.content.writeCreate, move and delete files and folders
sharing.writeCreate shared links for your files and folders

Actions

Create folderwritedropbox.create_folderCreate a new folder at the given path in Dropbox, optionally renaming it automatically if the name is taken.

Needs scope: files.content.write

InputTypeDescription
pathstringRequiredPath of the new folder, e.g. /Homework/math
autorenamebooleanOptionalIf the name is taken, pick a different one instead of failing
TypeScript
await setu.execute({
  userId: "user_1",
  action: "dropbox.create_folder",
  input: {
    "path": "<path>"
  },
});
Delete file or folderdestructivedropbox.deleteDelete the file or folder at a path. A folder is deleted with everything inside it. It can be restored from Dropbox's deleted files for a limited time.

Needs scope: files.content.write

InputTypeDescription
pathstringRequiredPath of the file or folder to delete
TypeScript
await setu.execute({
  userId: "user_1",
  action: "dropbox.delete",
  input: {
    "path": "<path>"
  },
  confirm: true,
});
Get file or folder detailsreaddropbox.get_metadataGet the details (type, name, size, modified time, id) of one file or folder by its path or id. The root folder is not supported.

Needs scope: files.metadata.read

InputTypeDescription
pathstringRequiredPath such as /Homework/math or an id such as id:a4ayc_80_OEAAAAAAAAAYa
TypeScript
await setu.execute({
  userId: "user_1",
  action: "dropbox.get_metadata",
  input: {
    "path": "<path>"
  },
});
List folderreaddropbox.list_folderList the files and sub-folders directly inside a Dropbox folder. Use an empty string as the path for the root. Returns names, paths and a cursor for more.

Needs scope: files.metadata.read

InputTypeDescription
pathstringRequiredFolder path starting with a slash, e.g. /Homework/math. Use an empty string for the root.
recursivebooleanOptionalList every level below the folder (can be slow on big folders)
limitintegerOptionalApproximate maximum entries to return, 1 to 2000
TypeScript
await setu.execute({
  userId: "user_1",
  action: "dropbox.list_folder",
  input: {
    "path": "<path>"
  },
});
List folder (next page)readdropbox.list_folder_continueFetch the next page of a folder listing using the cursor returned by list_folder when has_more is true.

Needs scope: files.metadata.read

InputTypeDescription
cursorstringRequiredCursor from the previous list_folder or list_folder_continue reply
TypeScript
await setu.execute({
  userId: "user_1",
  action: "dropbox.list_folder_continue",
  input: {
    "cursor": "<cursor>"
  },
});
Move or renamewritedropbox.moveMove a file or folder to a new path, or rename it by moving it within the same folder. Folder contents move too.

Needs scope: files.content.write

InputTypeDescription
from_pathstringRequiredCurrent path of the file or folder
to_pathstringRequiredNew path, including the new name
autorenamebooleanOptionalIf the destination exists, pick a different name instead of failing
TypeScript
await setu.execute({
  userId: "user_1",
  action: "dropbox.move",
  input: {
    "from_path": "<from_path>",
    "to_path": "<to_path>"
  },
});