> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ospribrain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dropbox Integration

> Connect Dropbox to browse, import files, set up folder sync, and download directly.

## Connecting Dropbox

<Steps>
  <Step title="Open the Dropbox panel">
    In the Vault, click the **Dropbox** tab in the sidebar, or use **+ New, then Import from Dropbox**.
  </Step>

  <Step title="Click Connect Dropbox">
    You see: "Browse, import, and sync files directly from your Dropbox account into this vault." Click the button.
  </Step>

  <Step title="Grant permissions">
    You are redirected to Dropbox OAuth. Approve read access to your files. Required scopes: `account_info.read`, `files.metadata.read`, `files.content.read`.
  </Step>

  <Step title="Verify connection">
    The panel shows your connected account email with a green "Connected" label and a file browser.
  </Step>
</Steps>

<Frame caption="Dropbox panel in connected state with folder browser">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/ospribrain/images/vault-dropbox-panel.png" alt="Dropbox panel" />
</Frame>

## Browsing Your Dropbox

Once connected, the panel shows a full file browser:

| Element              | Description                                        |
| -------------------- | -------------------------------------------------- |
| **Breadcrumbs**      | Navigate up the folder tree                        |
| **Back button**      | Go to parent folder                                |
| **Refresh**          | Reload current folder contents                     |
| **Sync this folder** | Set up sync for the current folder                 |
| **Select all files** | Toggle selection for all files in view             |
| **Folder items**     | Click to navigate into the folder                  |
| **File items**       | Click to select for import; "Open in Dropbox" link |

### File Icons

Files display with color-coded icons based on type:

* **Images** (jpg, jpeg, png, gif, webp, svg) — Purple
* **Documents** (pdf, doc, docx, txt, md) — Blue
* **Other files** — Gray

### Pagination

The browser auto-paginates Dropbox results (up to 2,000 entries on initial load). For larger folders, cursor-based pagination loads additional batches.

## Importing Files (One-Time)

<Steps>
  <Step title="Browse to your files">
    Navigate through your Dropbox folders.
  </Step>

  <Step title="Select files">
    Click individual files or use "Select all files" to select everything in the current view. Selected files show a blue highlight.
  </Step>

  <Step title="Click Import to vault">
    A footer bar shows "X file(s) selected" with an **Import to vault** button.
  </Step>

  <Step title="Files are downloaded and uploaded">
    Each file is downloaded from Dropbox (using a temporary download link) and uploaded to the current vault. Toast confirms: "N file(s) imported"
  </Step>
</Steps>

## Setting Up Folder Sync

Folder sync creates an ongoing link between a Dropbox folder and a vault.

<Steps>
  <Step title="Navigate to the folder">
    Browse to the Dropbox folder you want to sync.
  </Step>

  <Step title="Click Sync this folder">
    A sync dialog opens.
  </Step>

  <Step title="Choose target vault">
    Select which vault to sync into from the dropdown: Default, Sales, Science, Marketing, or any custom vault.
  </Step>

  <Step title="Click Sync Now">
    The sync runs as a background task. You see a toast: "Adding and syncing..." You do not need to keep the page open.
  </Step>
</Steps>

### What Sync Does

* Downloads all files from the Dropbox folder recursively
* Creates a matching folder structure in your target vault
* Files are automatically indexed for Brain AI search
* The synced folder appears in the "Synced Folders" list with a vault badge (e.g., "Sales")

### Re-syncing

To pull new files added since the last sync:

1. Find the folder in the **Synced Folders** list
2. Click the **re-sync** button
3. New and modified files are downloaded and added

### Removing a Sync

Click the **trash icon** on any synced folder to remove the sync relationship. This does not delete files already imported into the vault. Toast confirms: "Folder removed"

## Synced Folders List

The top of the Dropbox panel shows all synced folders with:

| Column          | Description                             |
| --------------- | --------------------------------------- |
| **Folder name** | The Dropbox folder path                 |
| **Vault badge** | Which vault it syncs to (e.g., "Sales") |
| **Last synced** | When the last sync completed            |
| **File count**  | Number of files in the sync             |

<Frame caption="Synced folder showing the target vault badge">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/ospribrain/images/vault-dropbox-synced.png" alt="Synced folder with vault badge" />
</Frame>

## Downloading Files

While browsing your Dropbox, you can download any file directly by clicking the download button next to it. This downloads from Dropbox without importing into the vault.

## Disconnecting

Click **Disconnect** in the panel header to remove your Dropbox connection. This:

* Removes your OAuth tokens
* Does not delete files already imported into vaults
* Does not remove synced folder configurations (they become inactive)

Toast confirms: "Dropbox disconnected"

## Troubleshooting

### "Invalid client\_id" Error

Ensure your Dropbox app has the correct scopes enabled:

* `account_info.read`
* `files.metadata.read`
* `files.content.read`

Also verify your redirect URI includes your domain (e.g., `https://www.ospribrain.com/api/dropbox/callback`).

### Sync Not Completing

* Syncs run in the background — wait a few minutes for large folders
* Check the Synced Folders list for status updates
* Try clicking re-sync on the folder

### "Navigate into a folder first"

You need to be inside a folder (not at the Dropbox root) to set up sync. Click into a specific folder first.
