{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/orq/json-schema/orq-query-audit-logs-response-schema.json",
  "title": "QueryAuditLogsResponse",
  "description": "Paginated audit log query result.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/orq-audit-logs-api-openapi.yml#/components/schemas/QueryAuditLogsResponse",
  "required": [
    "audit_logs",
    "overall_total",
    "has_more"
  ],
  "type": "object",
  "properties": {
    "audit_logs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AuditLog"
      },
      "description": "Audit logs matching the query."
    },
    "overall_total": {
      "type": "string",
      "description": "Total number of audit logs matching the query before cursor pagination."
    },
    "has_more": {
      "type": "boolean",
      "description": "Whether another page exists after the returned audit logs."
    }
  },
  "$defs": {
    "ActionValue": {
      "type": "string",
      "enum": [
        "created",
        "updated",
        "deleted",
        "archived",
        "enabled",
        "disabled",
        "invited",
        "added",
        "removed",
        "revoked",
        "connected",
        "disconnected",
        "subscribed",
        "cancelled",
        "consumption_reset",
        "set",
        "rotated",
        "scope_updated",
        "access_updated",
        "login_succeeded",
        "logged_out",
        "provisioned",
        "deprovisioned",
        "exported",
        "triggered",
        "completed",
        "errored",
        "skipped",
        "accessed"
      ]
    },
    "ActorTypeValue": {
      "type": "string",
      "enum": [
        "user",
        "api_key",
        "management_key",
        "scim",
        "system",
        "service"
      ]
    },
    "AuditLog": {
      "required": [
        "audit_log_id",
        "entity_id",
        "entity_type",
        "action",
        "created_at"
      ],
      "type": "object",
      "properties": {
        "audit_log_id": {
          "type": "string",
          "description": "Unique identifier for the audit log entry."
        },
        "project_id": {
          "type": "string",
          "description": "Project associated with the event, when the audited entity belongs to a project."
        },
        "entity_id": {
          "type": "string",
          "description": "Identifier of the entity that changed."
        },
        "entity_type": {
          "description": "Type of entity that changed.",
          "$ref": "#/$defs/EntityTypeValue"
        },
        "action": {
          "description": "Action recorded for the entity event.",
          "$ref": "#/$defs/ActionValue"
        },
        "actor_id": {
          "type": "string",
          "description": "User or system actor that caused the event, when available."
        },
        "actor_ip": {
          "type": "string",
          "description": "IP address observed for the actor, when available."
        },
        "actor_type": {
          "description": "Kind of actor behind the action. Omitted when unknown.",
          "$ref": "#/$defs/ActorTypeValue"
        },
        "actor_display": {
          "type": "string",
          "description": "Human readable actor name captured when the action happened."
        },
        "origin": {
          "description": "Surface the action came from. Omitted when unknown.",
          "$ref": "#/$defs/OriginValue"
        },
        "request_id": {
          "type": "string",
          "description": "Correlates the entry with the originating request."
        },
        "created_at": {
          "type": "string",
          "description": "Time when the audit log entry was created.",
          "format": "date-time"
        },
        "metadata": {
          "type": "object",
          "description": "Additional event metadata. The exact shape depends on entity_type and action."
        }
      },
      "description": "An audit log entry for an entity event in the authenticated workspace."
    },
    "EntityTypeValue": {
      "type": "string",
      "enum": [
        "agent",
        "agent_schedule",
        "alert",
        "annotation_queue",
        "api_key",
        "automation",
        "budget",
        "dataset",
        "deployment",
        "directory",
        "evaluator",
        "experiment",
        "experiment_v2",
        "factory",
        "file",
        "file_system",
        "guardrail_rule",
        "human_review",
        "human_review_set",
        "identity",
        "integration",
        "knowledge",
        "management_key",
        "mcp_gateway",
        "mcp_server",
        "member",
        "memory_store",
        "model",
        "monitor",
        "notifier",
        "permission",
        "playground",
        "project",
        "prompt_library",
        "prompt_snippet",
        "report",
        "routing_rule",
        "scm_connection",
        "sheet",
        "skill",
        "smart_router",
        "subscription",
        "team",
        "tool",
        "variable_collection",
        "workflow",
        "workspace",
        "webhook",
        "session",
        "sso_config"
      ]
    },
    "OriginValue": {
      "type": "string",
      "enum": [
        "ui",
        "api",
        "scim",
        "system",
        "router",
        "mcp",
        "automation",
        "internal"
      ]
    }
  }
}