{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entur/json-schema/entur-webhook-configuration-request-schema.json",
  "title": "WebhookConfigurationRequest",
  "description": "The request body a client will send when registering a webhook configuration.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-configurations-api-openapi.yml#/components/schemas/WebhookConfigurationRequest",
  "required": [
    "baseUrl",
    "eventPaths"
  ],
  "type": "object",
  "properties": {
    "baseUrl": {
      "type": "string",
      "description": "The client specified base url where they want to use for all event paths."
    },
    "eventPaths": {
      "minItems": 1,
      "type": "array",
      "description": "A collection of which webhooks events and the paths they should be sent to. The path is combined with the base url to form a complete url",
      "items": {
        "$ref": "#/$defs/WebhookConfigurationEventPaths"
      }
    }
  },
  "$defs": {
    "WebhookConfigurationEventPaths": {
      "title": "WebhookConfigurationEventPaths",
      "required": [
        "event",
        "path"
      ],
      "type": "object",
      "properties": {
        "event": {
          "type": "string",
          "description": "A webhook event. Possible values are: CREDIT."
        },
        "path": {
          "pattern": "^/.*$",
          "type": "string",
          "description": "The path a webhook event should be sent to. Must start with '/'. The full callback url is the base url with this path appended verbatim."
        }
      },
      "description": "The response returned when registering or updating a webhook configuration"
    }
  }
}