{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/railhook-io/json-schema/railhook-io-incoming-destination-request-schema.json",
  "title": "IncomingDestinationRequest",
  "description": "Request to create or update a forwarding destination",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/railhook-io-openapi.yml#/components/schemas/IncomingDestinationRequest",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Destination URL to forward webhooks to",
      "minLength": 1
    },
    "authType": {
      "type": "string",
      "description": "Authentication type for the destination",
      "enum": [
        "NONE",
        "BASIC",
        "BEARER",
        "CUSTOM_HEADER"
      ]
    },
    "authConfig": {
      "type": "string",
      "description": "JSON auth config (encrypted at rest). Keys depend on authType: BEARER={token}, BASIC={username,password}, CUSTOM_HEADER={headerName,headerValue}",
      "maxLength": 4096,
      "minLength": 0
    },
    "customHeadersJson": {
      "type": "string",
      "description": "Custom HTTP headers as JSON object"
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether the destination is active"
    },
    "maxAttempts": {
      "type": "integer",
      "format": "int32",
      "description": "Maximum delivery attempts before moving to DLQ"
    },
    "timeoutSeconds": {
      "type": "integer",
      "format": "int32",
      "description": "HTTP request timeout in seconds"
    },
    "retryDelays": {
      "type": "string",
      "description": "Comma-separated retry delays in seconds",
      "maxLength": 255,
      "minLength": 0
    },
    "retryableStatuses": {
      "type": "string",
      "description": "Which HTTP statuses are worth another attempt. Comma-separated terms: an exact status, a range (500-599), a 5xx shorthand, or a comparison (>=500). Prefix a term with ! to exclude it; exclusions win wherever they are written.",
      "maxLength": 255,
      "minLength": 0
    },
    "payloadTransform": {
      "type": "string",
      "description": "JSONPath expression to transform payload before forwarding (null = forward as-is)",
      "maxLength": 4096,
      "minLength": 0
    },
    "transformationId": {
      "type": "string",
      "format": "uuid",
      "description": "ID of a reusable transformation template to apply (overrides payloadTransform if set). Empty string detaches the destination from its template."
    }
  },
  "required": [
    "url"
  ]
}