{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/harness/main/json-schema/harness-audit-filter-properties-v1-dto-schema.json",
  "title": "AuditFilterPropertiesV1DTO",
  "description": "Properties of the Filter entity defined in Harness.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/harness-audits-api-openapi.yml#/components/schemas/AuditFilterPropertiesV1DTO",
  "x-stoplight": {
    "id": "hrclq6ndh1ymg"
  },
  "type": "object",
  "properties": {
    "filter_type": {
      "$ref": "#/$defs/FilterType"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "maxProperties": 128,
      "description": "tags"
    },
    "start_time": {
      "type": "integer",
      "format": "int64",
      "description": "Used to specify a start time for retrieving Audit events that occurred at or after the time indicated."
    },
    "end_time": {
      "type": "integer",
      "format": "int64",
      "description": "Used to specify the end time for retrieving Audit events that occurred at or before the time indicated."
    },
    "modules": {
      "type": "array",
      "description": "List of Module Types",
      "items": {
        "$ref": "#/$defs/ModuleType1"
      }
    },
    "actions": {
      "type": "array",
      "description": "List of Actions",
      "items": {
        "$ref": "#/$defs/Action"
      }
    },
    "resources": {
      "type": "array",
      "description": "List of Resources",
      "items": {
        "$ref": "#/$defs/ResourceDTO"
      }
    },
    "scopes": {
      "type": "array",
      "description": "List of Resource Scopes",
      "items": {
        "$ref": "#/$defs/ResourceScopeDTO"
      }
    },
    "principals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Principal1"
      }
    },
    "static_filter": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StaticAuditFilter"
      }
    },
    "environments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Environment1"
      }
    }
  },
  "$defs": {
    "Action": {
      "title": "Action",
      "x-stoplight": {
        "id": "bzquds8sspg1q"
      },
      "type": "string",
      "enum": [
        "CREATE",
        "UPDATE",
        "RESTORE",
        "DELETE",
        "FORCE_DELETE",
        "UPSERT",
        "INVITE",
        "RESEND_INVITE",
        "REVOKE_INVITE",
        "ADD_COLLABORATOR",
        "REMOVE_COLLABORATOR",
        "CREATE_TOKEN",
        "REVOKE_TOKEN",
        "LOGIN",
        "LOGIN2FA",
        "UNSUCCESSFUL_LOGIN",
        "ERROR_BUDGET_RESET"
      ]
    },
    "Environment1": {
      "title": "Environment",
      "x-stoplight": {
        "id": "jmpmivgkftb1v"
      },
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/EnvironmentType1"
        }
      }
    },
    "EnvironmentType1": {
      "title": "EnvironmentType",
      "x-stoplight": {
        "id": "ihuiok9k1qcmz"
      },
      "type": "string",
      "enum": [
        "PreProduction",
        "Production"
      ]
    },
    "FilterType": {
      "title": "FilterType",
      "x-stoplight": {
        "id": "nvm8xs2of7vf8"
      },
      "type": "string",
      "enum": [
        "CONNECTOR",
        "DELEGATEPROFILE",
        "DELEGATE",
        "PIPELINESETUP",
        "PIPELINEEXECUTION",
        "DEPLOYMENT",
        "AUDIT",
        "TEMPLATE",
        "ENVIRONMENTGROUP",
        "FILESTORE",
        "CCMRECOMMENDATION",
        "ANOMALY",
        "ENVIRONMENT",
        "RULEEXECUTION"
      ]
    },
    "ModuleType1": {
      "title": "ModuleType",
      "x-stoplight": {
        "id": "xjqf65bl7w788"
      },
      "type": "string",
      "description": "Type of Modules",
      "enum": [
        "CD",
        "CI",
        "CV",
        "CF",
        "CE",
        "STO",
        "CORE",
        "PMS",
        "TEMPLATESERVICE",
        "GOVERNANCE",
        "CHAOS",
        "CET",
        "IDP"
      ]
    },
    "Principal1": {
      "title": "Principal",
      "x-stoplight": {
        "id": "tj7q0qb2zdnyw"
      },
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/PrincipalType"
        }
      }
    },
    "PrincipalType": {
      "title": "PrincipalType",
      "x-stoplight": {
        "id": "fxz45g9sxt8f2"
      },
      "type": "string",
      "enum": [
        "USER",
        "SYSTEM",
        "API_KEY",
        "SERVICE_ACCOUNT"
      ]
    },
    "ResourceDTO": {
      "title": "ResourceDTO",
      "x-stoplight": {
        "id": "2r7wy11v8scql"
      },
      "type": "object",
      "description": "This contains info about Resource saved as a part of Audit Event",
      "properties": {
        "type": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "ResourceScopeDTO": {
      "title": "ResourceScopeDTO",
      "x-stoplight": {
        "id": "4pz290lmuwtl3"
      },
      "type": "object",
      "description": "This has scope details for the resource defined in Harness.",
      "properties": {
        "account_identifier": {
          "type": "string",
          "description": "Identifier of Account"
        },
        "org_identifier": {
          "type": "string",
          "description": "Identifier of Organization"
        },
        "project_identifier": {
          "type": "string",
          "description": "Identifier of Project"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "StaticAuditFilter": {
      "title": "StaticAuditFilter",
      "x-stoplight": {
        "id": "mdul5d1wgfhez"
      },
      "type": "string",
      "enum": [
        "SYSTEM_EVENTS",
        "LOGIN_EVENTS",
        "ENTITY_CHANGE_EVENTS",
        "RUNTIME_EVENTS"
      ]
    }
  }
}