{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/railhook-io/json-schema/railhook-io-transformation-response-schema.json",
  "title": "TransformationResponse",
  "description": "A reusable transformation: one mapping, pointed at by any number of subscriptions and destinations",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/railhook-io-openapi.yml#/components/schemas/TransformationResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "projectId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "description": "Unique within the project"
    },
    "description": {
      "type": "string",
      "description": "What it does and when to use it"
    },
    "template": {
      "type": "string",
      "description": "The transformation itself: a JSON document with ${$.jsonpath} expressions when `kind` is TEMPLATE, or a JavaScript `function handler(webhook)` when it is JAVASCRIPT"
    },
    "kind": {
      "type": "string",
      "description": "The language `template` is written in. Every transformation created before JavaScript existed is TEMPLATE, and none were migrated.",
      "enum": [
        "TEMPLATE",
        "JAVASCRIPT"
      ]
    },
    "version": {
      "type": "integer",
      "format": "int32",
      "description": "Incremented every time the template or the language changes. Each value is a row in the version history, and can be read back and restored."
    },
    "enabled": {
      "type": "boolean",
      "description": "A disabled transformation cannot be assigned, and a delivery already pointed at one fails rather than sending the untransformed payload"
    },
    "subscriptionCount": {
      "type": "integer",
      "format": "int64",
      "description": "How many subscriptions point at this transformation"
    },
    "destinationCount": {
      "type": "integer",
      "format": "int64",
      "description": "How many incoming destinations point at this transformation"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}