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

> ## Agent Instructions
> These docs describe the Ancha CLI, npm package @ancha-labs/cli version 0.1.4, and the hosted workspace at app.ancha.io. Coding agents should start at https://docs.ancha.io/coding-agents. Run the CLI as `ancha` after `npm install -g @ancha-labs/cli`, or as `npx -y @ancha-labs/cli@0.1.4` without installing. Pass --json for machine-readable output, or set ANCHA_JSON=1. Every command ends with a `next:` line naming the next command. Exit codes: 0 pass, 1 a check failed or a comparison regressed, 2 usage, config or authentication error, 3 infrastructure error, 4 unimplemented endpoint with --strict.

# Dropbox

> A stateful replica of the Dropbox API v2 for one account: files and folders, uploads and downloads, search, revisions, shared links and shared folders.

The Dropbox replica implements 24 endpoints of the Dropbox API v2 for one account: files and folders, uploads up to 150 MB, downloads, search, revisions, shared links and shared folders. Its key is `dropbox`. It was tested with the `dropbox` SDK.

## Connect

| Variable | Value |
| - | - |
| `DROPBOX_API_URL` | Base URL, standing in for both `https://api.dropboxapi.com` and `https://content.dropboxapi.com`. Paths start with `/2/`. |
| `DROPBOX_ACCESS_TOKEN` | Fake access token. Send `Authorization: Bearer <token>`. |

```js Node theme={null}
import { Dropbox } from 'dropbox';
const dbx = new Dropbox({ accessToken: process.env.DROPBOX_ACCESS_TOKEN, fetch: (url: string, init?: RequestInit) => fetch(url.replace(/^https:\/\/(api|content)\.dropboxapi\.com/, process.env.DROPBOX_API_URL!), init) });
const { result } = await dbx.filesListFolder({ path: '' });
```

This is what `ancha connect dropbox --lang ts` prints. The SDK has no base-URL option, so give it a `fetch` that sends both Dropbox hosts to the replica.

## Endpoints

All 24 endpoints are partial. Anything else returns HTTP 501 with Dropbox's error shape and `x-ancha-gap: 1`.

| Method | Path | Notes |
| - | - | - |
| `POST` | `/2/files/list_folder` | `recursive`, `include_deleted` and `limit`. Shared links and property groups are gaps. |
| `POST` | `/2/files/list_folder/continue` | Pages through a listing, then reports changes since it. |
| `POST` | `/2/files/get_metadata`, `/2/files/create_folder_v2`, `/2/files/delete_v2`, `/2/files/copy_v2` | |
| `POST` | `/2/files/move_v2` | Folders move with everything under them; missing folders are created. |
| `POST` | `/2/files/upload` | `add`, `overwrite` and `update` modes, `autorename` and `content_hash`. Up to 150 MB; upload sessions are a gap. |
| `POST` | `/2/files/download` | The current or an earlier `rev`. |
| `POST` | `/2/files/search_v2` | File names and text contents; `path`, `max_results`, `file_status`, `filename_only` and `file_extensions`. |
| `POST` | `/2/files/search/continue_v2`, `/2/files/list_revisions`, `/2/files/restore` | |
| `POST` | `/2/files/get_temporary_link` | A download link valid for four hours of world time. |
| `GET` | `/temporary/{token}` | The link `get_temporary_link` returns. |
| `POST` | `/2/sharing/create_shared_link_with_settings` | One link per path: a second request answers `shared_link_already_exists` with the existing link. |
| `POST` | `/2/sharing/list_shared_links`, `/2/sharing/modify_shared_link_settings`, `/2/sharing/revoke_shared_link` | |
| `POST` | `/2/sharing/share_folder` | Completes immediately. |
| `POST` | `/2/sharing/add_folder_member` | Recorded, never emailed; unknown addresses become invitees. |
| `POST` | `/2/sharing/list_folder_members` | |
| `POST` | `/2/users/get_current_account`, `/2/users/get_space_usage` | |

## Starter data

The `dropbox-starter` dataset is the account of `ancha@acme.example` in the team **Acme**, with 25 entries.

| Folder | Contents |
| - | - |
| `/Sales/Bluefield Logistics` | "Bluefield proposal v2.pdf" with an earlier revision, a deleted "Bluefield proposal v1.pdf", and a `Security review` folder with "Acme SOC 2 Type II report 2026.pdf" and the security questionnaire answers. |
| `/Sales/Pinecrest Health` | The signed MSA and a draft order form for 20 additional seats. |
| `/Sales/Kestrel Credit Union` | "Renewal quote 2027.pdf". |
| `/Marketing` | "Acme product overview\.pdf" with a public shared link, a `Case studies` folder with the Ridgeway Robotics draft, and a `Logos` folder. |
| `/Customer uploads/Ridgeway Robotics` | A shared folder that Erin Walsh at Ridgeway Robotics and Laura Kim can edit, holding `warehouse-schema.csv` and `pick_lists_sample.csv` uploaded by Erin. |
| `/Team` | "Holiday schedule 2026.txt". |

The people the account can share with are Tom Hughes, Ellen Price, Anna Fischer and Laura Kim at Acme, and Erin Walsh outside it.

## Checks

Dropbox has no state checks. Use trace checks, for example `{ called: "POST /2/sharing/create_shared_link_with_settings" }` or `{ not_called: "POST /2/files/delete_v2" }`.

## Limits

* The SDK has no base-URL option: give it a fetch that sends `https://api.dropboxapi.com` and `https://content.dropboxapi.com` to `DROPBOX_API_URL`.
* One account; uploads up to 150 MB with no upload sessions; no file requests, Paper or team-space administration.
* Sharing records links and members; nothing is emailed.


## Related topics

- [Tools](https://docs.ancha.io/tools/overview.md)
- [Test file (scene.yaml)](https://docs.ancha.io/reference/test-file.md)
- [ancha connect](https://docs.ancha.io/cli/connect.md)
- [Introduction](https://docs.ancha.io/index.md)
- [Environment variables](https://docs.ancha.io/reference/environment-variables.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.