# ExportAuditTrail

Export audit trail data from all servers.

Required User Role: See [Required Enterprise Manager permissions](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEMPermissions.htm).

## Syntax

`public string ExportAuditTrail(` `string startTimestamp,` `string endTimestamp` `);`

## Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| start\_timestamp | string | start timestamp: (UTC format or Ticks)<br><br>Example: 2020-06-30T16:15:00Z (UTC format)<br><br>Example: 637410358250082194 (Ticks) |
| end\_timestamp | string | end timestamp: (UTC format or Ticks)<br><br>Example: 2020-06-30T16:15:00Z (UTC format)<br><br>Example: 637410358250082194 (Ticks)<br><br>null : latest audit trail record |

## Return values

JSON File (stream)

## Errors

Error responses

| Error | Message | Description |
| --- | --- | --- |
| AEM\_INVALID\_TIMESTAMP\_FORMAT | Timestamp is not a timestamp.<br><br>Timestamp format should be 'yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z or Ticks. | Timestamp is not valid. |
| AEM\_EXPORT\_INNER\_ERR | Failed to export audit trail.<br><br>AUDIT-E-INVRANGE. The end time is before the start time. | Time range is not valid. |
| UNAUTHORIZED\_REQUEST | Unauthorized Request. request: AemExportAuditTrail | User does not have permission to access the audit trail information. |