CLI permissions and roles
View as MarkdownWhich token each CLI command needs, the scope it uses and the lowest website role that can run it.
On this page
Every CLI command calls the REST API with the token you signed in with. What it may do depends on the kind of token, the permissions (scopes) you gave it, and your role on the website.
Account tokens and site keys
| Credential | Prefix | Where to create it | What it reaches |
|---|---|---|---|
| Account token | dt_pat_… |
Account → API / MCP | The websites and permissions you choose, capped by your role. |
| Site key | dt_site_… |
A website's Settings → Developer | One website, with a fixed set of scopes. |
An account token's permissions have the form <resource>:<read|write>, for example analytics:read or goals:write. write includes read. A token can only do what you chose for it and what your role on each website allows: if your role on a website is lowered, the token loses that access too.
A site key always has these scopes on its own website: analytics:read, goals:read, goals:write, payments:read, payments:write, identify:write.
reveata whoami --site example.com shows your role on that website and the scopes that actually work there right now.
Roles
Each website has four roles, from lowest to highest: Viewer, Editor, Admin and Owner (see Team and roles). Reading data needs at least Viewer. Changing goals, funnels, notes and alerts needs Editor. Recording payments and every other change needs Admin.
Viewers don't see revenue, payments or customers' names and emails unless an admin turned on Viewers can see revenue. The same rule applies to the API and the CLI.
What each command needs
| Command | Scope | Lowest role | Site key |
|---|---|---|---|
reveata login |
Any valid credential | Any | Yes |
reveata logout |
None: only reads or edits the local config file | Any | Yes |
reveata whoami |
Any valid credential | Any | Yes |
reveata config show |
None: only reads or edits the local config file | Any | Yes |
| `reveata config set-site <id | domain>` | analytics:read |
Viewer |
reveata config clear-site |
None: only reads or edits the local config file | Any | Yes |
reveata account get |
account:read |
Any | No |
reveata account update |
account:write |
Any | No |
reveata tokens list |
tokens:read |
Any | No |
reveata tokens create |
tokens:write |
Any | No |
reveata tokens update <tokenId> |
tokens:write |
Any | No |
reveata tokens revoke <tokenId> |
tokens:write |
Any | No |
reveata sites list |
websites:read |
Viewer | Yes (its own website) |
reveata sites get |
analytics:read |
Viewer | Yes |
reveata sites create <domain> |
websites:write |
Admin | No |
reveata sites update |
settings:write |
Admin | No |
reveata sites settings |
settings:read |
Admin | No |
reveata sites attribution |
settings:write |
Admin | No |
reveata team list |
team:read |
Admin | No |
reveata team invite <email> |
team:write |
Admin | No |
reveata team role <userId> |
team:write |
Admin | No |
reveata team remove <userId> |
team:write |
Admin | No |
reveata team revoke-invite <inviteId> |
team:write |
Admin | No |
reveata keys list |
api_keys:read |
Admin | No |
reveata keys create <name> |
api_keys:write |
Admin | No |
reveata keys roll <keyId> |
api_keys:write |
Admin | No |
reveata keys revoke <keyId> |
api_keys:write |
Admin | No |
reveata integrations list |
settings:read |
Admin | No |
reveata integrations test <integrationId> |
settings:write |
Admin | No |
reveata stats overview |
analytics:read |
Viewer | Yes |
reveata stats timeseries |
analytics:read |
Viewer | Yes |
reveata stats breakdown |
analytics:read |
Viewer | Yes |
reveata stats new-vs-returning |
analytics:read |
Viewer | Yes |
reveata realtime |
analytics:read |
Viewer | Yes |
reveata goals list |
goals:read |
Viewer | Yes |
reveata goals completions |
goals:read |
Viewer | Yes |
reveata goals update <goalName> |
goals:write |
Editor | Yes |
reveata goals reset <goalName> |
goals:write |
Editor | Yes |
reveata funnels list |
funnels:read |
Viewer | No |
reveata funnels results <funnelId> |
funnels:read |
Viewer | No |
reveata funnels create <name> |
funnels:write |
Editor | No |
reveata funnels update <funnelId> |
funnels:write |
Editor | No |
reveata funnels delete <funnelId> |
funnels:write |
Editor | No |
reveata visitors list |
analytics:read |
Viewer | Yes |
reveata visitors get <visitorId> |
analytics:read |
Viewer | Yes |
reveata visitors journey <visitorId> |
analytics:read |
Viewer | Yes |
reveata segments list |
segments:read |
Viewer | No |
reveata segments create <name> |
segments:write |
Viewer | No |
reveata segments delete <segmentId> |
segments:write |
Viewer | No |
reveata notes list |
notes:read |
Viewer | No |
reveata notes add <YYYY-MM-DD> <text> |
notes:write |
Editor | No |
reveata notes update <noteId> |
notes:write |
Editor | No |
reveata notes delete <noteId> |
notes:write |
Editor | No |
reveata alerts list |
alerts:read |
Viewer | No |
reveata alerts get <alertId> |
alerts:read |
Viewer | No |
reveata alerts create <type> |
alerts:write |
Editor | No |
reveata alerts update <alertId> |
alerts:write |
Editor | No |
reveata alerts delete <alertId> |
alerts:write |
Editor | No |
reveata alerts test <alertId> |
alerts:write |
Editor | No |
reveata alerts history [alertId] |
alerts:read |
Viewer | No |
reveata events send <goalName> |
goals:write |
Editor | Yes |
reveata payments send |
payments:write |
Admin | Yes |
reveata payments list |
payments:read |
Viewer | Yes |
reveata customers summary |
payments:read |
Viewer | Yes |
reveata revenue subscriptions |
payments:read |
Viewer | Yes |
reveata bots report |
analytics:read |
Viewer | Yes |
reveata bots rules |
analytics:read |
Viewer | Yes |
reveata bots forward [logfile] |
A bot request token (dt_bot_…), not an API token |
Any | Not needed |
reveata mentions list |
analytics:read |
Viewer | Yes |
| `reveata completion <bash | zsh | fish>` | None: prints a script |
login checks the token with GET /api/v1/whoami, which works with any valid credential. For a site key it also looks up the key's own website.
When access is refused
The CLI prints the API's error code and message, for example:
insufficient_scope: the token lacks the scope in the table above. Create a token with it.insufficient_role: your role on the website is too low for this command.website_not_in_scope: the token is limited to other websites.invalid_token: the token is unknown, revoked or expired. Runreveata loginagain.
The API introduction lists every error code.