# Audit log

The audit log records who did what, and when: every record created, changed or deleted in your
workspace, and every change to your organization's members, roles, teams and sign-in settings.
You can filter it, open any event to see exactly what changed, export it, and decide how long
it's kept.

<Availability plan="Depends on your plan. If yours doesn't include it, the Audit log tab shows a lock and names the plan that does. Productmind records changes on every plan, whether or not yours includes reading them." permission="Owners and Admins." />

## Key concepts

**Event.** One recorded change, such as a task created, a feature updated or a role changed. It
records who made it, when, and each field's value before and after.

**Scope.** The audit log shows the workspace you're in, together with the changes to your
organization as a whole: members, roles, teams and single sign-on. Switch workspace to see
another workspace's events.

**Phase.** Most events are **Completed** changes. An **Attempted** event is a change that was
started but not confirmed, and a **Failed** event is one that didn't happen.

**Caller.** Who or what made the change: a **Person**, a **Coding session**, a **Service**, a
service acting for a person, or a Productmind support architect.

## The Audit log tab at a glance

In the sidebar, choose **Identity & Access**, then **Audit log**.

**The toolbar** holds **Export**, the search box and the filters. Next to them are **Retention**
and **Refresh**.

**Each event** shows who made it, the record's ID and title, what happened (for example
**Created** or **Updated**), which fields changed, and when.

Choose an event to see its details beside the list:
- who made it and how;
- **Changes**, a table of each field's value **Before** and **After**. Secret values are shown as
  dots;
- other events from the same operation;
- the record's **History**.

## Finding events

Search matches part of a record's title, or a whole ID such as **TASK-12**.

| Filter | Narrows to |
| --- | --- |
| **Action** | What happened: created, updated, deleted, archived, and more |
| **Phase** | **Attempted**, **Completed** or **Failed** |
| **Caller** | A person, a coding session, a service, and so on |
| **Entity** | One kind of record, such as tasks or roles |
| **Actor** | One person, including former members |
| **Period** | The last 24 hours, 7 days, 30 days, 90 days (the default) or year, or dates you choose |

New events appear about two minutes after the change. Choose **Refresh** to load them.

## Exporting the log

### To export events

1. Filter the log to the events you want.
2. Choose **Export**, then **CSV** or **JSON (newline-delimited)**.

The export holds **every** event that matches your filters, not only those on screen. A large
export is split into several files: the first opens straight away, and the rest are listed under
**Export**. Download them within an hour.

## Retention

### To change how long events are kept

1. Choose **Retention**.
2. Under **Keep audit events for**, choose **90 days**, **1 year**, **2 years (default)** or
   **Indefinite**.

Events older than that are removed every night. Retention is set per workspace. Organization-wide
changes (members, roles, single sign-on) are kept as long as the longest retention among your
workspaces.

## How the audit log behaves

**A coding session's repositories are recorded.** Each change a person makes to the repositories a
session works in is an event, with who made it: adding a repository, removing it, choosing **Keep
repository** after removing it, changing its base branch, and making it read-only or allowing
pushes again. So is choosing **Remove without saving**, which gives up changes that couldn't be
saved. When you approve the agent's request for a repository, the event names you, the person who
approved it. Tasks and bug reports added to or removed from a session are recorded too. What
Productmind does on its own to carry out a change, such as copying a repository next to the
agent's work or saving its changes, isn't recorded. See
[Changing a session's scope](/user-guide/sessions/changing-a-sessions-scope).

**Billing contacts are recorded.** Each billing contact added to a billing profile, removed from
it, or changed is an event of the **Billing contact** entity, titled with the contact's email,
among the changes to your organization as a whole. A change records the contact's email, its name
and its place in the list, so choosing **Make primary** records the contacts that moved. See
[Managing billing contacts](/user-guide/settings/billing-and-payments/payment-and-billing-details#managing-billing-contacts).

## Permissions

| To | You need |
| --- | --- |
| See, search and export the audit log | The **Owner** or **Admin** role |
| Change retention | The **Owner** or **Admin** role |

## Troubleshooting

### A change I just made isn't in the log

Events take about two minutes to arrive. Choose **Refresh**.

### "No activity in this period"

Nothing matched in the selected period. Choose **Show the last year**, or widen the **Period**.

### I can't find events from another workspace

The audit log shows the workspace you're in. Switch workspace to see its events.

## Related topics

- [Users](/user-guide/settings/identity-and-access/users)
- [Roles](/user-guide/settings/identity-and-access/roles)
- [Organizations and workspaces](/user-guide/get-started/organizations-and-workspaces)
