From 17b449a960c211e49d0fc7ca43e07468a874c5cc Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Wed, 18 Nov 2026 19:49:58 +0530 Subject: [PATCH 1/2] docs: add Exporting Data page for Portkey and SCM Covers accessing audit logs (UI, API, filters), exporting logs (UI, API), and downloading exported logs (UI, API). Portkey page under product/observability, SCM page mirrored under aigw. Co-Authored-By: Claude Sonnet 5.5 --- aigw/product/observability/exporting-data.mdx | 140 +++++++++++++++ docs.json | 2 + product/observability/exporting-data.mdx | 163 ++++++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 aigw/product/observability/exporting-data.mdx create mode 100644 product/observability/exporting-data.mdx diff --git a/aigw/product/observability/exporting-data.mdx b/aigw/product/observability/exporting-data.mdx new file mode 100644 index 00000000..c27b068a --- /dev/null +++ b/aigw/product/observability/exporting-data.mdx @@ -0,0 +1,140 @@ +--- +title: "Exporting Data" +description: "Access audit logs, export logs, and download exported logs from Strata Cloud Manager (SCM) or the API." +--- + +This page covers three tasks. Each has an app flow and an API flow. + +1. [Access audit logs](#1-access-audit-logs): see who changed what in your organisation +2. [Export logs](#2-export-logs): create an export job for your request logs +3. [Download exported logs](#3-download-exported-logs): get the finished file + +## 1. Access audit logs + +Audit logs record administrative changes: who made a change, to which resource, and when. + +### Access in SCM + +In SCM, open **Log Viewer** and select **Common/Audit** from the drop-down. See [Audit Logs](/aigw/product/enterprise-offering/audit-logs) for what each entry contains. + +### Filters + +Narrow the results with any of these filters: + +| Filter | Description | +|---|---| +| **Time range** | Period to search | +| **Method** | HTTP method: `POST`, `PUT`, or `DELETE` | +| **Request ID** | A specific request | +| **Resource type** | Type of resource affected, such as workspaces, API keys, integrations, configs, or guardrails | +| **Action** | Create, update, delete, publish, export, rotate, manage, or duplicate | +| **Response status** | HTTP status code | +| **Workspace** | A specific workspace | +| **User** | The user or API key that made the change | +| **Client IP** | Originating IP address | +| **Country** | Originating country | + +In SCM, use the filters in Log Viewer. + +### Access with the API + +Audit logs are available in SCM. An audit logs endpoint is not published in the Prisma AIRS AI Gateway API reference. + +## 2. Export logs + +Exports run as jobs. Each job writes your request logs for a time range to a JSONL file, up to 50,000 logs per job. + +### Export in SCM + + + +Go to **Exports** on the main sidebar and click **Request Data**. + + +Set the **Time Range**, the **Logs Limits** (maximum number of logs or a custom offset), and the **Requested Fields** to include. + + +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. + + + +`POST /v1/logs/exports` with a time range and the fields to export. The response contains the export `id`. + +```bash +curl -X POST "https://aigw.portkey.ai/v1/logs/exports" \ + -H "Authorization: Bearer YOUR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "filters": { + "created_at": { + "gte": "2026-11-01T00:00:00Z", + "lte": "2026-11-18T23:59:59Z" + } + }, + "requested_data": ["id", "created_at", "ai_model", "total_tokens", "cost", "status_code"] + }' +``` + + +`POST /v1/logs/exports/{export_id}/start` + +```bash +curl -X POST "https://aigw.portkey.ai/v1/logs/exports/EXPORT_ID/start" \ + -H "Authorization: Bearer YOUR_API_KEY" +``` + + + +For the full list of fields, restrictions on exportable fields, and a complete script, see [Logs Export](/aigw/product/observability/logs-export). + +## 3. Download exported logs + +### Download in SCM + + + +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. + + +Click **Download** next to the completed export. The file is in JSONL format, one log entry per line. + + + +### Download with the API + + + +`GET /v1/logs/exports/{export_id}`. Repeat until `status` is `success`. A status of `failure` means the job failed. + +```bash +curl "https://aigw.portkey.ai/v1/logs/exports/EXPORT_ID" \ + -H "Authorization: Bearer YOUR_API_KEY" +``` + + +`GET /v1/logs/exports/{export_id}/download` returns a signed URL. + +```bash +curl "https://aigw.portkey.ai/v1/logs/exports/EXPORT_ID/download" \ + -H "Authorization: Bearer YOUR_API_KEY" +``` + + +```bash +curl -o logs_export.jsonl "SIGNED_DOWNLOAD_URL" +``` + + + +## Related + + + + + diff --git a/docs.json b/docs.json index 519286c2..2aba8143 100644 --- a/docs.json +++ b/docs.json @@ -48,6 +48,7 @@ "product/observability/metadata", "product/observability/filters", "product/observability/logs-export", + "product/observability/exporting-data", "product/observability/cost-management", "product/observability/budget-limits", "product/observability/auto-instrumentation" @@ -1627,6 +1628,7 @@ "aigw/product/observability/metadata", "aigw/product/observability/filters", "aigw/product/observability/logs-export", + "aigw/product/observability/exporting-data", "aigw/product/observability/cost-management", "aigw/product/observability/auto-instrumentation", "aigw/product/administration/configuring-request-logging", diff --git a/product/observability/exporting-data.mdx b/product/observability/exporting-data.mdx new file mode 100644 index 00000000..680297bb --- /dev/null +++ b/product/observability/exporting-data.mdx @@ -0,0 +1,163 @@ +--- +title: "Exporting Data" +description: "Access audit logs, export logs, and download exported logs from the Portkey app or the API." +--- + +This page covers three tasks. Each has an app flow and an API flow. + +1. [Access audit logs](#1-access-audit-logs): see who changed what in your organisation +2. [Export logs](#2-export-logs): create an export job for your request logs +3. [Download exported logs](#3-download-exported-logs): get the finished file + +## 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](/product/enterprise-offering/audit-logs) for what each entry contains. + +### Filters + +Narrow the results with any of these filters: + +| Filter | Description | +|---|---| +| **Time range** | Period to search | +| **Method** | HTTP method: `POST`, `PUT`, or `DELETE` | +| **Request ID** | A specific request | +| **Resource type** | Type of resource affected, such as workspaces, API keys, integrations, configs, guardrails, or prompts | +| **Action** | Create, update, delete, publish, export, rotate, manage, or duplicate | +| **Response status** | HTTP status code | +| **Workspace** | A specific workspace | +| **User** | The user or API key that made the change | +| **Client IP** | Originating IP address | +| **Country** | Originating country | + +In the app, use the filters on the Audit Logs page. + +### Access with the API + +Call [`GET /audit-logs`](/api-reference/admin-api/control-plane/audit-logs/list-audit-logs). `start_time`, `end_time`, and `organisation_id` are required. `start_time` and `end_time` are ISO 8601 timestamps. + +```bash +curl "https://api.portkey.ai/v1/audit-logs?start_time=2026-11-01T00:00:00Z&end_time=2026-11-18T23:59:59Z&organisation_id=YOUR_ORGANISATION_ID" \ + -H "x-portkey-api-key: YOUR_PORTKEY_API_KEY" +``` + +Add any of these query parameters to filter the results: + +| Parameter | Filters by | +|---|---| +| `method` | `POST`, `PUT`, or `DELETE` | +| `uri` | URI path | +| `request_id` | Request ID | +| `user_id` | User ID | +| `user_type` | `user` or `api_key` | +| `workspace_id` | Workspace | +| `response_status_code` | HTTP status code | +| `resource_type` | Resource type | +| `action` | Action | +| `client_ip` | Client IP address | +| `country` | Country | + +Results are paginated. Use `current_page` and `page_size` (maximum 100) to page through them. + +## 2. Export logs + +Exports run as jobs. Each job writes your request logs for a time range to a JSONL file, up to 50,000 logs per job. + +### Export in the app + + + +Go to **Exports** on the main sidebar and click **Request Data**. + + +Set the **Time Range**, the **Logs Limits** (maximum number of logs or a custom offset), and the **Requested Fields** to include. + + +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. + + + +[`POST /v1/logs/exports`](/api-reference/admin-api/data-plane/logs/log-exports-beta/create-a-log-export) with a time range and the fields to export. The response contains the export `id`. + +```bash +curl -X POST "https://api.portkey.ai/v1/logs/exports" \ + -H "x-portkey-api-key: YOUR_PORTKEY_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "filters": { + "created_at": { + "gte": "2026-11-01T00:00:00Z", + "lte": "2026-11-18T23:59:59Z" + } + }, + "requested_data": ["id", "created_at", "ai_model", "total_tokens", "cost", "status_code"] + }' +``` + + +[`POST /v1/logs/exports/{export_id}/start`](/api-reference/admin-api/data-plane/logs/log-exports-beta/start-a-log-export) + +```bash +curl -X POST "https://api.portkey.ai/v1/logs/exports/EXPORT_ID/start" \ + -H "x-portkey-api-key: YOUR_PORTKEY_API_KEY" +``` + + + +For the full list of fields, restrictions on exportable fields, and a complete script, see [Logs Export](/product/observability/logs-export). + +## 3. Download exported logs + +### Download in the app + + + +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. + + +Click **Download** next to the completed export. The file is in JSONL format, one log entry per line. + + + +### Download with the API + + + +[`GET /v1/logs/exports/{export_id}`](/api-reference/admin-api/data-plane/logs/log-exports-beta/retrieve-a-log-export). Repeat until `status` is `success`. A status of `failure` means the job failed. + +```bash +curl "https://api.portkey.ai/v1/logs/exports/EXPORT_ID" \ + -H "x-portkey-api-key: YOUR_PORTKEY_API_KEY" +``` + + +[`GET /v1/logs/exports/{export_id}/download`](/api-reference/admin-api/data-plane/logs/log-exports-beta/download-a-log-export) returns a signed URL. + +```bash +curl "https://api.portkey.ai/v1/logs/exports/EXPORT_ID/download" \ + -H "x-portkey-api-key: YOUR_PORTKEY_API_KEY" +``` + + +```bash +curl -o logs_export.jsonl "SIGNED_DOWNLOAD_URL" +``` + + + +## Related + + + + + From 0b48b3b72d8b5b0257b6fd78dd67b1b420dfdcdc Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Wed, 18 Nov 2026 20:13:43 +0530 Subject: [PATCH 2/2] docs: fix CardGroup cols syntax and use valid export field IDs Co-Authored-By: Claude Sonnet 5.5 --- aigw/product/observability/exporting-data.mdx | 4 ++-- product/observability/exporting-data.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aigw/product/observability/exporting-data.mdx b/aigw/product/observability/exporting-data.mdx index c27b068a..94d29993 100644 --- a/aigw/product/observability/exporting-data.mdx +++ b/aigw/product/observability/exporting-data.mdx @@ -77,7 +77,7 @@ curl -X POST "https://aigw.portkey.ai/v1/logs/exports" \ "lte": "2026-11-18T23:59:59Z" } }, - "requested_data": ["id", "created_at", "ai_model", "total_tokens", "cost", "status_code"] + "requested_data": ["id", "created_at", "ai_model", "total_units", "cost", "response_status_code"] }' ``` @@ -134,7 +134,7 @@ curl -o logs_export.jsonl "SIGNED_DOWNLOAD_URL" ## Related - + diff --git a/product/observability/exporting-data.mdx b/product/observability/exporting-data.mdx index 680297bb..56670c26 100644 --- a/product/observability/exporting-data.mdx +++ b/product/observability/exporting-data.mdx @@ -100,7 +100,7 @@ curl -X POST "https://api.portkey.ai/v1/logs/exports" \ "lte": "2026-11-18T23:59:59Z" } }, - "requested_data": ["id", "created_at", "ai_model", "total_tokens", "cost", "status_code"] + "requested_data": ["id", "created_at", "ai_model", "total_units", "cost", "response_status_code"] }' ``` @@ -157,7 +157,7 @@ curl -o logs_export.jsonl "SIGNED_DOWNLOAD_URL" ## Related - +