{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/railhook-io/json-schema/railhook-io-transformation-version-response-schema.json",
  "title": "TransformationVersionResponse",
  "description": "One published version of a transformation's template",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/railhook-io-openapi.yml#/components/schemas/TransformationVersionResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "transformationId": {
      "type": "string",
      "format": "uuid"
    },
    "version": {
      "type": "integer",
      "format": "int32",
      "description": "The version number this template was published as"
    },
    "template": {
      "type": "string",
      "description": "The template itself. Omitted from the list of versions — fetch one version to read it."
    },
    "kind": {
      "type": "string",
      "description": "The language this version was published in. Restoring it puts the language back as well as the text, so a restore cannot leave a script in a row marked TEMPLATE or the other way round.",
      "enum": [
        "TEMPLATE",
        "JAVASCRIPT"
      ]
    },
    "current": {
      "type": "boolean",
      "description": "Whether this is the version the transformation is currently using"
    },
    "restoredFromVersion": {
      "type": "integer",
      "format": "int32",
      "description": "Set when this version was published by restoring an earlier one, naming that earlier version"
    },
    "createdBy": {
      "type": "string",
      "format": "uuid",
      "description": "The user who published it. Null when it was published with an API key, or the user has since been erased."
    },
    "createdByEmail": {
      "type": "string",
      "description": "Email of the user who published it, resolved at read time so an erasure takes the name and leaves the change"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}