{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reachium-io/json-schema/reachium-io-webhook-endpoint-with-secret-schema.json",
  "title": "WebhookEndpointWithSecret",
  "description": "Only returned by POST /webhooks (create) and POST /webhooks/{id}/rotate-secret. The plaintext `secret` is shown exactly once here and is never retrievable again; rotate to get a new one.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reachium-io-openapi.yml#/components/schemas/WebhookEndpointWithSecret",
  "allOf": [
    {
      "$ref": "#/$defs/WebhookEndpoint"
    },
    {
      "type": "object",
      "properties": {
        "secret": {
          "type": "string"
        }
      },
      "required": [
        "secret"
      ]
    }
  ],
  "$defs": {
    "WebhookEndpoint": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "workspace_id": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "category_filters": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "campaign_filters": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "format": "uuid"
          }
        },
        "kind": {
          "type": "string",
          "enum": [
            "webhook"
          ]
        },
        "is_active": {
          "type": "boolean"
        },
        "disabled_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "consecutive_failures": {
          "type": "integer"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "workspace_id",
        "url",
        "events",
        "category_filters",
        "campaign_filters",
        "kind",
        "is_active",
        "disabled_reason",
        "consecutive_failures",
        "description",
        "created_by",
        "created_at",
        "updated_at"
      ]
    }
  }
}