How to Retrieve SharePoint Server Audit Logs with REST API or CSOM
Question details
The user needs to retrieve site collection audit data from SharePoint Server 2019 for a reporting application and needs to know if REST API or CSOM is supported.

- Product
- SharePoint Server 2019
- Device & OS
- not provided
- Scenario
- Developing a custom reporting application that requires extracting audit log data from a SharePoint site collection.
- Observed behavior
- Seeking technical confirmation and guidance on whether REST API or CSOM can be used for audit log extraction in SharePoint Server 2019.
Ensure you have the necessary administrative privileges for the SharePoint site collection and access to Microsoft Q&A for specialized developer support.
Consult Microsoft Q&A for SharePoint API Support
Because custom REST API and CSOM development for SharePoint audit logs falls outside standard consumer support, you should consult SharePoint specialists on Microsoft Q&A.
Retrieving audit logs programmatically in SharePoint Server 2019 often requires specific knowledge of server-side APIs or specialized endpoints. Microsoft's standard community support does not cover advanced REST API or CSOM development topics.
Open your web browser and go to the official Microsoft Q&A platform at https://learn.microsoft.com/en-us/answers/.
Use the search bar to look for 'SharePoint 2019 audit logs REST API' to see if other administrators have already solved this specific API query.
If no existing answers meet your needs, click 'Ask a question' and ensure you tag your post with 'SharePoint Server' and 'SharePoint Development' to reach the right specialists.
While waiting for a response, review the official Microsoft documentation regarding supported audit and reporting tools for your specific SharePoint Server version.

Analyze Exported SharePoint Audit Reports with WPS Office
While extracting SharePoint logs requires Microsoft server APIs, analyzing the resulting CSV or Excel data is effortless with WPS Office. As a free, lightweight, and highly compatible alternative to Microsoft Office, WPS Spreadsheet easily handles large audit reports and complex data filtering.
- 1. Download and install WPS Office: Visit the official WPS website, download the free version of WPS Office, and complete the installation process.
- 2. Open WPS Spreadsheet: Launch WPS Office and open the Spreadsheet module from the main dashboard.
- 3. Import your audit report: Go to Menu > Open and select the CSV or XLSX audit log file exported from your SharePoint Server to begin your analysis.

Frequently Asked Questions
Can I use REST API to get audit logs in SharePoint Online?
For SharePoint Online (Microsoft 365), Microsoft recommends using the Office 365 Management Activity API rather than the standard SharePoint REST API to retrieve comprehensive and scalable audit logs.
Where can I view audit log reports manually in SharePoint Server 2019?
You can manually view them by navigating to Site Settings > Site Collection Administration > Audit log reports. Note that the audit logging feature must be enabled at the site collection level beforehand.
Does CSOM support full audit log retrieval in SharePoint Server?
CSOM has limited support for reading detailed audit entries. Extracting large volumes of audit data programmatically in an on-premises environment typically relies on the Server-Side Object Model (SSOM) or PowerShell cmdlets.




