Troubleshooting
If requests fail, run zero doctor check-connector --env-name DROPBOX_TOKEN or zero doctor check-connector --url https://api.dropboxapi.com/2/users/get_current_account --method POST
User
Get Current Account
curl -s -X POST "https://api.dropboxapi.com/2/users/get_current_account" \
--header "Authorization: Bearer $DROPBOX_TOKEN"
Get Space Usage
curl -s -X POST "https://api.dropboxapi.com/2/users/get_space_usage" \
--header "Authorization: Bearer $DROPBOX_TOKEN"
Files & Folders
List Folder
Use "" for root, or /path/to/folder for subfolders.
curl -s -X POST "https://api.dropboxapi.com/2/files/list_folder" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"\", \"recursive\": false, \"limit\": 100}"
List Folder (Continue)
When has_more is true in the response, use the cursor to get more results.
curl -s -X POST "https://api.dropboxapi.com/2/files/list_folder/continue" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"cursor\": \"<cursor>\"}"
Get Latest Cursor
Get a cursor for the current state without listing files. Useful for detecting changes later.
curl -s -X POST "https://api.dropboxapi.com/2/files/list_folder/get_latest_cursor" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"\", \"recursive\": true}"
Get File/Folder Metadata
curl -s -X POST "https://api.dropboxapi.com/2/files/get_metadata" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\"}"
Search Files
curl -s -X POST "https://api.dropboxapi.com/2/files/search:2" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"query\": \"report\", \"options\": {\"max_results\": 20, \"file_status\": \"active\"}}"
Search Continue
curl -s -X POST "https://api.dropboxapi.com/2/files/search/continue:2" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"cursor\": \"<cursor>\"}"
Create Folder
curl -s -X POST "https://api.dropboxapi.com/2/files/create_folder:2" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/New Folder\", \"autorename\": false}"
Delete File or Folder
curl -s -X POST "https://api.dropboxapi.com/2/files/delete:2" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/path/to/delete\"}"
Permanently Delete
Requires Dropbox Business with permanent delete enabled.
curl -s -X POST "https://api.dropboxapi.com/2/files/permanently_delete" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/path/to/delete\"}"
Move File or Folder
curl -s -X POST "https://api.dropboxapi.com/2/files/move:2" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"from_path\": \"/old/file.txt\", \"to_path\": \"/new/file.txt\", \"autorename\": false}"
Copy File or Folder
curl -s -X POST "https://api.dropboxapi.com/2/files/copy:2" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"from_path\": \"/source/file.txt\", \"to_path\": \"/dest/file.txt\", \"autorename\": false}"
List File Revisions
curl -s -X POST "https://api.dropboxapi.com/2/files/list_revisions" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\", \"limit\": 10}"
Restore File to Revision
curl -s -X POST "https://api.dropboxapi.com/2/files/restore" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\", \"rev\": \"<revision-id>\"}"
Save URL to Dropbox
Download a URL directly into Dropbox.
curl -s -X POST "https://api.dropboxapi.com/2/files/save_url" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Downloads/file.pdf\", \"url\": \"https://example.com/file.pdf\"}"
Get Tags
curl -s -X POST "https://api.dropboxapi.com/2/files/tags/get" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"paths\": [\"/Documents/report.pdf\"]}"
Add Tag
curl -s -X POST "https://api.dropboxapi.com/2/files/tags/add" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\", \"tag_text\": \"important\"}"
Remove Tag
curl -s -X POST "https://api.dropboxapi.com/2/files/tags/remove" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\", \"tag_text\": \"important\"}"
Upload & Download
Upload File (up to 150 MB)
curl -s -X POST "https://content.dropboxapi.com/2/files/upload" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Dropbox-API-Arg: {\"path\": \"/Documents/report.pdf\", \"mode\": \"add\", \"autorename\": true}" \
--header "Content-Type: application/octet-stream" \
--data-binary @report.pdf
mode: add (fail if exists), overwrite, update (with rev).
Download File
curl -s -X POST "https://content.dropboxapi.com/2/files/download" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Dropbox-API-Arg: {\"path\": \"/Documents/report.pdf\"}" \
-o report.pdf
Get Temporary Download Link
curl -s -X POST "https://api.dropboxapi.com/2/files/get_temporary_link" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\"}"
Returns a temporary link (4 hours) that doesn't require auth.
Get Thumbnail
curl -s -X POST "https://content.dropboxapi.com/2/files/get_thumbnail:2" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Dropbox-API-Arg: {\"resource\": {\".tag\": \"path\", \"path\": \"/Photos/image.jpg\"}, \"format\": \"jpeg\", \"size\": \"w256h256\"}" \
-o thumbnail.jpg
Sharing
Create Shared Link
curl -s -X POST "https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\", \"settings\": {\"requested_visibility\": \"public\"}}"
Visibility: public, team_only, password (with link_password).
List Shared Links
curl -s -X POST "https://api.dropboxapi.com/2/sharing/list_shared_links" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Documents/report.pdf\"}"
Modify Shared Link
curl -s -X POST "https://api.dropboxapi.com/2/sharing/modify_shared_link_settings" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"url\": \"https://www.dropbox.com/s/xxx/file.pdf\", \"settings\": {\"requested_visibility\": \"team_only\"}}"
Revoke Shared Link
curl -s -X POST "https://api.dropboxapi.com/2/sharing/revoke_shared_link" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"url\": \"https://www.dropbox.com/s/xxx/file.pdf\"}"
Share Folder
curl -s -X POST "https://api.dropboxapi.com/2/sharing/share_folder" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"path\": \"/Shared Project\", \"acl_update_policy\": \"editors\"}"
Add Folder Member
curl -s -X POST "https://api.dropboxapi.com/2/sharing/add_folder_member" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"shared_folder_id\": \"<folder-id>\", \"members\": [{\"member\": {\".tag\": \"email\", \"email\": \"user@example.com\"}, \"access_level\": {\".tag\": \"editor\"}}]}"
List Folder Members
curl -s -X POST "https://api.dropboxapi.com/2/sharing/list_folder_members" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"shared_folder_id\": \"<folder-id>\"}"
Remove Folder Member
curl -s -X POST "https://api.dropboxapi.com/2/sharing/remove_folder_member" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"shared_folder_id\": \"<folder-id>\", \"member\": {\".tag\": \"email\", \"email\": \"user@example.com\"}, \"leave_a_copy\": false}"
List Shared Folders
curl -s -X POST "https://api.dropboxapi.com/2/sharing/list_folders" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"limit\": 100}"
File Requests
List File Requests
curl -s -X POST "https://api.dropboxapi.com/2/file_requests/list" \
--header "Authorization: Bearer $DROPBOX_TOKEN"
Create File Request
curl -s -X POST "https://api.dropboxapi.com/2/file_requests/create" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"title\": \"Upload receipts\", \"destination\": \"/File Requests/Receipts\", \"open\": true}"
Get File Request
curl -s -X POST "https://api.dropboxapi.com/2/file_requests/get" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"id\": \"<file-request-id>\"}"
Update File Request
curl -s -X POST "https://api.dropboxapi.com/2/file_requests/update" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"id\": \"<file-request-id>\", \"title\": \"Upload Q2 receipts\", \"open\": true}"
Delete File Requests
curl -s -X POST "https://api.dropboxapi.com/2/file_requests/delete" \
--header "Authorization: Bearer $DROPBOX_TOKEN" \
--header "Content-Type: application/json" \
-d "{\"ids\": [\"<file-request-id>\"]}"
Count File Requests
curl -s -X POST "https://api.dropboxapi.com/2/file_requests/count" \
--header "Authorization: Bearer $DROPBOX_TOKEN"
Guidelines
- All POST: Dropbox API uses POST for nearly everything, including reads. Don't use GET.
- Paths: Start with
/for absolute paths. Use""(empty string) for root inlist_folder. Paths are case-insensitive but case-preserving. - Base URLs: Use
api.dropboxapi.comfor metadata operations,content.dropboxapi.comfor file content (upload/download/thumbnail). - Upload limit: Simple upload supports up to 150 MB. For larger files, use upload sessions (
upload_session/start,append,finish). - Pagination: When
has_moreis true, call the*/continueendpoint with the returned cursor. - Rate limits: Back off on 429 responses. Use
Retry-Afterheader. - Shared links: Use
create_shared_link_with_settings(not deprecatedcreate_shared_link). - Batch operations:
copy_batch,move_batch,delete_batchare available for bulk operations.
How to Look Up More API Details
- Full API Reference: https://www.dropbox.com/developers/documentation/http/documentation
- Files: https://www.dropbox.com/developers/documentation/http/documentation#files
- Sharing: https://www.dropbox.com/developers/documentation/http/documentation#sharing
- File Requests: https://www.dropbox.com/developers/documentation/http/documentation#file_requests
- Users: https://www.dropbox.com/developers/documentation/http/documentation#users
- Paper: https://www.dropbox.com/developers/documentation/http/documentation#paper