@apicity/dropbox
Dropbox HTTP API provider for users, files, content upload/download, and sharing endpoints.
Runtime dependencies:
zod@^4.6.6— request schemas attached to Dropbox endpoint methods as.schema
Installation
npm install @apicity/dropbox
# or
pnpm add @apicity/dropbox
Quick Start
import { createDropbox } from "@apicity/dropbox";
const dropbox = createDropbox({ oauthToken: process.env.DROPBOX_OAUTH_TOKEN! });
If oauthToken is omitted, the provider reads DROPBOX_OAUTH_TOKEN at request time.
The access token is only sent in the Authorization: Bearer ... header.
oauth2.token exchanges an authorization code (with an optional PKCE code_verifier) or a refresh token for an access token. It requires the clientId option, adds clientSecret when set, and posts the grant as a form body to oauthBaseURL (default https://api.dropboxapi.com).
API Reference
17 endpoints across 5 groups. Each method mirrors an upstream URL path.
check
POST dropbox.check.user
POST https://api.dropboxapi.com/2/check/user
Cost tier: cheap
const res = await dropbox.check.user({ /* ... */ });
files
POST dropbox.files.copyV2
POST https://api.dropboxapi.com/2/files/copy_v2
Cost tier: cheap
const res = await dropbox.files.copyV2({ /* ... */ });
POST dropbox.files.createFolderV2
POST https://api.dropboxapi.com/2/files/create_folder_v2
Cost tier: cheap
const res = await dropbox.files.createFolderV2({ /* ... */ });
POST dropbox.files.deleteV2
POST https://api.dropboxapi.com/2/files/delete_v2
Cost tier: cheap
const res = await dropbox.files.deleteV2({ /* ... */ });
POST dropbox.files.download
POST https://content.dropboxapi.com/2/files/download
Cost tier: cheap
const res = await dropbox.files.download({ /* ... */ });
POST dropbox.files.getMetadata
POST https://api.dropboxapi.com/2/files/get_metadata
Cost tier: cheap
const res = await dropbox.files.getMetadata({ /* ... */ });
POST dropbox.files.listFolder
POST https://api.dropboxapi.com/2/files/list_folder
Cost tier: cheap
const res = await dropbox.files.listFolder({ /* ... */ });
POST dropbox.files.listFolderContinue
POST https://api.dropboxapi.com/2/files/list_folder/continue
Cost tier: cheap
const res = await dropbox.files.listFolderContinue({ /* ... */ });
POST dropbox.files.moveV2
POST https://api.dropboxapi.com/2/files/move_v2
Cost tier: cheap
const res = await dropbox.files.moveV2({ /* ... */ });
POST dropbox.files.upload
POST https://content.dropboxapi.com/2/files/upload
Cost tier: cheap
const res = await dropbox.files.upload({ /* ... */ });
POST dropbox.files.uploadSession.appendV2
POST https://content.dropboxapi.com/2/files/upload_session/append_v2
Cost tier: cheap
const res = await dropbox.files.uploadSession.appendV2({ /* ... */ });
POST dropbox.files.uploadSession.finish
POST https://content.dropboxapi.com/2/files/upload_session/finish
Cost tier: cheap
const res = await dropbox.files.uploadSession.finish({ /* ... */ });
POST dropbox.files.uploadSession.start
POST https://content.dropboxapi.com/2/files/upload_session/start
Cost tier: cheap
const res = await dropbox.files.uploadSession.start({ /* ... */ });
oauth2
POST dropbox.oauth2.token
POST https://api.dropboxapi.com/oauth2/token
Cost tier: cheap
const res = await dropbox.oauth2.token({ /* ... */ });
sharing
POST dropbox.sharing.createSharedLinkWithSettings
POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings
Cost tier: cheap
const res = await dropbox.sharing.createSharedLinkWithSettings({ /* ... */ });
POST dropbox.sharing.listSharedLinks
POST https://api.dropboxapi.com/2/sharing/list_shared_links
Cost tier: cheap
const res = await dropbox.sharing.listSharedLinks({ /* ... */ });
users
POST dropbox.users.getCurrentAccount
POST https://api.dropboxapi.com/2/users/get_current_account
Cost tier: cheap
const res = await dropbox.users.getCurrentAccount();
Part of the apicity monorepo.
License
MIT — see LICENSE.