Just adding a couple of points to complement what Marcello shared.
Worth mentioning that the Audit Viewer in the UI only supports real-time queries with a maximum of 14 days, so for a full audit history the API is the way to go.
The query flow is asynchronous. After the POST, you need to poll GET /api/v2/audits/query/{transactionId} to check the status before fetching the results. More details on the query structure and available filters can be found in the Audits Query documentation.
Also, the API has a maximum interval per request, so to cover a longer period you would need to iterate over smaller windows and consolidate the results. And as noted in Allowed time interval and Data retention period, audit events are retained for 365 days, so anything older than that would no longer be available through the API.
If you need to check all available services, entity types and actions you can query, the Action Catalog is a great reference.
Hope it helps!
------------------------------
Luiz Rosa
Full stack developer
------------------------------