---
title: "Test a transformer with input data"
method: POST
path: "/api/transformers/{transformerId}/test"
tags: ["Transformers"]
---

# Test a transformer with input data

`POST /api/transformers/{transformerId}/test`

Runs a configured transformer (standard or custom, by id) with the given options against the
provided input data, returning both the wrapped input and the transformed output. Used to test a
north/history transformer with its configured options.

## Path parameters

- `transformerId` string, required

## Request body

- TransformerTestRequest — Request payload for testing a custom transformer.
  - `inputData` string, required — The raw input data string to pass to the transformer. The expected format depends on the transformer's `inputType` (e.g. a JSON-serialised array of time-values, or a raw file path for `any`).
  - `options` object — Optional transformer-specific options object passed alongside the input data.

## Response `200`

The wrapped input and transformed output

- SouthConnectorItemTestResult — Result of testing a South/History item. `raw` is always the value collected by the connector; `transformed` is the output of running `raw` through the selected transformer with its options, or null when no transformer was requested. This lets the UI show the Raw → transformer → Output pipeline. `connectionDuration`/`queryDuration` are passed through from the connector's `SouthConnectorItemQueryResult`.
  - `raw` union, required — Type representing OIBus content.
    - OIBusTimeValueContent — Time-value content.
      - `type` 'time-values', required — The type of content.
      - `content` OIBusTimeValue[], required — The array of time-value pairs.
        - `pointId` string, required — The ID of the point.
        - `timestamp` string, required — Represents an instant in time as an ISO 8601 string.
        - `data` object, required — The data associated with the point.
          - `value` union, required — The value of the point.
            - string
            - number, double
    - OIBusFileContent — Raw content.
      - `type` 'any', required — The type of content.
      - `filePath` string, required — The path to the file containing the content.
      - `filename` string — The logical filename to store in cache metadata (used as the output filename by north connectors). When omitted, north connectors fall back to path.basename(filePath). South connectors that preserve directory structure (e.g. folder-scanner with recursive=true) set this to the path relative to the source folder, e.g. "subdir/file.json".
      - `content` string — The content itself, if available.
    - OIBusAnyContent
      - `type` 'any-content', required — The type of content.
      - `content` string, required — The content
    - OIBusSetpointContent — Setpoint content.
      - `type` 'setpoint', required — The type of content.
      - `content` OIBusSetpoint[], required — The array of setpoints.
        - `reference` string, required — The reference of the setpoint.
        - `value` union, required — The value of the setpoint.
          - string
          - number, double
          - boolean
  - `transformed` union, required — Type representing OIBus content.
    - OIBusTimeValueContent — Time-value content.
      - `type` 'time-values', required — The type of content.
      - `content` OIBusTimeValue[], required — The array of time-value pairs.
        - `pointId` string, required — The ID of the point.
        - `timestamp` string, required — Represents an instant in time as an ISO 8601 string.
        - `data` object, required — The data associated with the point.
          - `value` union, required — The value of the point.
            - string
            - number, double
    - OIBusFileContent — Raw content.
      - `type` 'any', required — The type of content.
      - `filePath` string, required — The path to the file containing the content.
      - `filename` string — The logical filename to store in cache metadata (used as the output filename by north connectors). When omitted, north connectors fall back to path.basename(filePath). South connectors that preserve directory structure (e.g. folder-scanner with recursive=true) set this to the path relative to the source folder, e.g. "subdir/file.json".
      - `content` string — The content itself, if available.
    - OIBusAnyContent
      - `type` 'any-content', required — The type of content.
      - `content` string, required — The content
    - OIBusSetpointContent — Setpoint content.
      - `type` 'setpoint', required — The type of content.
      - `content` OIBusSetpoint[], required — The array of setpoints.
        - `reference` string, required — The reference of the setpoint.
        - `value` union, required — The value of the setpoint.
          - string
          - number, double
          - boolean
  - `connectionDuration` number, double, required
  - `queryDuration` number, double, required

---

[API](https://skmtc.net/optimistiksas/apis/oibus-api.md) · [All operations](https://skmtc.net/optimistiksas/apis/oibus-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/optimistiksas/oibus-api/versions/743d1b62f042/schema)
