{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/good-grants/json-schema/good-grants-webhook-schema.json",
  "title": "Webhook",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/good-grants-webhooks-api-openapi.yml#/components/schemas/Webhook",
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "description": "Subscription events that trigger this webhook.",
      "items": {
        "type": "string"
      }
    },
    "fields": {
      "type": "array",
      "description": "Fields included in the webhook payload.",
      "items": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Short URL-safe identifier for the field."
          },
          "link": {
            "type": "string",
            "format": "uri",
            "description": "Canonical URL for the field resource."
          },
          "title": {
            "type": "object",
            "description": "Plain-text title of the field, as a map keyed by locale code (for example, `en_GB` or `fr_FR`).",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      }
    },
    "form": {
      "type": [
        "object",
        "null"
      ],
      "description": "Form the webhook is scoped to, or `null` if not scoped to a specific form.",
      "properties": {
        "slug": {
          "type": "string",
          "description": "Short URL-safe identifier for the form."
        },
        "link": {
          "type": "string",
          "format": "uri",
          "description": "Canonical URL for the form resource."
        },
        "name": {
          "type": "string",
          "description": "Name of the form."
        }
      }
    },
    "method": {
      "type": "string",
      "description": "HTTP method used to call the webhook URL.",
      "enum": [
        "get",
        "post"
      ]
    },
    "name": {
      "type": "string",
      "description": "Name of the webhook."
    },
    "slug": {
      "type": "string",
      "description": "Slug of the webhook."
    },
    "signing_key": {
      "type": "string",
      "description": "Key used to sign outgoing webhook requests."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "URL that receives the webhook payload."
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the webhook was created."
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the webhook was last updated."
    }
  }
}