AuditLogs
Query an AuditLog
Queries audit logs from your workspace with filters, sorting, and cursor pagination.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.audit_logs.query(filters={
"operator": "and",
"filters": [
{
"type": "string",
"path": "entity_type",
"operator": "is",
"value": "skill",
},
],
}, pagination={
"limit": 20,
}, sorting=[
{
"key": "created_at",
"direction": "desc",
},
])
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.auditLogs.query({
filters: {
operator: "and",
filters: [
{
type: "string",
path: "entity_type",
operator: "is",
value: "skill",
},
],
},
pagination: {
limit: 20,
},
sorting: [
{
key: "created_at",
direction: "desc",
},
],
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"filters": { # required
"search": Optional[str],
"operator": str, # required
"filters": [{ # required
"type": str, # required
"path": str, # required
"operator": str, # required
"value": Any, # required
}],
},
"pagination": { # required
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
},
"sorting": [{ # optional
"key": str, # required
"direction": Optional[str],
}],
}
{
filters: { // required
search?: string;
operator: string; // required
filters: { // required
type: string; // required
path: string; // required
operator: string; // required
value: any; // required
}[];
};
pagination: { // required
limit?: number;
startingAfter?: string;
endingBefore?: string;
};
sorting?: {
key: string; // required
direction?: string;
}[];
}
Show Response
Show Response
{
"audit_logs": [{
"audit_log_id": str,
"project_id": Optional[str],
"entity_id": str,
"entity_type": Literal["ORIGIN_UNSPECIFIED", "ui", "api", "scim", "system", "router", "mcp", "automation", "internal"],
"action": Literal["ORIGIN_UNSPECIFIED", "ui", "api", "scim", "system", "router", "mcp", "automation", "internal"],
"actor_id": Optional[str],
"actor_ip": Optional[str],
"actor_type": Optional[Literal["ORIGIN_UNSPECIFIED", "ui", "api", "scim", "system", "router", "mcp", "automation", "internal"]],
"actor_display": Optional[str],
"origin": Optional[Literal["ORIGIN_UNSPECIFIED", "ui", "api", "scim", "system", "router", "mcp", "automation", "internal"]],
"request_id": Optional[str],
"created_at": str,
"metadata": Dict[str, Any], # optional
}],
"overall_total": str,
"has_more": bool,
}
{
auditLogs: {
auditLogId: string;
projectId?: string;
entityId: string;
entityType: "ORIGIN_UNSPECIFIED" | "ui" | "api" | "scim" | "system" | "router" | "mcp" | "automation" | "internal";
action: "ORIGIN_UNSPECIFIED" | "ui" | "api" | "scim" | "system" | "router" | "mcp" | "automation" | "internal";
actorId?: string;
actorIp?: string;
actorType?: "ORIGIN_UNSPECIFIED" | "ui" | "api" | "scim" | "system" | "router" | "mcp" | "automation" | "internal";
actorDisplay?: string;
origin?: "ORIGIN_UNSPECIFIED" | "ui" | "api" | "scim" | "system" | "router" | "mcp" | "automation" | "internal";
requestId?: string;
createdAt: Date;
metadata?: Record<string, unknown>;
}[];
overallTotal: string;
hasMore: boolean;
}