# Audit logs

Learn more about working with audit logs, which allow you to see all changes inside of your project.

Audit Logs allow you to see all changes inside of your project. They contain both changes in the schema and content.

**Note:**

Audit Logs are an Enterprise pricing feature.

Whenever a member of your project creates a new model, updates a content entry, or deletes a webhook, the Audit Logs will retain these actions.

![Audit Logs Explorer](https://hygraph.com/images/docs/user-guides/audit-logs-view.png)

## Accessing audit logs

On eligible projects, Audit Logs are visible for the Owner & Admin role. You can also grant access to Audit Logs by creating a custom role with the "Can view Audit Logs" permission.

Clicking on a specific row in the Audit Logs table opens the detail view for that event, including the payload that shows all changes that happened on this event.

![Audit Logs Details View](https://hygraph.com/images/docs/user-guides/audit-logs-detail.png)

If you need to fetch the most recent updates once you are already examining logs, use the refresh button at the top-right of the screen.

![Reload audit logs](https://hygraph.com/images/docs/user-guides/audit-logs-reload.png)

## Event fields

Each audit event will have the following fields present:

| Field                | Description                                                                      |
| -------------------- | -------------------------------------------------------------------------------- |
| Entity ID            | The ID of the Resource, e.g. Model ID or Content Entry ID.                       |
| Timestamp            | The time at which the change occurred.                                           |
| Type (Resource Type) | The type of resource that has been altered.                                      |
| Action               | The action that was performed on the resource.                                   |
| Environment          | The environment in which the change occurred.                                    |
| Payload              | The full payload of the change. We won't include the payload for content changes. |
| TriggeredBy          | The Member email or Token that triggered the change.                             |
| TriggerType          | Can be `USER`, `PAT`, `OPEN` or `THIRD_PARTY`.                                   |

## Logged resources

Here's a list of resource types the Audit Logs will keep track of:

- Model
- Environment
- Field
- Content
- Webhook
- Locale
- Project
- Stage
- Member
- Role
- View Group
- Content View
- PAT (Permanent Access Token)
- Enumeration

## Logged actions

These are the actions that can be performed on resources:

- Accept (users)
- Create
- Update
- Delete
- Publish (content only)
- Unpublish (content only)

## Filtering logs

You can filter the logs by the [event fields](#event-fields).

![Filtering logs](https://hygraph.com/images/docs/user-guides/audit-logs-filter.png)

### Filter by action

To filter by action, select `Action` from the `Filter` menu:

![Filter by action](https://hygraph.com/images/docs/user-guides/audit-logs-filter-action.png)

Select one of the actions from the dropdown menu to filter the results on the table.

### Filter by entity ID

To filter by entity ID, select `Entity ID` from the `Filter` menu:

![Filter by action](https://hygraph.com/images/docs/user-guides/audit-logs-filter-entityid.png)

Enter a resource entity ID in the input field to filter the results on the table.

### Filter by environment

To filter by environment, select `Environment` from the `Filter` menu:

![Filter by action](https://hygraph.com/images/docs/user-guides/audit-logs-filter-env.png)

Enter the name of one of your environments in the input field to filter the results on the table.

Global actions such as inviting a member to your project count for all environments and do not display with this filter.

### Filter by timestamp

To filter by timestamp, select `Timestamp` from the `Filter` menu:

![Filter by action](https://hygraph.com/images/docs/user-guides/audit-logs-filter-timestamp.png)

Select a condition from the dropdown and then enter a timestamp value in UTC format in the input field to filter the results on the table.

### Filter by user

If you want to search for the audit logs of a specific team member, select `Triggered by` from the `Filter`:

![Search for logs of a team member](https://hygraph.com/images/docs/user-guides/audit-logs-member.png)

Leave the trigger type as `User` and write their email in the `Triggered by` input field.

The table will be ordered descending by default, so the newest entry is shown first.

### Filter by trigger type

To filter by trigger type, select `Trigger type` from the `Filter` menu:

![Filter by action](https://hygraph.com/images/docs/user-guides/audit-logs-filter-triggertype.png)

Select a trigger type from the dropdown menu to filter the results on the table.

- **App Token:** Actions triggered by an application token used for API authentication or automated processes.
- **Open:** Requests sent to a public content API, without any auth tokens. **We do not recommend enabling permissions to mutate content in these cases**. We suggest that you use a PAT instead.
- **PAT:** Actions performed using a Permanent Auth Token (PAT) for API access.
- **Third Party:** Events initiated by external integrations or connected third-party applications.
- **User:** Actions directly performed by a logged-in user in the Hygraph UI.

### Filter by type

To filter by type, select `Type` from the `Filter` menu:

![Filter by action](https://hygraph.com/images/docs/user-guides/audit-logs-filter-type.png)

Select a type from the dropdown menu to filter the results on the table.

### Filter by user email

To filter by user email, select `User email` from the `Filter` menu:

![Filter by action](https://hygraph.com/images/docs/user-guides/audit-logs-filter-email.png)

Enter an email in the input field to filter the results on the table.
