{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/railhook-io/json-schema/railhook-io-delivery-dry-run-response-schema.json",
  "title": "DeliveryDryRunResponse",
  "description": "Dry-run delivery result: shows exactly what the endpoint would receive",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/railhook-io-openapi.yml#/components/schemas/DeliveryDryRunResponse",
  "type": "object",
  "properties": {
    "transformedPayload": {
      "type": "string",
      "description": "The transformed payload that would be sent as request body"
    },
    "requestHeaders": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "HTTP headers that would be sent with the request"
    },
    "signature": {
      "type": "string",
      "description": "The HMAC signature header value (if endpoint provided)"
    },
    "endpointUrl": {
      "type": "string",
      "description": "The endpoint URL where the payload would be delivered"
    },
    "success": {
      "type": "boolean",
      "description": "Whether the dry-run completed successfully"
    },
    "errors": {
      "type": "array",
      "description": "Any errors or warnings encountered during the dry-run",
      "items": {
        "type": "string"
      }
    },
    "transformationName": {
      "type": "string",
      "description": "Name of the transformation applied (if any)"
    },
    "transformationVersion": {
      "type": "integer",
      "format": "int32",
      "description": "Version of the transformation applied (if any)"
    },
    "transformationKind": {
      "type": "string",
      "description": "The language that actually ran",
      "enum": [
        "TEMPLATE",
        "JAVASCRIPT"
      ]
    },
    "console": {
      "type": "array",
      "description": "Everything the script logged, oldest first. Empty for a template.",
      "items": {
        "$ref": "#/$defs/ConsoleLine"
      }
    },
    "cancelled": {
      "type": "boolean",
      "description": "True when the script asked for the delivery to be dropped. Nothing would be sent, and there is no body to sign."
    },
    "cancelReason": {
      "type": "string",
      "description": "Why the script cancelled, as the script stated it"
    },
    "durationMs": {
      "type": "integer",
      "format": "int64",
      "description": "Wall clock spent inside the script, in milliseconds"
    },
    "errorLine": {
      "type": "integer",
      "format": "int32",
      "description": "The line in the script the failure came from, 1-based, or null when the failure has no location"
    },
    "errorReason": {
      "type": "string",
      "description": "Why the script produced nothing, as a value rather than as prose. Same set as the transform preview's.",
      "enum": [
        "SYNTAX",
        "CONTRACT",
        "RUNTIME",
        "TIMEOUT",
        "MEMORY",
        "OUTPUT_TOO_LARGE",
        "SOURCE_TOO_LARGE",
        "UNAVAILABLE"
      ]
    }
  },
  "$defs": {
    "ConsoleLine": {
      "type": "object",
      "description": "One console.* call a script made",
      "properties": {
        "level": {
          "type": "string",
          "description": "log, info, warn, error or debug"
        },
        "message": {
          "type": "string",
          "description": "The arguments, already formatted"
        }
      }
    }
  }
}