Audit Logs v2: API Queries, Resource History, Retention, and Logpush
How Cloudflare Audit Logs v2 record account activity, where to query them in the dashboard or API, and how Perplexity's Audit API compares for SIEM export.
This page summarizes Cloudflare documentation on Audit Logs (version 2)—the unified trail of user and system actions across the dashboard and public APIs—and compares it with Perplexity’s Audit API where both platforms address pulling audit events into compliance tooling.
Audit Logs v2: what gets recorded and who can see it
Section titled “Audit Logs v2: what gets recorded and who can see it”Audit Logs v2 is Cloudflare’s account-based system for tracking configuration and control-plane activity. User-initiated actions through the API or dashboard are recorded automatically, and system-initiated logs capture automated changes (background processes, internal policy enforcement, and similar events).
Cloudflare Audit Logs are account-based. All user-initiated actions are recorded automatically across both the Cloudflare API and dashboard. System-initiated logs are also captured to reflect actions taken automatically by Cloudflare systems, such as configuration updates, background processes, or internal policy enforcement.
— Cloudflare, Audit Logs - version 2
Logs are generated through Cloudflare’s audit logging pipeline (built on API Shield / OpenAPI schemas) so format stays consistent across roughly 95% of products without per-product manual instrumentation. Individual product pages (for example R2, D1, Queues, AI Gateway) list which operations appear in the shared audit stream; viewing them still happens on the central Audit logs experience.
User-initiated vs system-initiated actors
Section titled “User-initiated vs system-initiated actors”User-initiated entries identify who performed the change. Actor types include user, cloudflare_admin, account (account API token), and delegated_service. Authentication context can appear as api_token, dash, oauth, and other values documented under actor fields in Audit Logs - version 2.
System-initiated entries document changes without direct user input; some still carry associated user context for traceability.
Account-level, user-profile, and organization scopes
Section titled “Account-level, user-profile, and organization scopes”| Scope | What it covers | Typical use |
|---|---|---|
| Account Activity Logs | Actions inside one Cloudflare account | Zone settings, members, product configs |
| User Profile Activity Logs | Same user across multiple accounts | Cross-account access investigations |
| Organization Activity Logs | Org-admin actions at organization APIs | MSSP / enterprise org governance |
Organization-level logs are separate from account-level logs: work inside a member account still appears in that account’s Audit Logs UI, API, and Logpush. Org admins retrieve organization events with GET https://api.cloudflare.com/client/v4/organizations/{organization_id}/logs/audit as described in Audit Logs v2 — Organization-level support and Organizations for Enterprise.
Audit Logs v2 vs v1: when to use which interface
Section titled “Audit Logs v2 vs v1: when to use which interface”Audit Logs v2 is the default in the dashboard (Manage Account > Audit Logs). You can still switch back to v1 from the banner when you need legacy behavior.
Audit Logs v2 is shown by default. You can switch between Audit Logs v2 and v1 as needed.
— Cloudflare, Audit Logs - version 2
v2 improves standardized fields, filtering, Ray ID traceability, and coverage. v1 remains relevant for before and after values on some changes until that capability ships in v2:
Before and after values — the ability to see what a value changed from and to — is a highly requested feature and is on our roadmap for a post-GA release. In the meantime, we recommend using Audit Logs v1 for before and after values.
— Cloudflare, Audit logs (version 2) - General Availability
v1 behavior for CSV export and older API semantics is described in Review audit logs - v1.
How to query Audit Logs in the dashboard
Section titled “How to query Audit Logs in the dashboard”Open Manage Account > Audit Logs (see Audit Logs - version 2). The v2 UI adds filtering, a detail sidebar, JSON log view, custom time ranges, and infinite scroll (UI Beta release notes).
Account-level analytics (actions over time, unique actors, failure rate) apply to account logs only—not organization audit log views (Audit Logs - version 2).
view actions: read (GET) activity in audit logs
Section titled “view actions: read (GET) activity in audit logs”Audit Logs v2 can record view actions (GET requests on supported endpoints) for forensic use:
Audit Logs v2 now records view actions for supported endpoints, providing visibility into read activity across Cloudflare products. These actions correspond to GET requests and provide additional context for security investigations and forensic analysis.
— Cloudflare, Audit Logs v2 now captures view actions
The dashboard hides view actions by default with an Action type is not view filter. Remove that filter to include reads, or set Action type to view to show only reads. The API and Logpush always include view actions regardless of the dashboard filter.
(Same warning in Cloudflare’s view-actions changelog.)
Audit Logs API and Logpush: retention and query windows
Section titled “Audit Logs API and Logpush: retention and query windows”Retention
Section titled “Retention”Audit logs are kept 18 months, then deleted. No extra setup is required.
Audit logs are retained for 18 months before being deleted. No additional setup is required.
— Cloudflare, Audit Logs - version 2
Enterprise customers can use Logpush to retain copies beyond 18 months (Retention on the same page).
Dashboard vs API time range
Section titled “Dashboard vs API time range”The v2 UI query window is limited to the most recent 90 days for performance. For the full retention window, use the API or Logpush:
In the Audit Logs v2 UI, queries are limited to the most recent 90 days for performance reasons. To access the full 18 months of data, use the API or Logpush.
— Cloudflare, Audit Logs - version 2
List audit events with the API
Section titled “List audit events with the API”Account-scoped listing:
GET https://api.cloudflare.com/client/v4/accounts/{account_id}/logs/audit
Required query parameters for time-bounded export include since and before (date or RFC3339 UTC). Example from Audit Logs - version 2:
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/logs/audit?since=2025-03-01T00:00:00Z&before=2025-03-26T23:59:59Z" \ --request GET \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"Token permissions need Account Settings Read or Account Settings Write. Responses paginate with result_info.cursor (example query).
Logpush dataset
Section titled “Logpush dataset”Ship logs to your SIEM with the audit_logs_v2 account-scoped Logpush dataset (Logpush Beta release). Transformers documentation shows how to filter and reshape audit_logs_v2 records—for example keeping only update actions before delivery.
Resource History: audit log diffs for one resource
Section titled “Resource History: audit log diffs for one resource”Resource History answers “what else changed on this object?” without re-enabling v1 for every investigation.
Resource History shows what changed on every configuration modification captured in Audit Logs. For any audit log entry, you can see the sequence of previous changes to the same resource and view a side-by-side diff of what was modified.
— Cloudflare, Audit Logs - version 2
In the dashboard: open an entry under Manage Account > Audit Logs, choose the History tab, then pick an earlier entry for a side-by-side diff (Resource History changelog).
API:
- Account:
GET https://api.cloudflare.com/client/v4/accounts/{account_id}/logs/audit/{id}/history - Organization:
GET https://api.cloudflare.com/client/v4/organizations/{organization_id}/logs/audit/{id}/history
Required parameters include action_time (from the source entry), since, and before. The response may include history_status of exact, approximate, or unavailable when the resource cannot be resolved (Use Resource History via the API).
Resource History uses existing retained v2 entries only; it is not added as extra fields in the Logpush dataset.
Related Cloudflare logs (not the same as Audit Logs v2)
Section titled “Related Cloudflare logs (not the same as Audit Logs v2)”These names sound similar but answer different questions:
| Log type | Purpose | Where documented |
|---|---|---|
| Access authentication logs | Who reached Access-protected apps (login and per-request) | Cloudflare Zero Trust |
| Admin activity logs | Zero Trust configuration changes by account members | Zero Trust > Insights > Logs |
| Security insight archive audit | Status/rationale when archiving Security Overview items | Archive and audit security action items |
Use Audit Logs v2 for account and zone configuration across the developer platform; use Access and admin activity logs for application access and Zero Trust policy edits.
Perplexity Audit API vs Cloudflare: pulling events for SIEM
Section titled “Perplexity Audit API vs Cloudflare: pulling events for SIEM”Both vendors support read-only export of administrative audit events, but models differ.
Perplexity targets enterprise org admins ingesting the same events as audit webhooks:
Pull your organization’s audit events into your SIEM or compliance tooling with a read-only, organization-scoped API key.
— Perplexity, Audit API
Prerequisites: Enterprise organization, audit logging enabled under Organization Settings → Data and privacy → Audit Log Settings, and a dedicated audit log API key (Sonar keys return 403). Endpoint: GET https://api.perplexity.ai/v1/admin/audit-events (List audit events).
Cloudflare exposes account- and organization-scoped REST list endpoints plus Logpush for continuous export (Audit Logs - version 2).
| Aspect | Cloudflare Audit Logs v2 | Perplexity Audit API |
|---|---|---|
| Default history window (API) | since / before up to 18 months retained |
Last 30 days per request; max 30-day window |
| Max window per request | Query bounded by retention and API params | Cannot exceed 30 days between start_time and end_time |
| Pagination | cursor (CF API) |
after_id / before_id opaque cursors |
| Rate limit | Per Cloudflare API token limits | 2 requests/sec per organization |
| Push alternative | Logpush audit_logs_v2 |
Audit log webhooks (same payload shape) |
Common conclusion: Use Logpush or scheduled API backfill for long Cloudflare retention; use Perplexity’s cursor polling or webhooks for near-real-time org activity, respecting the 30-day API window and separate audit API keys.
Perplexity records each Audit API read as audit_events_accessed (omitted from the default feed unless event_type=audit_events_accessed is set) (Access events).
Cache purge and domain deletion: practical audit log searches
Section titled “Cache purge and domain deletion: practical audit log searches”After cache changes, purge details appear in Audit Logs v2 (Audit Logs for Cache Purge Events); General FAQ confirms tracking purge requests via Audit Log v2 since that release.
When investigating accidental zone removal, Domain deleted from Cloudflare advises checking Audit Logs and confirming Resource says Zone, because Delete applies to many resource types.
Common mistakes
Section titled “Common mistakes”- Expecting 90 days of history in the v2 UI while needing 18 months—query the API or Logpush instead.
- Assuming organization and account logs are merged—they are separate streams (Organization-level support).
- Enabling view actions in exports without filters, inflating storage and SIEM cost (view actions).
- Using Perplexity Sonar API keys on the audit endpoint (
403 permission_denied) instead of an audit key withaudit_logs:read(Audit API). - Looking for R2 object reads in configuration audit logs—use data access logs per R2 audit logs.
- Relying on v2 alone for old/new JSON diffs on every product—use v1 where needed until v2 ships before/after values (GA notes).
How to check this on your site
Section titled “How to check this on your site”-
In the Cloudflare dashboard, open Audit Logs under Manage Account > Audit Logs and confirm a recent intentional change (actor, product, result).
-
If you use organization governance, open Organizations > Manage Organization > Audit Logs or follow Organizations for Enterprise and verify org-level entries stay separate from account logs.
-
Call
GET https://api.cloudflare.com/client/v4/accounts/{account_id}/logs/auditwithsinceandbeforecovering that change; confirm the same event appears in the API response. -
For Perplexity Enterprise, enable audit logging, create an audit API key per Audit API, and run
GET https://api.perplexity.ai/v1/admin/audit-events?limit=10to verify events return withhas_moreand cursor fields. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.