# Audit API

Use the Audit API to query and retrieve audit log entries so you can monitor system and user activities, ensure compliance and security, and search, filter, sort, or export audit data for further analysis. <br><br> This REST API lets you query, scroll through, and download the following audit logs:

   - <i>Action audit logs</i> for system actions, executions, and operations.
   - <i>Business audit logs</i> for entity lifecycle events and user activities.
   - <i>Raw audit logs</i> for low-level system events and operational data.
   - <i>Operational audit logs</i> for internal system operations.
   - <i>Scripting audit logs</i> for script executions and automation events.
   - <i>Trigger audit logs</i> for automated system triggers and workflows.

{% admonition type="info" name="Note" %}You can also use the [command line interface (CLI)](https://doc.sitecore.com/ch/en/developers/cloud-dev/content-hub-command-line-interface--cli-.html) and the [tail command](https://doc.sitecore.com/ch/en/developers/api-reference/cli--sitecore.ch.cli.plugin.audit.commands.html) in particular to query logs.{% /admonition %}

 ## Authentication

 To use the Audit API, you need:

  - The URL of your Content Hub server. You can get this from your Content Hub Administrator. Enter this URL in the <b>{{server}}</b> variable by hovering your mouse over the variable in the <b>Try it</b> pane and then clicking <b>Edit</b>.
  - An [access token and the client ID](https://doc.sitecore.com/ch/en/developers/cloud-dev/oauth-tokens.html#making-requests). Both are sent with every request. You can create a token through the [Content Hub interface](https://doc.sitecore.com/ch/en/users/content-hub/create-an-oauth-client.html)  or by [requesting one using the API itself](https://doc.sitecore.com/ch/en/developers/cloud-dev/oauth-tokens.html#making-requests).


Version: v1.0
License: closed source

Metadata:
  - product: Content Hub

## Servers

```
https://{server}
```

Variables:
- `server`
  Default: "your-server"

## Security

### OAuth2

Type: oauth2
Token URL: /oauth/token
Scopes:

## Download OpenAPI description

 - [Audit API](https://api-docs.sitecore.com/_bundle/ch/audit-api/index.yaml)

## Actions

 - [GET /api/audit/action/query/{entityId}](https://api-docs.sitecore.com/ch/audit-api/actions/auditactionquery.md): Queries the action audit log for entries that match the specified filter and paging parameters. The maximum allowed value for the `take` parameter is 100.
 - [GET /api/audit/action/scroll/{entityId}](https://api-docs.sitecore.com/ch/audit-api/actions/auditactionscroll.md): Allows you to scroll through the action audit log in batches using the specified parameters. The maximum allowed value for the `take` or `batchSize` parameters is 100.
 - [POST /api/audit/action/generate](https://api-docs.sitecore.com/ch/audit-api/actions/auditactiongenerate.md): Creates a download order for action audit log entries.
## Business

 - [GET /api/audit/business/query/{entityId}](https://api-docs.sitecore.com/ch/audit-api/business/auditbusinessquery.md): Queries the business audit log for entries that match the specified filter and paging parameters. The maximum allowed value for the `take` parameter is 100.
 - [GET /api/audit/business/scroll/{entityId}](https://api-docs.sitecore.com/ch/audit-api/business/auditbusinessscroll.md): Allows you to scroll through the business audit log in batches using the specified parameters. The maximum allowed value for the `take` or `batchSize` parameters is 100.
 - [POST /api/audit/business/generate](https://api-docs.sitecore.com/ch/audit-api/business/auditbusinessgenerate.md): Creates a download order for business audit log entries. By default, the number of rows that can be exported in a single audit log download order is 10,000. The maximum number is 500,000 rows. You can
 - [POST /api/audit/business/aggregate](https://api-docs.sitecore.com/ch/audit-api/business/auditbusinessaggregate.md): Aggregates business audit log entries using the specified parameters.
## Raw

 - [GET /api/audit/raw/query/{entityId}](https://api-docs.sitecore.com/ch/audit-api/raw/auditrawquery.md): Queries the raw audit log for entries that match the specified filter and paging parameters. The maximum allowed value for the `take` parameter is 100.
 - [GET /api/audit/raw/scroll/{entityId}](https://api-docs.sitecore.com/ch/audit-api/raw/auditrawscroll.md): Allows you to scroll through the raw audit log in batches using the specified parameters. The maximum allowed value for the `take` or `batchSize` parameters is 100.
 - [POST /api/audit/raw/generate](https://api-docs.sitecore.com/ch/audit-api/raw/auditrawgenerate.md): Creates a download order for raw audit log entries. For nonbusiness audit types, only supported file formats are allowed. By default, the number of rows that can be exported in a single audit l
## Operational

 - [GET /api/audit/raw/operational/query/{entityId}](https://api-docs.sitecore.com/ch/audit-api/operational/auditrawoperationalquery.md): Queries the raw operational audit log for entries that match the specified filter and paging parameters. The maximum allowed value for the `take` parameter is 100.This endpoint is used exclusively for
 - [GET /api/audit/raw/operational/scroll/{entityId}](https://api-docs.sitecore.com/ch/audit-api/operational/auditrawoperationalscroll.md): Allows you to scroll through the raw operational audit log in batches using the specified parameters. The maximum allowed value for the `take` or `batchSize` parameters is 100.
 - [POST /api/audit/raw/operational/generate](https://api-docs.sitecore.com/ch/audit-api/operational/auditrawoperationalgenerate.md): Creates a download order for raw operational audit log entries.
## Scripting

 - [GET /api/audit/scripting/query/{entityId}](https://api-docs.sitecore.com/ch/audit-api/scripting/auditscriptingquery.md): Queries the scripting audit log for entries that match the specified filter and paging parameters. The maximum allowed value for the `take` parameter is 100.
 - [GET /api/audit/scripting/scroll/{entityId}](https://api-docs.sitecore.com/ch/audit-api/scripting/auditscriptingscroll.md): Allows you to scroll through the scripting audit log in batches using the specified parameters. The maximum allowed value for the `take` or `batchSize` parameters is 100.
 - [POST /api/audit/scripting/generate](https://api-docs.sitecore.com/ch/audit-api/scripting/auditscriptinggenerate.md): This endpoint creates a download order for scripting audit log entries based on the specified parameters.
## Triggers

 - [GET /api/audit/trigger/query/{entityId}](https://api-docs.sitecore.com/ch/audit-api/triggers/audittriggerquery.md): Queries the trigger audit log for entries that match the specified filter and paging parameters. The maximum allowed value for the `take` parameter is 100.
 - [GET /api/audit/trigger/scroll/{entityId}](https://api-docs.sitecore.com/ch/audit-api/triggers/audittriggerscroll.md): Allows you to scroll through the trigger audit log in batches using the specified parameters. The maximum allowed value for the `take` or `batchSize` parameters is 100.
 - [POST /api/audit/trigger/generate](https://api-docs.sitecore.com/ch/audit-api/triggers/audittriggergenerate.md): Creates a download order for trigger audit log entries based on the specified parameters.
