Drive API Scopes and Permissions
Reference for the 11 Drive scopes, plan and add-on access, mailbox constraints, and safe token design.
Article details
Type, difficulty, plans, and last updated info.
▼
Article details
Type, difficulty, plans, and last updated info.
- Type
- Reference
- Difficulty
- Intermediate
- Plans
- Starter · Pro · Agency · + Drive Add-on
- Last updated
- Sep 10, 2026
Drive scopes decide exactly what an API token or MCP agent can do with TrekMail Drive. A good token is narrow: it has the smallest set of scopes needed for one job, a clear name, and an expiration date.
The Drive API has 11 scopes across Account Drive, mailbox Drive, share links, permanent delete, Drive Add-on status, and sync-device passwords. These scopes belong to ops tokens (tm_live_...). Message tokens (tm_msg_...) are still for email operations.
Scope reference
| Scope | Use it for | Notes |
|---|---|---|
drive:account:read |
List Account Drive spaces, folders, files, trash, usage, and download links | Safe default for reporting and search agents |
drive:account:write |
Create folders, upload files, rename, move, trash, and restore in Account Drive | Mutates files but does not permanently delete |
drive:account:share |
Create, list, and revoke public share links for Account Drive files | Raw share tokens are returned only when created |
drive:account:purge |
Permanently purge trashed Account Drive items and empty trash | High-risk scope; grant only to trusted maintenance agents |
drive:mailbox:read |
Browse mailbox Drive spaces allowed by the token | Can be narrowed with mailbox constraints |
drive:mailbox:write |
Upload and manage files in allowed mailbox Drive spaces | Mutates mailbox-owned Drive data |
drive:mailbox:share |
Create, list, and revoke public links for allowed mailbox files | Use with clear expiry and download limits |
drive:mailbox:purge |
Permanently purge trashed mailbox Drive files and folders | High-risk scope; keep separate from daily automation |
drive:addon:read |
Read Drive Add-on status, pricing, and cancellation preview | Read-only; no subscription mutations |
drive:devices:read |
List Drive sync-device passwords | Shows labels, scope, last use, and expiry, never the plaintext password |
drive:devices:write |
Create, rotate, and revoke Drive sync-device passwords | Can create a password only within the caller's own Drive permissions |
Read, write, share, purge
Drive separates common tasks into four permission levels:
- Read can list spaces, browse folders, inspect metadata, view trash, and request download URLs.
- Write can upload, create folders, rename, move, trash, and restore.
- Share can create, list, and revoke public share links.
- Purge can permanently delete trashed items or empty trash.
Do not give purge to a general-purpose assistant. If you need automated cleanup, create a separate token named for that job, keep it disabled in MCP until needed, and review the audit log after each run.
Plan and add-on access
Drive API access is available when the account has Drive entitlement through a paid plan or an active Drive Storage Add-on. A free account with an active add-on can use Drive scopes for storage automation, similar to how Email Verifier scopes are available independently of full infrastructure API access.
If a Drive Add-on is canceled and enters its grace window, read access can remain available so files can be reviewed and exported. Write, share, and purge access may be restricted until the account returns to an active storage state.
Account Drive versus mailbox Drive
Account Drive scopes and mailbox Drive scopes are intentionally separate. A billing or operations agent may need Account Drive only. A mailbox assistant may need access to one mailbox Drive and nothing else.
Use mailbox constraints when creating a token for mailbox automation. A constrained token can only see allowed mailbox spaces. Requests for other mailboxes return a not-found style response, which avoids leaking account structure to a narrowly scoped integration.
Drive Add-on scope is read-only
drive:addon:read lets an agent read add-on status, pricing, and cancellation preview. It cannot buy storage, resize an add-on, cancel a subscription, or trigger a payment action.
That boundary is deliberate. Storage billing changes stay in the dashboard, where a human can review capacity, price, currency, billing period, and payment confirmation. There is no drive:addon:write scope.
Sync-device passwords
drive:devices:read and drive:devices:write manage the separate passwords used by WebDAV sync apps. They are not the same as the API token. A created device password is shown once, so save it in the sync app or a password manager at that moment. Keep device management separate from a general file-automation token when possible, and revoke a device password when its computer or app should no longer connect.
Device list, create, and rotate responses include server_url. Use that returned address instead of assembling /dav yourself: accounts with a fully provisioned White Label mail zone receive their branded DAV hostname, while every other account receives the working platform hostname.
Recommended token patterns
| Workflow | Recommended scopes | Avoid |
|---|---|---|
| Reporting agent | drive:account:read, maybe drive:mailbox:read |
write/share/purge |
| Upload automation | drive:account:read, drive:account:write |
purge |
| Client delivery links | drive:account:read, drive:account:share |
purge unless cleanup is separate |
| Mailbox assistant | drive:mailbox:read, maybe drive:mailbox:write, constrained to one mailbox |
account-wide scopes |
| Cleanup job | read/write plus the exact purge scope required | broad unconstrained tokens |
| Storage monitor | drive:addon:read, drive:account:read |
billing writes, not available by API |
| Sync-device manager | drive:devices:read, drive:devices:write and only the Drive file scopes it needs |
an account-wide automation token with unrelated write scopes |
What happens when a scope is missing
If a token lacks the required Drive scope, the API returns a permission error. If the token is constrained away from a mailbox or resource, the API may return not found. This protects private account structure from integrations that should not know it.
Related articles
Jump to nearby guides that continue the workflow.