Authentication
Keep app and user credentials in your trusted backend. Give each agent runtime only its own short-lived agent token.
Credential layers
Agent tokens expire after four hours by default and cannot be refreshed. Use expires_in to mint replacements before expiry; the agent identity stays the same.
Existing user flow
Connect the user through OAuth, requesting the file and Agent Filesystem scopes your integration needs.
In your trusted backend shell, set the resulting user access token:
Choose token scopes
Scope syntax differs by interface:
For agent tokens, supported values are files.metadata.read, files.metadata.write, files.content.read, files.content.write, and account_info.read.
- Include
account_info.readfor account-root discovery. - In the agent-token API, omit
scopeto request the four file scopes. - Every requested scope must be granted to both the app and the user token.
Managed user flow
Sign in as your app
Create an Agent Filesystem app, then sign in. The CLI reads the secret from DBX_APP_SECRET or a hidden prompt for each app command; it does not save it.
Token lifecycle
Managed-user tokens cannot be refreshed. Repeat dbx login --user before expiry to replace one while keeping agent aliases. For backend calls, dbx user token app-user --profile provider --output=json returns expiry and scopes. Request only needed scopes; CLI user login also needs account_info.read.
Import a token issued by your backend
To import a token issued by your backend, pass the complete JSON output privately:
Imports clear local agent aliases. Keep agent IDs so you can continue managing the same agents. See Mount for mount renewal behavior.
Direct API integration
Managed-user routes accept either app authentication method:
- HTTP Basic: use the app key as the username and app secret as the password. The CLI uses this method when you sign in with
dbx login --app --app-key. - Bearer: send
Authorization: Bearer <app_access_token>. Obtain an app access token withgrant_type=client_credentials; use this token in the API reference playground.
Create one user per users/create request, omit tenant, and save the returned user_public_id. Use it with users/access_token/mint; scopes must be a nonempty array without duplicates. Use expires_in to schedule replacement tokens.
See the managed-user API reference for request schemas. For users/list, continue while next_cursor is present, even after an empty page.
Token storage
- Bind the Dropbox account ID or app-bound
user_public_idto your authenticated customer. - Keep secrets and existing-user OAuth refresh tokens in your backend secret store; cache access tokens by expiry.
- Verify customer ownership of client-supplied user identifiers.
- Deliver only the agent token and task input to the runtime.
Stop access
Short-lived tokens also expire automatically. Confirm revocation timing during onboarding.