# See who changed a group

> Read a group's change history to see every member added or removed, every attribute changed, and who made each change.

The `finance` group opens the finance team's vault and everything its policies allow. An auditor asks who added `ben`
to it, and when. The group's change history answers: every change to the group, its members included, with who made
it.

**Before you start:** you can read the group, which `READ` on the realm gives (`RealmViewer` is enough), and are
signed in with your session in `$CVYUH_SESSION` ([Call the API](/develop/api/) shows how).

## Read the history

<Steps>

1. Read the group's history, newest first:

   ```sh
   curl "https://foobar.cvyuh.com/api/v0/am/objects/v1/group/finance/history?pageSize=100" \
     -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
   ```

2. Find the entry whose `edgeChanges.member.added` holds the link to `ben`. Its `eventTime` says when, and
   `changedBy` the id of who made the change.

3. If the history runs past one page, ask for the next with `page=2`, until a page comes back with fewer than
   `pageSize` entries.

4. Match `changedBy` to a person: read a user, such as `https://foobar.cvyuh.com/api/v0/am/objects/v1/user/maya`,
   and compare their `id`.

</Steps>

## Check it worked

The entry you found shows `member` in `changedFields`, and the group's `after` and the link in `edgeChanges` agree
with what you read from the group today.

## Undo it

Nothing to undo: reading a history changes nothing.

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| No entry adds `ben`, though he is a member | He was added through his own `memberOf`, so the change is recorded on him | Read `https://foobar.cvyuh.com/api/v0/am/objects/v1/user/ben/history` |
| He is a member, and neither history adds him | He is a member by a rule, not a link someone added | See [Groups](/directory/groups/) |
| `403` | You can't read the group | Ask for `RealmViewer` |

## Related

- [Change history](/audit-reports/audit-trail/change-history/): how the history is kept and paged.
- [Groups](/directory/groups/): members and what a group gives them.
