> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gosentrix.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit Events

> Access audit event logs

Retrieve audit event logs for your tenant.

<RequestExample>
  ```bash theme={null}
  curl -X GET https://cp.gosentrix.io/api/v1/tenants/{tenant_id}/audit \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "results": [
      {
        "id": "audit-123",
        "event_type": "user.login",
        "actor": {
          "id": "user-456",
          "email": "user@example.com"
        },
        "timestamp": "2024-01-01T12:00:00Z",
        "metadata": {
          "ip_address": "192.168.1.1",
          "user_agent": "Mozilla/5.0..."
        }
      }
    ],
    "count": 1
  }
  ```
</ResponseExample>

## Export Audit Logs

<RequestExample>
  ```bash theme={null}
  curl -X GET https://cp.gosentrix.io/api/v1/tenants/{tenant_id}/audit/export?format=csv \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</RequestExample>

## Query Parameters

<ParamField path="event_type" type="string">
  Filter by event type
</ParamField>

<ParamField path="start_date" type="string">
  Start date (ISO 8601)
</ParamField>

<ParamField path="end_date" type="string">
  End date (ISO 8601)
</ParamField>

<ParamField path="format" type="string">
  Export format (json, csv)
</ParamField>

## Notes

* Audit logs are immutable
* Retention period: 7 years (compliance requirement)
* See [Audit & Compliance](/compliance/logging-audit) for details
