{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currents-dev/json-schema/currents-dev-create-webhook-request-schema.json",
  "title": "CreateWebhookRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/currents-dev-webhooks-api-openapi.yml#/components/schemas/CreateWebhookRequest",
  "type": "object",
  "required": [
    "url"
  ],
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048,
      "description": "URL to send webhook POST requests to"
    },
    "headers": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 4096,
      "description": "Custom headers as a JSON object string (e.g., {\"Authorization\": \"Bearer token\"})"
    },
    "hookEvents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HookEvent"
      },
      "default": [],
      "description": "Events that trigger this webhook"
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 255,
      "description": "Human-readable label for the webhook"
    }
  },
  "$defs": {
    "HookEvent": {
      "type": "string",
      "enum": [
        "RUN_FINISH",
        "RUN_START",
        "RUN_TIMEOUT",
        "RUN_CANCELED"
      ],
      "description": "The event that triggers the webhook:\n- `RUN_FINISH`: Run completed (passed or failed)\n- `RUN_START`: Run started\n- `RUN_TIMEOUT`: Run timed out\n- `RUN_CANCELED`: Run was cancelled"
    }
  }
}