{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currents-dev/json-schema/currents-dev-webhook-response-schema.json",
  "title": "WebhookResponse",
  "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/WebhookResponse",
  "type": "object",
  "required": [
    "status",
    "data"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "OK"
      ]
    },
    "data": {
      "$ref": "#/$defs/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"
    },
    "Webhook": {
      "type": "object",
      "required": [
        "hookId",
        "projectId",
        "url",
        "hookEvents"
      ],
      "properties": {
        "hookId": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the webhook"
        },
        "projectId": {
          "type": "string",
          "description": "Project this webhook belongs to"
        },
        "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. Values are masked, showing only their last characters (e.g., {\"Authorization\": \"****oken\"})."
        },
        "hookEvents": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HookEvent"
          },
          "description": "Events that trigger this webhook"
        },
        "label": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 255,
          "description": "Human-readable label for the webhook"
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the webhook was created"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the webhook was last updated"
        }
      }
    }
  }
}