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.
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
- In the Perplexity web app, open your organization’s settings and go to Enterprise APIs.
- 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. - Copy the key immediately. The full key is shown only once; afterward the list shows only the key’s name and creation date.
- Store the key in a secrets manager and treat it like any other credential.
- Scope. Keys are read-only and limited to the
audit_logs:readscope. 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_accessedevent 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 toGET https://api.perplexity.ai/v1/admin/audit-events.
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 bycreated_at. The patterns below work well for a scheduled collector.
Backfill a time window
Fixstart_time and end_time for the whole run, then follow last_id until has_more is false.
Poll for new events
For ongoing collection, keep a checkpoint and ask for events newer than it:- On each cycle, capture the current time as
end_timeand keep it fixed for every page in that cycle. - Pass the
first_idyou saved from the previous cycle asbefore_id. - Page with
after_idandlast_iduntilhas_moreisfalse. - Store the newest
first_idyou saw as the next checkpoint. Ifdatawas empty, keep the old checkpoint.
id if you overlap windows for safety.
Access events
Every successful read through the Audit API is itself recorded as anaudit_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:
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 return429 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.