{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grepr/json-schema/grepr-activity-logs-search-schema.json",
  "title": "ActivityLogsSearch",
  "description": "Activity logs search criteria",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grepr-activity-logs-api-openapi.yml#/components/schemas/ActivityLogsSearch",
  "properties": {
    "endTime": {
      "description": "End of time range filter. Must be a valid ISO timestamp in UTC.",
      "format": "date-time",
      "type": "string"
    },
    "limit": {
      "default": 100,
      "description": "Maximum number of results to return",
      "format": "int32",
      "maximum": 1000,
      "minimum": 1,
      "type": "integer"
    },
    "logTypes": {
      "default": [],
      "description": "Optional filter by log types. If null or empty, matches all log types.",
      "items": {
        "description": "Optional filter by log types. If null or empty, matches all log types.",
        "enum": [
          "INTEGRATION_IMPORT",
          "INTEGRATION_STATISTICS",
          "JOB_EXECUTION",
          "USER_ACTIVITY",
          "SECURITY_EVENT"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "offset": {
      "description": "Number of results to skip for pagination",
      "format": "int32",
      "minimum": 0,
      "type": "integer"
    },
    "resourceFilters": {
      "default": [],
      "description": "Optional resource filters. Multiple filters use OR logic. If null or empty, matches all resources the user has access to (requires system logs permission if no filters specified).",
      "items": {
        "$ref": "#/$defs/ResourceFilter"
      },
      "type": "array"
    },
    "searchQuery": {
      "description": "Optional full-text search query for message content. Uses PostgreSQL's text search capabilities.",
      "type": "string"
    },
    "startTime": {
      "description": "Start of time range filter. Must be a valid ISO timestamp in UTC.",
      "format": "date-time",
      "type": "string"
    },
    "statuses": {
      "default": [],
      "description": "Optional filter by log statuses. If null or empty, matches all log statuses.",
      "items": {
        "description": "Optional filter by log statuses. If null or empty, matches all log statuses.",
        "enum": [
          "INFO",
          "WARNING",
          "ERROR"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "userIds": {
      "default": [],
      "description": "Optional filter by user IDs who triggered the activity. If null or empty, matches all users.",
      "items": {
        "description": "Optional filter by user IDs who triggered the activity. If null or empty, matches all users.",
        "type": "string"
      },
      "type": "array"
    }
  },
  "type": "object",
  "$defs": {
    "ResourceFilter": {
      "description": "Resource filter for activity logs",
      "properties": {
        "resourceId": {
          "description": "Specific resource ID to filter by. If null, matches all resources of this type in the organization.",
          "type": "string"
        },
        "resourceType": {
          "description": "Resource type to filter by",
          "enum": [
            "INTEGRATION",
            "JOB",
            "DATASET",
            "TEMPLATE",
            "TEAM",
            "USER",
            "ORGANIZATION_SETTINGS",
            "SERVICE_ACCOUNT",
            "ORGANIZATION",
            "BILLING",
            "ISSUE"
          ],
          "type": "string"
        }
      },
      "required": [
        "resourceType"
      ],
      "type": "object"
    }
  }
}