Mohit
07/17/2026, 9:02 AMOr Weis
07/17/2026, 9:03 AMAsk Inkeep
07/17/2026, 9:03 AMAsk Inkeep
07/17/2026, 9:03 AMstdout/stderr in your deployed PDP microservice, making it easy to integrate them directly with your preferred logging platform .
For best practices on implementing audit log collection, the documentation recommends using asynchronous audit logging to avoid adding latency, and preferring solutions that generate audit logs implicitly without explicit logging code in your application (2) .
If you need more specific implementation details or code samples for your use case, I recommend reaching out to the Permit.io team via Email or their Slack community for tailored guidance on setting up daily batch exports to object storage.Ask Inkeep
07/17/2026, 9:03 AMOr Weis
07/17/2026, 9:04 AMAsk Inkeep
07/17/2026, 9:04 AMAsk Inkeep
07/17/2026, 9:04 AMcurl "<https://api.permit.io/v2/pdps/{proj_id}/{env_id}/audit_logs>" \
-H "Authorization: Bearer {api-key}"
The API endpoint accepts several query parameters for filtering :
• pdp_id - Filter by PDP config id
• users - List of user keys or emails to filter by
• decision - Filter by decision result (boolean)
• resources - Filter by resources
• tenant - Filter by tenant
• action - Filter by action
• timestamp_from - Filter by timestamp from (integer)
• timestamp_to - Filter by timestamp to (integer)
• page - Page number of results to fetch, starting at 1
• per_page - Number of results per page (max 100)
For example, to fetch logs from a specific time range:
curl "<https://api.permit.io/v2/pdps/{proj_id}/{env_id}/audit_logs?timestamp_from=1640995200×tamp_to=1641081600&per_page=100>" \
-H "Authorization: Bearer {api-key}"
Note that the maximum number of results for this API is 10,000 (2) . To obtain additional results, you'll need to readjust the query's time window or apply additional filters .Ask Inkeep
07/17/2026, 9:04 AMAsk Inkeep
07/17/2026, 10:11 AMMohit
07/17/2026, 10:45 AM2026-07-17 16:10:33,676 - DEBUG - Starting new HTTPS connection (1): <http://www.permit.io:443|www.permit.io:443>
2026-07-17 16:10:34,381 - DEBUG - <https://www.permit.io:443> "GET /v2/pdps/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/audit_logs?from=2026-07-10T10%3A40%3A33.451011%2B00%3A00&to=2026-07-17T10%3A40%3A33.451179%2B00%3A00&page=1&per_page=100&query=none HTTP/1.1" 200 None
2026-07-17 16:10:34,424 - WARNING - API error: Expecting value: line 1 column 1 (char 0). Retrying in 1s...Or Weis
07/17/2026, 10:48 AMAsk Inkeep
07/17/2026, 10:48 AMAsk Inkeep
07/17/2026, 10:48 AM<http://www.permit.io|www.permit.io> as the base URL, but the correct API endpoint should be <http://api.permit.io|api.permit.io> (1) .
The correct Python request should look like this:
import requests
api_key = "your_api_key"
proj_id = "your_project_id"
env_id = "your_environment_id"
url = f"<https://api.permit.io/v2/pdps/{proj_id}/{env_id}/audit_logs>"
headers = {
"Authorization": f"Bearer {api_key}"
}
params = {
"timestamp_from": 1720605633, # Unix timestamp
"timestamp_to": 1721210433, # Unix timestamp
"page": 1,
"per_page": 100
}
response = requests.get(url, headers=headers, params=params)
Key issues with your current request:
1. *Wrong base URL*: Change from <http://www.permit.io|www.permit.io> to <http://api.permit.io|api.permit.io>
2. *Parameter names*: The API expects timestamp_from and timestamp_to (not from and to) , and these should be Unix timestamps (integers) , not ISO format strings
3. *Remove query parameter*: The API doesn't have a query parameter - use the specific filter parameters instead
The API supports these query parameters for filtering :
• pdp_id - Filter by PDP config id
• users - List of user keys or emails
• decision - Filter by decision result (boolean)
• resources - Filter by resources
• tenant - Filter by tenant
• action - Filter by action
• timestamp_from - Filter by timestamp from (integer)
• timestamp_to - Filter by timestamp to (integer)
• page - Page number starting at 1
• per_page - Number of results per page (max 100)
Remember that the maximum number of results for this API is 10,000 (2) . If you need additional results, readjust the query's time window or apply additional filters (1) .
To help investigate further, could you share:
1. Which Workspace / Project / Env you are using
2. The exact SDK code or CURL command you're performing
3. Which PDP version you are running
4. Relevant logs from your PDPAsk Inkeep
07/17/2026, 10:48 AM