{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/hookbridge/main/json-schema/hookbridge-create-inbound-endpoint-request-schema.json",
  "title": "CreateInboundEndpointRequest",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/hookbridge-api-openapi.yml#/components/schemas/CreateInboundEndpointRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 255,
      "description": "Friendly name for the inbound endpoint"
    },
    "description": {
      "type": "string",
      "maxLength": 500,
      "description": "Optional description"
    },
    "mode": {
      "type": "string",
      "enum": [
        "forward",
        "cli",
        "pull"
      ],
      "default": "forward",
      "description": "Endpoint mode. `forward` delivers webhooks to the URL via HTTP.\n`cli` streams webhooks to a connected CLI tool (no HTTP delivery).\n"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "HTTPS URL of your endpoint that will receive forwarded webhooks.\nRequired when mode is `forward`. Optional when mode is `cli`.\nMust be publicly accessible. Internal/private IP addresses are blocked.\n",
      "pattern": "^https://",
      "minLength": 12,
      "maxLength": 2048
    },
    "verify_static_token": {
      "type": "boolean",
      "description": "Enable static token verification on incoming webhooks",
      "default": false
    },
    "token_header_name": {
      "type": "string",
      "description": "Header name containing the static token (if verify_static_token is true)"
    },
    "token_query_param": {
      "type": "string",
      "description": "Query parameter name containing the static token (alternative to header)"
    },
    "token_value": {
      "type": "string",
      "description": "The static token value (will be hashed for storage)"
    },
    "verify_hmac": {
      "type": "boolean",
      "description": "Enable HMAC signature verification on incoming webhooks",
      "default": false
    },
    "hmac_header_name": {
      "type": "string",
      "description": "Header name containing the HMAC signature (if verify_hmac is true)"
    },
    "hmac_secret": {
      "type": "string",
      "description": "HMAC secret key (will be encrypted for storage)"
    },
    "timestamp_header_name": {
      "type": "string",
      "description": "Header name containing the request timestamp for replay protection"
    },
    "timestamp_ttl_seconds": {
      "type": "integer",
      "minimum": 1,
      "description": "Maximum age in seconds for timestamp validation"
    },
    "verify_ip_allowlist": {
      "type": "boolean",
      "description": "Enable IP allowlist verification on incoming webhooks",
      "default": false
    },
    "allowed_cidrs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "CIDR blocks allowed to send webhooks (if verify_ip_allowlist is true)"
    },
    "idempotency_header_names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ordered list of header names to derive idempotency keys from incoming requests"
    },
    "ingest_response_code": {
      "type": "integer",
      "minimum": 200,
      "maximum": 299,
      "default": 202,
      "description": "HTTP status code returned to senders on successful ingestion"
    },
    "signing_enabled": {
      "type": "boolean",
      "description": "Enable HMAC signing on forwarded deliveries (secret auto-generated)",
      "default": false
    },
    "ephemeral": {
      "type": "boolean",
      "default": false,
      "description": "If true, creates an ephemeral inbound endpoint for CI/test workflows.\nEphemeral endpoints auto-expire after the TTL.\n"
    },
    "ttl_minutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440,
      "default": 30,
      "description": "Time-to-live in minutes for ephemeral endpoints. Only used when ephemeral is true.\nAfter this duration, the endpoint is automatically deleted.\n"
    }
  }
}