---
title: "Test a transformation"
method: PUT
path: "/transformations/run"
tags: ["Transformations"]
---

# Test a transformation

`PUT /transformations/run`

This endpoint executes a transformation against a sample request payload and returns the transformed result without persisting anything.

## Request body

- object
  - `env` object — Key-value environment variables to be passed to the transformation
  - `webhook_id` string — ID of the connection (webhook) to use for the execution `context`
  - `code` string — JavaScript code to be executed
  - `transformation_id` string — Transformation ID
  - `request` object — Request input to use for the transformation execution
    - `headers` object, required — Headers of the request
    - `body` union — Body of the request
      - object
      - string
    - `path` string, nullable — Path of the request
    - `query` string, nullable — String representation of the query params of the request
    - `parsed_query` object — JSON representation of the query params
  - `event_id` string

## Response `200`

Transformation run output

- TransformationExecutorOutput
  - `request_id` string, nullable
  - `transformation_id` string, nullable
  - `execution_id` string, nullable
  - `log_level` 'debug' | 'info' | 'warn' | 'error' | 'fatal', required — The minimum log level to open the issue on
  - `request` object, nullable
    - `headers` union
      - string
      - object
    - `path` string, required
    - `query` union
      - object, nullable
      - string
    - `parsed_query` union
      - string, nullable
      - object
    - `body` union
      - string, nullable
      - object
  - `console` ConsoleLine[], nullable
    - `type` 'error' | 'log' | 'warn' | 'info' | 'debug', required
    - `message` string, required

## Other responses

- `400` — Bad Request
- `422` — Unprocessable Entity

---

[API](https://skmtc.dev/hookdeck/apis/hookdeck-admin-rest-api.md) · [All operations](https://skmtc.dev/hookdeck/apis/hookdeck-admin-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hookdeck/hookdeck-admin-rest-api/revisions/091808eac7fa/schema)
