{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/print-one/json-schema/print-one-create-v3-webhook-request-dto-schema.json",
  "title": "CreateV3WebhookRequestDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/print-one-webhooks-api-openapi.yml#/components/schemas/CreateV3WebhookRequestDto",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The custom name of the webhook"
    },
    "url": {
      "type": "string",
      "description": "The callback of the webhook"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the webhook is active"
    },
    "headers": {
      "type": "object",
      "description": "A map of headers to add to each webhook call"
    },
    "secretHeaders": {
      "type": "object",
      "description": "A map of headers with secret values, which will not be visible after saving"
    },
    "events": {
      "type": "array",
      "description": "List of events to subscribe to",
      "items": {
        "type": "string",
        "enum": [
          "order_status_update",
          "template_preview_rendered",
          "coupon_code_used",
          "qr_code_scanned",
          "mailing_sent"
        ]
      }
    },
    "filters": {
      "description": "Applied filters",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/SingularV3WebhookFilter"
          },
          {
            "$ref": "#/$defs/PluralV3WebhookFilter"
          }
        ]
      }
    }
  },
  "required": [
    "name",
    "url",
    "active",
    "events"
  ],
  "$defs": {
    "PluralV3WebhookFilter": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The key to compare against"
        },
        "event": {
          "type": "string",
          "description": "The event the filter should apply on",
          "enum": [
            "order_status_update",
            "template_preview_rendered",
            "coupon_code_used",
            "qr_code_scanned",
            "mailing_sent"
          ]
        },
        "type": {
          "type": "string",
          "enum": [
            "in",
            "not-in"
          ]
        },
        "value": {
          "description": "The values to compare against",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "key",
        "event",
        "type",
        "value"
      ]
    },
    "SingularV3WebhookFilter": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The key to compare against"
        },
        "event": {
          "type": "string",
          "description": "The event the filter should apply on",
          "enum": [
            "order_status_update",
            "template_preview_rendered",
            "coupon_code_used",
            "qr_code_scanned",
            "mailing_sent"
          ]
        },
        "type": {
          "type": "string",
          "enum": [
            "equals",
            "not-equals"
          ]
        },
        "value": {
          "type": "string",
          "description": "The value to compare against"
        }
      },
      "required": [
        "key",
        "event",
        "type",
        "value"
      ]
    }
  }
}