Quickstart
This example generates a client from the OpenAPI document, creates an agent for a user, and writes a file with the agent’s runtime token. Use an existing Dropbox user’s token or a token minted for a managed user.
Choose TypeScript or Python in the code switcher.
Agent Filesystem is in Private Preview and is subject to change. Contact your Dropbox representative to request access.
Before you begin
You need:
- An app enabled for the Agent Filesystem Private Preview. Follow Application Setup to create an Agent Filesystem application in the Developer Console.
- A user access token with the required file and Agent Filesystem scopes.
- Java 11 or later for OpenAPI Generator.
- Node.js 18 or later for TypeScript, or Python 3.10 or later for Python.
Download the Agent Filesystem OpenAPI document
and save it as agentfs-openapi.yaml in your project.
Generate the client
These commands use OpenAPI Generator 7.26.0. Pin the generator version in your project so regenerated clients keep a predictable interface.
TypeScript
Python
Set the credentials
To test with your own Dropbox account, open your enabled app in My apps, find the OAuth 2 section of its settings, and click Generate. This creates a user access token for your account. To get a token for another user, follow the OAuth guide to connect them through your app.
For a managed user, follow the managed user flow to create the user and mint a token, then use that token below.
Set the resulting token in a trusted server-side environment:
Keep the user token in your trusted backend. Give the agent runtime only its short-lived agent token.
Run the example
TypeScript
Python
Save the example as agentfs-example.ts, then run it from the trusted
environment where you set the variables.
Store the returned agent ID. Your backend uses it to mint later tokens and manage the same agent.
Which credential goes where
Only the runtime token enters the agent environment.
Managed users and tenants
The same agent and file operations work with a managed user’s token. Tenants are Coming soon and will add a separate administration and credential boundary.
See Authentication for token storage, caching, and revocation guidance.