Skip to main content
The Audit API lets enterprise organization admins read the same audit events that Perplexity delivers through audit log webhooks, on a pull basis. Point a SIEM collector or a scheduled job at a single endpoint, page through events newest-first, and poll on your own cadence.
The Audit API uses a dedicated audit log API key, separate from the Sonar API keys used for chat completions, search, and other developer endpoints. Sonar API keys cannot call this endpoint.

Prerequisites

  • An Enterprise organization with audit logging enabled. Org admins turn this on under Organization Settings → Data and privacy → Audit Log Settings. See the Audit logs help center article for eligibility and setup.
  • An organization admin to create and manage keys.
Audit logging must be on before you can create a key, and if it is later turned off the API returns 404 until it is re-enabled. Events are recorded only while audit logging is on, so there is no history from before you enabled it.

Create an audit log API key

  1. In the Perplexity web app, open your organization’s settings and go to Enterprise APIs.
  2. Under Audit API → Audit log API keys, select Create key, give the key a name you will recognize later (for example, SIEM production), and confirm.
  3. Copy the key immediately. The full key is shown only once; afterward the list shows only the key’s name and creation date.
  4. Store the key in a secrets manager and treat it like any other credential.
Key properties:
  • Scope. Keys are read-only and limited to the audit_logs:read scope. They cannot change settings, manage members, or call other Perplexity APIs.
  • Organization-bound. A key reads events for the organization it was created in and nothing else.
  • Revocation. Org admins can revoke a key from the same page. Revoked keys stop working immediately, and requests with a revoked key return 401.
  • Audited. Every successful read through the API produces an audit_events_accessed event in your audit log (see Access events).
If the Create key button is unavailable or you see “API key creation is unavailable for this organization,” contact your Perplexity account team to enable the Audit API for your organization.

Make a request

Send the key as a bearer token to GET https://api.perplexity.ai/v1/admin/audit-events.
Events are returned newest first. Without any time parameters, the endpoint covers the most recent 30 days.

Query parameters

Cursors (first_id, last_id, after_id, before_id) are opaque strings. Store them and pass them back unchanged; do not parse them or build your own.

Response

Event fields

Metadata carries the same content as webhooks, including, where applicable, the truncated query text for query events, response text for answer_generated events, and file names for file_upload events. Secret values are never included; for example, when an admin updates a webhook URL or secret, the organization_settings_update event records that the field changed and redacts the value.

Paginate and poll

Audit events are append-only and ordered by created_at. The patterns below work well for a scheduled collector.

Backfill a time window

Fix start_time and end_time for the whole run, then follow last_id until has_more is false.
Each request can cover at most 30 days. Split longer ranges into consecutive 30-day windows.

Poll for new events

For ongoing collection, keep a checkpoint and ask for events newer than it:
  1. On each cycle, capture the current time as end_time and keep it fixed for every page in that cycle.
  2. Pass the first_id you saved from the previous cycle as before_id.
  3. Page with after_id and last_id until has_more is false.
  4. Store the newest first_id you saw as the next checkpoint. If data was empty, keep the old checkpoint.
Events can arrive a short time after they occur. Poll every few minutes rather than continuously, and deduplicate on id if you overlap windows for safety.

Access events

Every successful read through the Audit API is itself recorded as an audit_events_accessed event. These events are system-generated, so actor_email, ip_address, and user_agent are empty and session_id is null. The metadata identifies the key and the request:
So that a collector does not generate a feed that is mostly its own reads, the default response omits audit_events_accessed events. Request them explicitly with event_type=audit_events_accessed when you want to review who has been reading your audit log.

Rate limits and errors

Each organization may make up to 2 requests per second to this endpoint across all of its audit log API keys. Requests beyond that return 429 with a Retry-After header; wait at least that long before retrying. Use limit=500 to minimize the number of calls needed. Errors use the standard API error envelope:
Every attempt, including rejected ones, is logged on Perplexity’s side for security review.

Webhooks or API?

Both deliver the same events with the same metadata. Use whichever fits your tooling, or both:
The Audit API is distinct from the Analytics API, which reports Computer usage and uses its own organization analytics API key.