# reveata team, keys and tokens

> Invite people and change their roles, create and revoke website API keys and account access tokens from the command line.

These commands manage who and what can reach your data. Team and site key commands need the admin role on the website; token commands act on your own account.

- `reveata team` lists members and pending invites, invites people, changes roles and removes members. The owner's role cannot change (transfer ownership in the dashboard), and you cannot change your own.
- `reveata keys` manages a website's API keys (`dt_site_…`). A site key reads analytics and sends goals, payments and identify calls for that one website.
- `reveata tokens` manages your account access tokens (`dt_pat_…`). A token can never create or edit a token with more permissions or websites than it has itself, so a read-only token cannot mint a stronger one.

A new secret is printed once (on standard output, with a reminder on standard error) and is never shown again: store it right away, or roll the key to get a new one. Removing, revoking and rolling need `--yes`, because the CLI never asks interactively.

### `reveata tokens list`

Your account access tokens (dt_pat_…), masked.

No options beyond the global ones.

Calls [`GET /api/v1/access-tokens`](https://reveata.com/api-reference/list-access-tokens) (`tokens:read`).

```bash
reveata tokens list
reveata tokens list --json
```

### `reveata tokens create`

Create an access token, never stronger than the token in use.

Pass --scope for each permission (e.g. analytics:read) and --website-id to limit it to websites (default: all). The secret is shown once. Needs the tokens:write scope.

Options:

- `--name <name>`: Display name
- `--scope <resource:access>`: Permission, e.g. analytics:read (repeatable)
- `--website-id <id>`: Limit the token to this website (repeatable; default: all websites)

Calls [`POST /api/v1/access-tokens`](https://reveata.com/api-reference/create-access-token) (`tokens:write`).

```bash
reveata tokens create --name Reports --scope analytics:read --scope goals:read
reveata tokens create --name "Shop backend" --scope payments:write --website-id 6710a4c2e4b0a1b2c3d4e5f6
```

### `reveata tokens update <tokenId>`

Rename a token or change its permissions (its value stays the same).

--scope replaces the permission list (repeatable).

Options:

- `--name <name>`: Display name
- `--scope <resource:access>`: Permission, e.g. analytics:read (repeatable)

Calls [`PATCH /api/v1/access-tokens/{tokenId}`](https://reveata.com/api-reference/update-access-token) (`tokens:write`).

```bash
reveata tokens update 6710a4c2e4b0a1b2c3d4e5f6 --scope analytics:read
```

### `reveata tokens revoke <tokenId>`

Revoke an access token; it stops working at once.

Options:

- `-y, --yes`: Confirm a delete, revoke, roll or removal (required; nothing is asked)

Calls [`DELETE /api/v1/access-tokens/{tokenId}`](https://reveata.com/api-reference/revoke-access-token) (`tokens:write`).

```bash
reveata tokens revoke 6710a4c2e4b0a1b2c3d4e5f6 --yes
```

### `reveata team list`

Members, their roles and pending invites (admin role).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)

Calls [`GET /api/v1/websites/{website}/members`](https://reveata.com/api-reference/list-members) (`team:read`) and [`GET /api/v1/websites/{website}/invites`](https://reveata.com/api-reference/list-invites) (`team:read`).

```bash
reveata team list --site example.com
reveata team list --site example.com --json
```

### `reveata team invite <email>`

Invite someone by email as viewer, editor or admin (admin role).

A new person takes a seat on the owner’s plan. Inviting again sends a fresh link.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `--role <role>`: viewer, editor or admin

Calls [`POST /api/v1/websites/{website}/invites`](https://reveata.com/api-reference/create-invite) (`team:write`).

```bash
reveata team invite jane@example.com --site example.com --role editor
```

### `reveata team role <userId>`

Change a member’s role (admin role).

The owner’s role and your own cannot be changed.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `--role <role>`: viewer, editor or admin

Calls [`PATCH /api/v1/websites/{website}/members/{userId}`](https://reveata.com/api-reference/update-member) (`team:write`).

```bash
reveata team role 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --role admin
```

### `reveata team remove <userId>`

Remove a member from a website (admin role, or yourself).

They lose access at once, and site keys they created stop working.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `-y, --yes`: Confirm a delete, revoke, roll or removal (required; nothing is asked)

Calls [`DELETE /api/v1/websites/{website}/members/{userId}`](https://reveata.com/api-reference/remove-member) (`team:write`).

```bash
reveata team remove 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --yes
```

### `reveata team revoke-invite <inviteId>`

Cancel a pending invite (admin role).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `-y, --yes`: Confirm a delete, revoke, roll or removal (required; nothing is asked)

Calls [`DELETE /api/v1/websites/{website}/invites/{inviteId}`](https://reveata.com/api-reference/revoke-invite) (`team:write`).

```bash
reveata team revoke-invite 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --yes
```

### `reveata keys list`

Website API keys (dt_site_…), masked (admin role).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)

Calls [`GET /api/v1/websites/{website}/site-keys`](https://reveata.com/api-reference/list-site-keys) (`api_keys:read`).

```bash
reveata keys list --site example.com
```

### `reveata keys create <name>`

Create a website API key; the secret is shown once (admin role).

A site key reads analytics and sends goals, payments and identify calls for this website only.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)

Calls [`POST /api/v1/websites/{website}/site-keys`](https://reveata.com/api-reference/create-site-key) (`api_keys:write`).

```bash
reveata keys create Backend --site example.com
reveata keys create CI --site example.com --json
```

### `reveata keys roll <keyId>`

Replace a site key’s secret; the old one stops working (admin role).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `-y, --yes`: Confirm a delete, revoke, roll or removal (required; nothing is asked)

Calls [`POST /api/v1/websites/{website}/site-keys/{keyId}/roll`](https://reveata.com/api-reference/roll-site-key) (`api_keys:write`).

```bash
reveata keys roll 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --yes
```

### `reveata keys revoke <keyId>`

Revoke a site key; it stops working at once (admin role).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `-y, --yes`: Confirm a delete, revoke, roll or removal (required; nothing is asked)

Calls [`DELETE /api/v1/websites/{website}/site-keys/{keyId}`](https://reveata.com/api-reference/revoke-site-key) (`api_keys:write`).

```bash
reveata keys revoke 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --yes
```
