{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-webhook-jsonpatch-request-schema.json",
  "title": "WebhookJSONPatchRequest",
  "description": "JSON Patch request to update a webhook.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-webhooks-api-openapi.yml#/components/schemas/WebhookJSONPatchRequest",
  "type": "array",
  "items": {
    "oneOf": [
      {
        "$ref": "#/$defs/WebhookJSONPatchReplaceUrl"
      },
      {
        "$ref": "#/$defs/WebhookJSONPatchReplaceFilters"
      },
      {
        "$ref": "#/$defs/WebhookJSONPatchReplaceAlias"
      }
    ]
  },
  "$defs": {
    "CreateWebhookFilter": {
      "type": "object",
      "properties": {
        "resource": {
          "description": "The API resource for which to receive webhooks. See available\nresources in the [Webhooks and events](https://docs.atlar.com/docs/api#webhooks-and-events) section.\n",
          "type": "string"
        },
        "eventTypes": {
          "description": "A list of event types for which to receive webhooks.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/EventType"
          },
          "minItems": 1
        }
      },
      "required": [
        "resource",
        "eventTypes"
      ]
    },
    "EventType": {
      "type": "string",
      "description": "Event type.",
      "enum": [
        "CREATED",
        "UPDATED",
        "DELETED"
      ]
    },
    "WebhookJSONPatchReplaceAlias": {
      "description": "Change the webhook alias. Use an empty string to clear the alias.\n",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/alias"
          ]
        },
        "value": {
          "type": "string",
          "maxLength": 100
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "WebhookJSONPatchReplaceFilters": {
      "description": "Change webhook filters. Like /url and /alias, this doesn't work if the\nwebhook was created via API v1.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/filters"
          ]
        },
        "value": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CreateWebhookFilter"
          },
          "minItems": 1,
          "maxItems": 100
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "WebhookJSONPatchReplaceUrl": {
      "description": "Change webhook URL. Modifying the URL makes the webhook unverified (`verified: false`).\n",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/url"
          ]
        },
        "value": {
          "$ref": "#/$defs/WebhookURL"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "WebhookURL": {
      "description": "The URL to which webhooks will be sent via HTTP POST requests in JSON format. Must use scheme `https://`.\n",
      "type": "string",
      "minLength": 1,
      "maxLength": 1024,
      "pattern": "^https://"
    }
  }
}