{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swoogo/json-schema/swoogo-webhook-fields-schema.json",
  "title": "webhookFields",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swoogo-openapi.yml#/components/schemas/webhookFields",
  "type": "object",
  "required": [
    "name",
    "url",
    "trigger_object"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the webhook."
    },
    "url": {
      "type": "string",
      "description": "The URL that data should be sent to.",
      "required": true
    },
    "trigger_object": {
      "type": "string",
      "enum": [
        "event",
        "contact",
        "registrant",
        "speaker",
        "sponsor",
        "session",
        "session_attendance",
        "registrant_line_item"
      ],
      "description": "The object that will cause the webhook to trigger."
    },
    "group_id": {
      "type": "integer",
      "description": "Identifier for the webhook group."
    },
    "headers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Header key."
          },
          "value": {
            "type": "string",
            "description": "Header value."
          }
        }
      },
      "description": "Array of headers for the webhook."
    },
    "trigger_on_insert": {
      "type": "boolean",
      "description": "Trigger the webhook when the object is inserted."
    },
    "trigger_on_update": {
      "type": "boolean",
      "description": "Trigger the webhook when the object is updated."
    },
    "trigger_on_delete": {
      "type": "boolean",
      "description": "Trigger the webhook when the object is deleted."
    },
    "public_user": {
      "type": "boolean",
      "description": "Run the webhook for public users."
    },
    "admin_user": {
      "type": "boolean",
      "description": "Run the webhook for admin users."
    },
    "api_call": {
      "type": "boolean",
      "description": "Trigger the webhook during an API call."
    },
    "all_fields": {
      "type": "boolean",
      "description": "Run the webhook for changes to all fields."
    },
    "any_event": {
      "type": "boolean",
      "description": "Run the webhook for any event."
    },
    "use_default_fields": {
      "type": "boolean",
      "description": "Use default fields for the webhook."
    },
    "enabled": {
      "type": "boolean",
      "description": "Indicates whether the webhook is enabled."
    },
    "event_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "List of event IDs to trigger the webhook."
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Custom JSON object fields that trigger the webhook."
      },
      "description": "Array of fields to trigger the webhook when changed."
    },
    "content_type": {
      "type": "string",
      "enum": [
        "json",
        "post"
      ],
      "description": "The content type for webhook payloads."
    },
    "notes": {
      "type": "string",
      "description": "Additional notes for the webhook."
    },
    "post_field_data": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "id",
          "value"
        ]
      },
      "description": "Fields to include in the webhook POST data."
    },
    "custom_fields": {
      "description": "Custom fields for the webhook (type unspecified).",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Key to identify value on response."
          },
          "type": {
            "type": "string",
            "description": "The object that will cause the webhook to trigger.",
            "enum": [
              "event",
              "contact",
              "registrant",
              "speaker",
              "sponsor",
              "session",
              "session_attendance",
              "registrant_line_item"
            ]
          },
          "value": {
            "type": "string",
            "description": "Field name."
          }
        }
      }
    }
  }
}