API Scopes and Plan Permissions

Compare API scopes across plans, add-ons, OAuth grants, memberships, domain constraints, and MCP safety gates, including White Label access.

Article details

Type, difficulty, plans, and last updated info.

Type
Reference
Difficulty
Intermediate
Plans
Nano · Starter · Pro · Agency
Last updated
Aug 23, 2026

Scopes control exactly what an API token can do. Each token carries a set of scopes, and the API checks them on every request.

How scopes work

When you create a token, you select which scopes to include. The API applies three ceilings on every request:

  1. Account entitlement: the current plan and active add-ons decide which capabilities exist now.
  2. Membership: a delegated person cannot grant or use more than their current role and domain access.
  3. Credential grant: the token or OAuth consent must include the endpoint's required scope.

The error identifies the failed ceiling. insufficient_scope means the credential was never granted the scope, scope_blocked_by_membership means the person's role is narrower, and scope_blocked_by_entitlement means the required White Label entitlement is not active.

Two scope layers: OAuth and API scopes

OAuth supports six legacy convenience bundles, every fine-grained API scope, and exposure-only tools:* selectors. The legacy bundles are:

OAuth scope Covers
mail:read Read account, domains, mailboxes, forwarding, mail rules, auto-reply, SMTP, Cloudflare, tickets, plus Drive read.
mail:write All mail:read plus create / update / delete on domains, mailboxes, aliases, forwarding, mail rules, auto-reply, Cloudflare DNS, tickets, Drive uploads / shares.
mail:admin All mail:write plus billing, delete intents, destructive Drive purges, migration writes, Cloudflare token deletes, message-token minting.
messages:read Read mailbox contents (messages, folders, attachments, contacts, calendar, identities, templates).
messages:write Change drafts, folders, flags, contacts, calendars, templates, and settings without sending mail.
messages:send Read and send mail, including drafting and scheduling messages.

Each legacy OAuth bundle expands into fine-grained API scopes, such as domains:read and drive:account:write. New integrations may request those granular scopes directly. White Label scopes are deliberately absent from the older mail:* bundles, so an existing connector never gains reseller administration after an upgrade. It must request the required White Label scopes explicitly. A tools:white_label selector limits MCP exposure but grants no API permission by itself.

Three ways to connect and how each one grants capabilities

There are three ways an agent or integration reaches TrekMail, and the gating mechanism differs in each. This matters because the MCP "capability flags" (TREKMAIL_ALLOW_DESTRUCTIVE, TREKMAIL_ALLOW_SENDING, TREKMAIL_ALLOW_MIGRATION) only exist in one of them.

