> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cimento.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Scopes

> What each scope lets a service account read, which routes need it, and which scopes expose details about named people.

A scope is one thing a service account is allowed to read. You choose a service account's scopes when you [create it](https://docs.cimento.ai/api/service-accounts.md), and an access token carries them.

Every scope is read-only. A request to a route the token has no scope for answers `403` and names the scope it needs.

## The scopes

| Scope | Shown in Cimento as | Routes it opens |
| - | - | - |
| `phishing_analytics:view` | Phishing analytics | `/v1/phishing/analytics` |
| `phishing_analytics:view_employee_data` | Phishing results for named employees | Nothing alone. It adds to the two scopes around it: see [below](#scopes-that-expose-personal-data). |
| `phishing_campaigns:view` | Phishing campaigns | `/v1/phishing/campaigns` and `/v1/phishing/campaigns/{campaignId}`, together with `phishing_analytics:view_employee_data` |
| `phishing_templates:view` | Phishing templates | `/v1/phishing/templates` and `/v1/phishing/templates/{templateId}` |
| `training_campaigns:view` | Training campaigns | `/v1/training/campaigns` and `/v1/training/campaigns/{trainingCampaignId}` |
| `training_courses:view` | Training courses | `/v1/training/courses` and `/v1/training/courses/{courseId}` |
| `training_analytics:view_employee_completion` | Training completion for named employees | No route yet. |
| `phishing:admin` | AutoPhish activity and settings | Every route under `/v1/autophish` |

## Scopes that expose personal data

Give these only to a system that needs what they expose, and that you would trust with it.

### `phishing_analytics:view_employee_data`

This scope lets a service account read employees' names and email addresses, next to how each did in a simulation. It opens two things:

* **Phishing campaigns.** Both campaign routes need it as well as `phishing_campaigns:view`, because reading a campaign returns its participants by name.
* **Analytics by person.** On `/v1/phishing/analytics`, grouping by `employee_name` or `email`, or filtering by `userIds`, needs it as well as `phishing_analytics:view`.

Without it, those requests answer `403`.

### `phishing_analytics:view`

On its own this scope returns no employee's name. It does return manager names, manager email addresses and job titles when you group by them.

### `phishing:admin`

The AutoPhish routes need this scope because AutoPhish reports name the people simulations were sent to. In Cimento the same permission lets an admin change AutoPhish. A service account cannot: with this scope it can only read.

## How scopes reach an access token

* **You can give only scopes you hold.** When you create or edit a service account, a scope you don't hold yourself is greyed out.
* **A client secret holds the scopes its service account had when the secret was made.** An access token gets its scopes from the client secret, not straight from the service account.
* **Removing a scope takes effect on the next access token.** A token already issued keeps the scope until it expires, up to an hour later.
* **Adding a scope needs a new client secret.** Until you rotate, Cimento marks the scope **Needs rotation** and no token carries it. See [Adding a scope](https://docs.cimento.ai/api/rotating-secrets.md#adding-a-scope).
* **A token can carry fewer scopes than the secret holds.** See [Ask for fewer scopes](https://docs.cimento.ai/api/authentication.md#ask-for-fewer-scopes).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.