# Audits Overview Frontegg provides automatic audit logging from the moment it’s integrated into your application, capturing key events as your customers interact with the product. User-management activities, such as logins and settings updates, are automatically logged without any additional setup required on your part. Alongside Frontegg’s out-of-the-box logged events, you can add custom audit logs via the `POST` API or our backend SDKs, preserving the standard audit event structure. Custom logs will appear to your customers in their dedicated audit section within the self-service menu. This section lists all relevant API endpoints, organized into Management and Self-Service categories: **Management Endpoints**: Require environment-level authorization and offer comprehensive control over audits resources.
**Self-Service Endpoints**: Accessible with a user token (JWT), allowing users with the required permissions to create, update, and delete aduits connections on their account. ## Servers EU Region ``` https://api.frontegg.com/audits ``` US Region ``` https://api.us.frontegg.com/audits ``` CA Region ``` https://api.ca.frontegg.com/audits ``` AU Region ``` https://api.au.frontegg.com/audits ``` Frontegg sub-domain for use with user tokens ``` https://{domain}.frontegg.com/audits ``` Variables: - `domain` Default: "app-xxx" ## Security ### bearer Type: http Scheme: bearer Bearer Format: JWT ## Download OpenAPI description [Audits Overview](https://developers.frontegg.com/_bundle/ciam/api/audits.yaml) ## Metrics ### Get metrics - [GET /resources/metrics/v1](https://developers.frontegg.com/ciam/api/audits/metrics/metricscontroller_getmetrics.md): Retrieve audit-related metrics for your environment within a specified time range. You can use query parameters to define the time window, result limit, and aggregation frequency. The response includes top resources, top accounts (tenants), and audit event counts over time. This request requires an environment token for authentication. ## Main ### Add audits - [POST /](https://developers.frontegg.com/ciam/api/audits/main/auditscontroller_addaudits.md): Create a new audit entry in your account (tenant) audit trail. This endpoint allows you to log custom audit events with specified severity levels for security monitoring and compliance tracking. ### Get audits statistics - [GET /stats](https://developers.frontegg.com/ciam/api/audits/main/auditscontroller_getauditsstats.md): Retrieve comprehensive statistics and metrics about audit events for your account (tenant). This endpoint provides aggregated data to help you monitor audit activity, analyze security trends, and generate compliance reports. ### Export CSV to stream - [POST /export/csv/v2](https://developers.frontegg.com/ciam/api/audits/main/auditscontroller_exportcsvtostream.md): Export audit data as a CSV file stream with customizable columns and filtering options. This endpoint allows you to generate downloadable CSV reports of your audit trail data for compliance, analysis, or backup purposes. ### Get audits (V2) - [GET /resources/audits/v2](https://developers.frontegg.com/ciam/api/audits/main/auditscontroller_v2_getaudits.md): Retrieve audit logs for a specific account (tenant). Use optional query parameters to filter results by creation date, users, email addresses, or account (tenant) IDs. You can also sort the results and paginate through them using count and offset. The maximum number of audit logs per request is 200. For example: ?count=200&offset=0&sortBy=createdAt&sortDirection=desc returns audits 1-200, ?count=200&offset=200&sortBy=createdAt&sortDirection=desc returns audits 201-400 ### Export CSV to stream (V2) - [POST /resources/audits/v2/export/csv](https://developers.frontegg.com/ciam/api/audits/main/auditscontroller_v2_exportcsvtostream.md): Export filtered audit logs as a downloadable CSV stream with customizable columns and comprehensive filtering options. This endpoint generates CSV reports of your account (tenant) audit data for compliance reporting, data analysis, backup purposes, and integration with external systems. Features include customizable column selection through the properties array, advanced filtering by date ranges, users, emails, severity levels, and custom JSON criteria, pagination support for large datasets (1-200 records per request), sorting capabilities by any field, and streaming CSV output for efficient large file handling. The response includes proper CSV formatting with headers, comma-separated values, and UTF-8 encoding. ### Get audits (deprecated) - [GET /](https://developers.frontegg.com/ciam/api/audits/main/auditscontroller_getaudits.md): This route gets all audit logs for an account (tenant). Optionally, use the query params to filter and organize the results. There's a limit of 200 audits. You can use the 'offset' query param to get the following 200 results. For example: ?count=200&offset=0&sortBy=createdAt&sortDirection=desc returns audits 1-200, ?count=200&offset=200&sortBy=createdAt&sortDirection=desc returns audits 201-400 ### Export CSV (deprecated) - [POST /export/csv](https://developers.frontegg.com/ciam/api/audits/main/auditscontroller_exportcsv.md): Export CSV