Mode Auth Gating mechanism Capability flags Tool / endpoint reach
Hosted HTTP MCP (https://trekmail.net/mcp, OAuth) OAuth 2.1 with legacy bundles or granular scopes Current entitlement, membership, consented scopes, selected toolsets, and transport support. Hosted safety policy The subset allowed by every active ceiling
Self-hosted stdio MCP (@trekmail/mcp-server, local) A tm_live_ token and, where needed, a tm_msg_ token Token scopes, selected toolsets, read-only mode, and the operator's safety settings. Unauthorized tools are not registered. The operator's configuration The subset allowed by the token and local configuration
REST API directly A tm_live_ or tm_msg_ bearer token Fine-grained token scopes, such as smtp:read, smtp:write, and domains:delete Not applicable The endpoints allowed by the token scopes

In short: hosted HTTP MCP filters its advertised tools from the OAuth credential; stdio MCP intersects token scopes with toolsets, read-only mode, and local safety controls; and the REST API is gated directly by the fine-grained scopes carried on the token. Runtime API authorization remains authoritative in every mode.

Scope reference

Account & Billing

Scope What it does Plans
account:read View account info, plan, limits, and usage Starter · Pro · Agency
billing:read View billing status and invoice history Starter · Pro · Agency
billing:autopay Pay for purchases on your behalf, without asking you each time Every plan, including Nano

billing:autopay is the only scope that moves money, so it is worth reading twice.

It is deliberately separate from billing:read: a connection allowed to see your bill must not be able to add to it, and granting read-only billing is not consent to spend. It is never included automatically, a token or connection has it only if you granted it explicitly, and it is absent from every one of the older coarse scope bundles, so a connection authorized before this existed cannot spend anything.

What it allows: buying email-verification credits, and starting a subscription. What it does not allow, at all: cancelling, downgrading, or changing a subscription you already have. Those have no endpoint. Spending is additionally bounded per purchase, per day and per month for the whole account, regardless of how many connections hold the scope.

It is available on every plan because verification credits are sold on every plan, including Nano.

Domains

Scope What it does Plans
domains:read List domains and read details, spam metrics, forwarding addresses, and domain-alias state Starter · Pro · Agency
domains:create Add new domains to the account Pro · Agency
domains:write Update domain aliases, catch-all, DKIM, notes, forwarding addresses, and whether the domain hosts its incoming mail or only sends Pro · Agency
domains:delete Delete domains (dangerous) Pro · Agency
domains:dns:read View DNS requirements and check results Starter · Pro · Agency
domains:dns:recheck Trigger a new DNS verification Pro · Agency

Domain-alias delivery itself starts on Starter. Starter tokens can read the saved and live state; connecting, changing, or removing it through API/MCP needs the Pro/Agency domains:write capability. Dashboard changes remain available on Starter. See Domain Aliases via API and MCP.

White Label

These ops-token scopes appear only while a White Label trial or paid add-on is active. During cancellation grace, the owner retains the read scopes; delegated members and all write scopes are removed.

Scope What it does Availability
branding:read Read brands, assets, hosts, mail-zone state, and remaining DNS actions Active entitlement; owner during grace
branding:write Configure branding, upload or remove assets, create previews, and verify DNS Active entitlement
members:read Read the access catalog and White Label clients or team members Active entitlement; owner during grace
members:write Invite, update, suspend, resume, remove, or restore members Active entitlement
activity:read Read account and per-member White Label activity Active entitlement; owner during grace

The live membership applies another ceiling. A client or teammate can never widen their own role, domain access, or custom permissions by creating a broader token. See Manage White Label Teams with API and MCP.

Mailboxes

Scope What it does Plans
mailboxes:read List/view mailboxes and retrieve password-free mail-client setup details Starter · Pro · Agency
mailboxes:create Create new mailboxes Pro · Agency
mailboxes:delete Delete mailboxes (via delete intents) Pro · Agency
mailboxes:invites:create Send mailbox setup invites Pro · Agency
mailboxes:forwarding:read View forwarding configuration Starter · Pro · Agency
mailboxes:write Change password, update notes, pause/resume, suspend/restore sign-in, set Drive access Pro · Agency
mailboxes:forwarding:write Create and modify forwarding rules Pro · Agency
mailboxes:rules:read View mail filters Starter · Pro · Agency
mailboxes:rules:write Create, update, and delete mail filters Pro · Agency
mailboxes:auto-reply:read View auto-reply settings Starter · Pro · Agency
mailboxes:auto-reply:write Update auto-reply settings Pro · Agency
mailboxes:message-tokens:manage Create, list, and revoke message tokens Pro · Agency

Messages (message token)

Scope What it does Plans
messages:read Read access to the full webmail surface, list/read messages, list folders, download attachments, get raw source, list scheduled messages, list contacts, export contacts, list calendar events, get reply/forward data, list identities and connected-inbox Send As routes, list templates, list blocked senders Pro · Agency
messages:write Write access, update flags, delete/move messages, report spam/ham, bulk actions, create/rename/delete folders, empty Trash/Junk, save/update drafts, cancel scheduled messages, create/update/delete contacts, import contacts, create/update/delete calendar events, create/update/delete contact groups, manage group members, create/update/delete identities, set reply-From policy, create/update/delete templates, block/unblock senders Pro · Agency
messages:send Send email from the mailbox or an authorized source-bound Send As identity; also covers scheduling new messages and cancelling scheduled sends Pro · Agency

Message scopes are carried by message tokens (tm_msg_ prefix), not ops tokens (tm_live_ prefix). Message tokens are created via the API using an ops token with the mailboxes:message-tokens:manage scope. They have API-specific safeguards in addition to the ordinary sending route's limits: by default, reads allow 30 requests per minute and 5,000 successful reads per day per token; sending allows 60 requests per minute per token and 100 API sends per day across the mailbox. A second token safety counter defaults to 500 sends per day, so the lower mailbox cap normally wins.

All new webmail API endpoints (contacts, calendar, identities, templates, blocked senders, drafts, scheduled send, folders, attachments) map to the existing three message scopes, no new scopes were added. Existing tokens continue to work without any changes.

messages:read does not grant write access. In hosted OAuth, approving the broader messages:send capability provisions read, write, and send access together; a manually created tm_msg_ token keeps exactly the scopes selected at creation.

Support Tickets

Scope What it does Plans
tickets:read List and view support tickets and messages Starter · Pro · Agency
tickets:write Create tickets, reply to tickets, close tickets Pro · Agency

Starter: read-only via API. Open and reply to tickets from the dashboard.

SMTP Configuration

Scope What it does Plans
smtp:read View a domain's SMTP route, list saved profiles and their exact domain/Send As usage, read the account-wide default, poll test jobs Starter · Pro · Agency
smtp:write Set a domain's route, create/update/delete saved profiles, set the account-wide default, run connection tests Pro · Agency

SMTP is configured per domain (/api/v1/domains/{id}/smtp), with a single account-wide default (/api/v1/smtp/default) deciding what new domains start on. See API Overview for the full endpoint list. The legacy account-level /api/v1/smtp endpoints still answer for back-compat but no longer drive routing.

Migrations

Scope What it does Plans
migrations:read List and view migration details Starter · Pro · Agency
migrations:write Start, cancel, retry, and delete migrations Pro · Agency

Migration scopes are carried by ops tokens (tm_live_ prefix). Starter can view migrations via API and run them from the dashboard. Pro and Agency can also start, cancel, retry, and delete migrations through the API and MCP.

Cloudflare

Scope What it does Plans
cloudflare:read Validate tokens, list zones, preview DNS changes Starter · Pro · Agency
cloudflare:write Connect domains and apply DNS changes via Cloudflare Pro · Agency
cloudflare:delete Delete Cloudflare tokens (dangerous) Pro · Agency

Drive

Scope What it does Plans
drive:account:read Browse Account Drive, view folders/files/trash/share-link metadata, request download URLs Paid plans or active Drive Add-on
drive:account:write Upload, create folders, rename, move, trash, and restore Account Drive items Paid plans or active Drive Add-on
drive:account:share Create, list, and revoke public share links for Account Drive files Paid plans or active Drive Add-on
drive:account:purge Permanently purge trashed Account Drive files/folders and empty trash Paid plans or active Drive Add-on; high-risk
drive:mailbox:read Browse allowed mailbox Drive spaces Paid plans or active Drive Add-on
drive:mailbox:write Upload and mutate files/folders in allowed mailbox Drive spaces Paid plans or active Drive Add-on
drive:mailbox:share Create, list, and revoke public links for allowed mailbox Drive files Paid plans or active Drive Add-on
drive:mailbox:purge Permanently purge trashed mailbox Drive items Paid plans or active Drive Add-on; high-risk
drive:addon:read Read Drive Storage Add-on status, pricing, and cancellation preview Nano · Starter · Pro · Agency when add-on/Drive context exists
drive:devices:read List sync-device passwords without exposing their plaintext values Paid plans or active Drive Add-on
drive:devices:write Create, rotate, and revoke sync-device passwords Paid plans or active Drive Add-on

Drive scopes are ops-token scopes. A token can be limited to selected mailboxes, and Drive will hide other mailbox spaces from that token. Drive Add-on purchase, resize, and cancel are not API/MCP write operations; billing changes stay in the dashboard.

Nano + Drive Add-on: With an active Drive Storage Add-on, Nano gets the full Drive scope set. Nothing else unlocks, just Drive, plus the Email Verifier scopes Nano already has. If you cancel the add-on, read scopes stay live for the 7-day grace window so you can finish downloading or rolling off; write, share, and purge are cut off right away.

Email Verifier

Scope What it does Plans
verify:read Check credits, list jobs, view job status and results Nano · Starter · Pro · Agency
verify:write Submit verifications, cancel jobs, delete jobs (also grants read access) Nano · Starter · Pro · Agency

Email Verifier scopes are available on all plans, including Nano. The only limitation is your credit balance. See Email Verifier API for the full endpoint reference.

Plan access levels

Plan API Access Available Scopes
Nano Email Verifier. Add a Drive Storage Add-on for the full Drive API + MCP. verify:read, verify:write. With Drive Add-on: every drive:* scope.
Starter Full Drive, full Email Verifier, read-only across the rest. Run dashboard writes from the dashboard. account:read, billing:read, domains:read, domains:dns:read, mailboxes:read, mailboxes:forwarding:read, mailboxes:rules:read, mailboxes:auto-reply:read, migrations:read, tickets:read, smtp:read, cloudflare:read, verify:read, verify:write, all drive:* scopes.
Pro Full access All ops scopes + Drive scopes + message scopes + migration scopes + tickets + SMTP + Cloudflare + account + billing + verifier
Agency Full access All ops scopes + Drive scopes + message scopes + migration scopes + tickets + SMTP + Cloudflare + account + billing + verifier

White Label scopes are additive rather than part of the base Pro or Agency plan. They appear for those accounts only while their White Label entitlement is active.

What happens when you downgrade

If you downgrade from Pro to Starter, existing tokens with write scopes are not deleted. Instead, the API blocks requests that use disallowed scopes at runtime.

For example, a token with mailboxes:create on a Starter plan will receive 403 with code token_scope_blocked_by_plan when trying to create a mailbox. The read scopes on the same token will continue to work.

To fix this, revoke the old token and create a new one with only the scopes your current plan allows.

Dangerous scopes

The mailboxes:delete, domains:delete, migrations:write, and cloudflare:delete scopes are flagged as dangerous in the dashboard. Tokens with these scopes can initiate mailbox or domain deletion, remove Cloudflare tokens, or perform other irreversible actions. Consider whether your use case truly requires them.

For a locally hosted MCP server, its administrator can require TREKMAIL_ALLOW_DESTRUCTIVE=true before delete tools are available. Hosted MCP uses the scopes approved during OAuth.

The messages:send scope allows sending real email from the mailbox. In a locally hosted MCP server, sending can also require TREKMAIL_ALLOW_SENDING=true and confirm_send=true on every send call. See Safety Rails and Delete Intents for details.

The migrations:write scope allows starting email migrations that connect to external IMAP servers using stored credentials. In a locally hosted MCP server, migration writes can also require TREKMAIL_ALLOW_MIGRATION=true and per-call confirmation parameters (confirm_start, confirm_cancel, confirm_retry).

Domain constraints

Scopes control what a token can do. Domain constraints control where it can do it.

A token constrained to specific domains will only see and modify resources within those domains. This is useful for giving a contractor or agent access to a single client domain without exposing others.

Scope checks happen before domain constraint checks. If a token lacks the required scope, the request fails with 403 regardless of domain constraints.

Quick fixes

  • 403 "insufficient_scope": Your token does not have the scope required for this endpoint. Create a new token with the correct scopes.
  • 403 "token_scope_blocked_by_plan": Your plan no longer allows one or more of the token's scopes. Upgrade your plan, or revoke the token and create a new one with allowed scopes.
  • 403 "scope_blocked_by_entitlement": White Label is inactive, or a write was attempted during cancellation grace. Reactivate it, then retry with the same connection.
  • 403 "scope_blocked_by_membership": The current member role or custom permission does not allow the action. Ask the account owner to change that membership.
  • Some scopes are hidden in the create form: Your plan does not support those scopes. Only allowed scopes are shown.

Related articles

Jump to nearby guides that continue the workflow.

We use necessary technologies to operate and secure TrekMail. Selecting Okay also allows limited analytics and advertising measurement described in our Cookie Policy.

Sign in to TrekMail

Access your dashboard, mailboxes and DNS.

or

12 characters passwords match

or

Reset email sent

If an account exists for this email, we've sent password reset instructions.

By continuing, you agree to TrekMail's Terms and Privacy Policy.