{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cisco-xdr/json-schema/cisco-xdr-patch-webhook-params-schema.json",
  "title": "PatchWebhookParams",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cisco-xdr-webhook-api-openapi.yml#/components/schemas/PatchWebhookParams",
  "type": "object",
  "properties": {
    "integration_id": {
      "description": "id of the integration this record belongs to",
      "type": [
        "string",
        "null"
      ]
    },
    "webhook_type": {
      "description": "should the Webhook Trigger an API or an AO Workflow",
      "type": "string",
      "enum": [
        "workflow",
        "url"
      ]
    },
    "name": {
      "description": "a Name describing the Webhook",
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "iroh-events",
        "ctia-events"
      ]
    },
    "auth": {
      "description": "inform authentication mechanism to be used in webhook delivery",
      "x-oneOf": [
        {
          "$ref": "#/$defs/PatchWebhookParamsAuth"
        }
      ]
    },
    "event_filter_map": {
      "$ref": "#/$defs/PatchWebhookParamsEventFilterMap"
    },
    "workflow": {
      "description": "if the webhook triggers an AO workflow, the workflow tag",
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "description": "if the webhook triggers an API, the target URL",
      "type": [
        "string",
        "null"
      ]
    },
    "record_type_filter": {
      "description": "trigger on these record types",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "enum": [
          "feedback",
          "investigation",
          "data-table",
          "relationship",
          "vulnerability",
          "judgement",
          "weakness",
          "coa",
          "attack-pattern",
          "incident",
          "indicator",
          "campaign",
          "sighting",
          "casebook",
          "identity-assertion",
          "malware",
          "actor"
        ]
      },
      "uniqueItems": true
    },
    "event_type_filter": {
      "description": "trigger on these record lifecycle events",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "private-intel/note/created",
          "record-created",
          "auto/workflow/completed",
          "private-intel/incident/created",
          "private-intel/incident/high-impact/created",
          "record-updated",
          "auto/workflow/errored",
          "private-intel/incident/deleted",
          "user/updated",
          "private-intel/note/deleted",
          "piam-entitlements/updated",
          "scc-tenant/created",
          "private-intel/incident/last-activity-change",
          "private-intel/incident/status-changed",
          "org/deleting",
          "private-intel/note/updated",
          "module-instance/restricted",
          "module-instance/reactivated",
          "notification-request/created",
          "private-intel/incident/asset-enrichment/succeeded",
          "entitlements/updated",
          "auto/workflow/started",
          "record-deleted",
          "private-intel/incident/updated",
          "user/deleted",
          "module-instance/updated",
          "module-instance/created",
          "user/created",
          "module-instance/deleted",
          "scc-tenant/updated"
        ]
      },
      "uniqueItems": true
    },
    "enabled": {
      "description": "Enable/Disable the Webhook",
      "type": [
        "boolean",
        "null"
      ]
    },
    "visibility": {
      "type": "string",
      "enum": [
        "global",
        "org",
        "user"
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "PatchWebhookParamsAuth": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "iroh-jwt"
          ]
        },
        "conf": {
          "$ref": "#/$defs/PatchWebhookParamsAuthConf"
        }
      },
      "additionalProperties": false,
      "required": [
        "type",
        "conf"
      ]
    },
    "PatchWebhookParamsAuthConf": {
      "type": "object",
      "properties": {
        "client_id": {
          "description": "client-id of the client that will be used to generate JWT for the webhook creator to the webhook endpoint. This is mandatory for the `iroh-jwt` authentication type and ignored for other authentication types.",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "client_id"
      ]
    },
    "PatchWebhookParamsEventFilterMap": {
      "type": "object",
      "properties": {
        "module_type_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "module_instance_visibility": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "global",
            "org",
            "user"
          ]
        }
      },
      "additionalProperties": {}
    }
  }
}