Skip to main content
This page covers three tasks. Each has an app flow and an API flow.
  1. Access audit logs: see who changed what in your organisation
  2. Export logs: create an export job for your request logs
  3. Download exported logs: get the finished file
Have a list of IDs, such as from a data pack? See Look up by request ID for audit log entries and Export specific logs by ID for logs.

1. Access audit logs

Audit logs record administrative changes: who made a change, to which resource, and when.

Access in the app

Go to Admin Settings > Audit Logs. Audit logs are collected automatically across all workspaces. See Audit Logs for what each entry contains.

Filters

Narrow the results with any of these filters: In the app, use the filters on the Audit Logs page.

Access with the API

Call GET /audit-logs. start_time, end_time, and organisation_id are required. start_time and end_time are ISO 8601 timestamps.
Add any of these query parameters to filter the results: Results are paginated. Use current_page and page_size (maximum 100) to page through them.

Look up by request ID

To fetch specific audit log entries from a list of request IDs, use POST /v1/audit-logs/bulk instead of paging through a time range. Use an organisation admin API key. In the app, filter by Request ID and paste the ID. With the API, send the request IDs in batches:
  • Send 500 to 2,500 request IDs per call.
  • If the final batch has fewer than 500 IDs, set last_page to true.
  • The response contains the matching audit log entries and a total.
  • IDs with no entry are left out. You only see entries for your own organisation. Duplicate IDs are ignored.
Audit logs are not looked up through log exports. Use this endpoint.

2. Export logs

Exports run as jobs. Each job writes your request logs for a time range, or for a list of log IDs, to a JSONL file, up to 50,000 logs per job.

Export in the app

1

Open Exports

Go to Exports on the main sidebar and click Request Data.
2

Configure the export

Set the Time Range, the Logs Limits (maximum number of logs or a custom offset), and the Requested Fields to include.
3

Request and start the export

Click Request Export. The job appears in the exports list with the status Draft. Click Start to run it.

Export with the API

Create the export job, then start it. The job runs asynchronously.
1

Create the export

POST /v1/logs/exports with a time range and the fields to export. The response contains the export id.
2

Start the export

POST /v1/logs/exports/{export_id}/start
For the full list of fields, restrictions on exportable fields, and a complete script, see Logs Export.

Open a single log in the app

To open one log by its ID, use this URL pattern:

Export specific logs by ID

To get the full request and response for a list of log IDs, create an export with filters.ids. Use an organisation admin API key.
Then start the export and download it as for any other export.
  • Include 1 to 50,000 IDs per export. For a longer list, create more than one export.
  • Use ids only. Don’t combine it with a date range or other filters.
  • You can’t change the IDs on an export after creating it. Create a new export.
  • Export by ID returns logs even if they are older than your plan’s log retention period.
  • If your organisation blocks fields such as request or response from exports, creating the export is rejected. Check what is allowed with GET /v1/logs/exports/field-restrictions.
  • Export by ID is for logs only.

Enterprise and self-hosted organisations

Enterprise logs are stored only in your own log store. If the IDs you have belong to logs stored on Portkey SaaS, add the query param saas-logs-only=true when creating the export:

3. Download exported logs

Download in the app

1

Wait for the export to finish

Open Exports on the main sidebar. The status changes to Success when the job is done. If it shows Failure, click Start Again to retry.
2

Download the file

Click Download next to the completed export. The file is in JSONL format, one log entry per line.

Download with the API

1

Check the export status

GET /v1/logs/exports/{export_id}. Check about every 30 seconds until status is success.
2

Get the download URL

GET /v1/logs/exports/{export_id}/download returns a signed URL. Use an organisation admin API key.
3

Download the file

The signed URL expires quickly, so download the file right away. If the link has expired, request a new one.

Other data

Troubleshooting

Audit Logs

Logs Export

Last modified on November 20, 2026