---
title: "Preview transform"
method: POST
path: "/api/v1/projects/{projectId}/transform-preview"
tags: ["Transform Preview"]
---

# Preview transform

`POST /api/v1/projects/{projectId}/transform-preview`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/projects/{projectId}/transform-preview`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Test a payload transform expression against sample input

## Path parameters

- `projectId` string, uuid, required

## Request body

- TransformPreviewRequest: Run a transformation against a sample payload without saving or sending anything
  - `inputPayload` string, required: The event payload to transform
  - `transformExpression` string: A bare JSONPath to extract, for the simplest case. Ignored when a template, script or transformation is given.
  - `template` string: An unsaved template or script to run. This is what the Transform Studio sends while you are still editing.
  - `kind` 'TEMPLATE' | 'JAVASCRIPT': The language `template` is written in. Omitted means TEMPLATE.
  - `transformationId` string, uuid: A saved transformation to run instead. Takes priority over `template`, and brings its own kind.
  - `customHeaders` string: Headers to merge, as a JSON object. A script sees these as `webhook.headers` and may override them.
  - `eventType` string: The event type a script sees as `webhook.eventType`
  - `eventId` string: The event id a script sees as `webhook.eventId`
  - `url` string: The destination URL a script sees as `webhook.url`. Read-only to the script; a transformation cannot redirect a delivery.

## Response `200`

OK

---

[API](https://skmtc.dev/railhook/apis/railhook-api.md) · [All operations](https://skmtc.dev/railhook/apis/railhook-api/llms.txt) · [OpenAPI document](https://skmtc.dev/railhook/apis/railhook-api/revisions/4e2c76dfc33d?raw)
