Get audit logs
Returns paginated audit logs for the enterprise workspace. Supports filtering by category, action, actor, and date range. Requires an admin API key and enterprise workspace.
https://api.deutschlandgpt.de/v2/admin/audit-logsExample request
curl https://api.deutschlandgpt.de/v2/admin/audit-logs \
-X GET \
-H "Authorization: Bearer $DGPT_API_KEY"curl https://api.deutschlandgpt.de/v2/admin/audit-logs \
-X GET \
-H "Authorization: Bearer $DGPT_API_KEY"import os, requests
response = requests.get(
"https://api.deutschlandgpt.de/v2/admin/audit-logs",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
)
print(response.json())import os, requests
response = requests.get(
"https://api.deutschlandgpt.de/v2/admin/audit-logs",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
)
print(response.json())const response = await fetch('https://api.deutschlandgpt.de/v2/admin/audit-logs', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
},
});
console.log(await response.json());const response = await fetch('https://api.deutschlandgpt.de/v2/admin/audit-logs', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
},
});
console.log(await response.json());Parameters
pageintegeroptionalPage number
page_sizeintegeroptionalResults per page
categorystringoptionalFilter by action namespace prefix — matches actions beginning with <category>. (e.g. category=api_key matches api_key.created).
actionstringoptionalFilter by action (e.g. api_key.created)
actor_idstringoptionalFilter by actor user ID
start_datestring<date>optionalStart date (ISO 8601)
end_datestring<date>optionalEnd date (ISO 8601)
sortstringoptionalSort field
dirstringoptionalSort direction
anonymizebooleanoptionalWhen true (default), PII fields are replaced with deterministic SHA-256 hashes. Set to false to return raw values.
Response
{
"object": "list",
"data": [
{
"id": "string",
"action": "string",
"actorEmail": "string",
"actorId": "string",
"targetId": "string",
"targetLabel": "string",
"metadata": {},
"createdAt": "2025-01-01T00:00:00Z"
}
],
"pagination": {
"page": 0,
"pageSize": 0,
"total": 0,
"totalPages": 0
}
}{
"object": "list",
"data": [
{
"id": "string",
"action": "string",
"actorEmail": "string",
"actorId": "string",
"targetId": "string",
"targetLabel": "string",
"metadata": {},
"createdAt": "2025-01-01T00:00:00Z"
}
],
"pagination": {
"page": 0,
"pageSize": 0,
"total": 0,
"totalPages": 0
}
}Paginated audit logs
objectstringdataAuditLogEntry[]idstringactionstringactorEmailstringActor email address. SHA-256 hashed by default when anonymize=true.
actorIdstring | nullActor user ID. Null if the actor user has been deleted.
targetIdstring | nulltargetLabelstring | nullTarget label (may contain PII). SHA-256 hashed by default when anonymize=true.
metadataobject | nullcreatedAtstring<date-time>paginationobjectpageintegerpageSizeintegertotalintegertotalPagesintegerResponse codes
Paginated audit logs
objectUnauthorized
Requires admin API key and enterprise workspace