CLI — Access tokens
Manage a website-scoped API access tokens. Requires a
dft_ admin token. Useful to query analytics from a specific website.List all tokens
datafast tokens list
Create a token
Run without flags for an interactive prompt (name, permissions, optional website scope):
datafast tokens create
Or pass flags to skip the prompts:
# Full access token
datafast tokens create --name "CI token" --permissions "*"
# Scoped to specific permissions
datafast tokens create --name "Read only" --permissions "analytics:read,websites:read"
# Scoped to specific websites
datafast tokens create --name "Site A token" --permissions "*" --websites <id1>,<id2>
Valid permissions:
analytics:read, websites:read, websites:write, api-keys:read, api-keys:write, team:read, team:write, alerts:read, alerts:write, settings:read, settings:write, or * for full access.Delete a token
datafast tokens delete <tokenId>
# Skip the confirmation prompt
datafast tokens delete <tokenId> --yes
When you create a token, the raw
dft_ key is copied to your clipboard automatically.