---
title: Input & Output Transformation
slug: api-marketplace/input-and-output-transformation
createdAt: 2026-11-12T11:24:34.359Z
---

### Overview

The Input/Output Transformation plugins reshape the request and response of a Studio API using JSONata expressions. You can send requests and receive responses in your own format, while the Base API in between stays unchanged.

**Purpose:**

- **Input Transformation:** Converts your request body into the format the Base API expects. You can rename, restructure, combine or drop fields.
- **Output Transformation:** Converts the Base API response into the format your system expects. You can pick, rename, flatten or derive fields.

**Effect:** The request you send and the response you receive can have a different structure from the Base API's. Only the fields defined in your expressions are passed on.

You can enable either plugin on its own, or both together.

### How to Use

1. **Access API Studio&#x20;**
   - Go to the **My APIs** page.
   - Select the required API.
   - Click **Open API Studio**. This opens the API Studio configuration page.
2. **Configure Transformation Plugins**&#x20;
   - Provide a Studio API Name.
   - Select the Base API and continue.
   - Choose the environment (Test or Live).
   - Enable **Input Transformation**, **Output Transformation**, or both.
   - Write the JSONata expression for each enabled plugin in the editor:
     - **Input Transformation:** The editor is pre-filled with the Base API's request fields. Replace each value with the path to the matching field in your request.
     - **Output Transformation:** Each value is a path to a field in the Base API response.
   - The editor checks your expression's syntax before it can be saved.
3. **Access Studio API**&#x20;
   - Navigate to the *Studio API* tab under *My APIs*.&#x20;
   - Locate the newly created Transformation-enabled API.
4. **Use the API**&#x20;
   - Refer to the plugin-specific documentation within the Studio API view.
   - Send the request in your own format if Input Transformation is enabled. Otherwise, use the Base API's format.
   - The response is returned in your own format if Output Transformation is enabled. Otherwise, it is the Base API response.

# Writing the Expression

- **Keys** are the field names you want in the output.
- **Values** are field paths from the incoming JSON, written **without quotes**. For example, `fieldA` or `parent.child`.
- A value **in quotes** is sent as fixed text. For example, `"FIXED_VALUE"`.
- If a referenced field is missing, it is left out of the output. It is not sent as `null`.

| You write                                                       | Result                                              |
| --------------------------------------------------------------- | --------------------------------------------------- |
| `"targetField": sourceField`                                    | `targetField` gets the value of `sourceField`       |
| `"targetField": "sourceField"`                                  | `targetField` gets the literal text `"sourceField"` |
| `"targetField": parent.child`                                   | Reads a nested field                                |
| `"targetField": $uppercase(sourceField)`                        | Converts the value to uppercase                     |
| `"targetField": fieldA & " " & fieldB`                          | Joins two fields                                    |
| `"targetField": $exists(sourceField) ? sourceField : "default"` | Uses a default value if the field is missing        |

# Processing Order

When both transformations are enabled along with other plugins, the request is processed in this order:

1. Decryption (if Encryption is enabled)
2. Base64 Decode (if Base64 is enabled)
3. **Input Transformation**
4. Base API call
5. **Output Transformation**
6. Base64 Encode (if Base64 is enabled)
7. Encryption (if Encryption is enabled)

# Response Handling

- With Output Transformation, the response contains only the fields defined in your expression.
- Without Output Transformation, the Base API response is returned as is.
- If Base64 or Encryption is also enabled, the response is encoded or encrypted **after** the transformation.

# Notes

- Field names are case-sensitive: `fieldName` and `FieldName` are different fields.
- The Input Transformation must produce every field the Base API requires. Otherwise the Base API rejects the request.
- Transformations always work on plain JSON. Decryption and decoding happen before the Input Transformation, and encoding and encryption happen after the Output Transformation.
- The Output Transformation also runs on Base API **error** responses. Reference fields that exist in both success and error responses, or use `$exists()`, so that error details are not lost.
- You can test expressions on sample data at [https://try.jsonata.org](https://try.jsonata.org).

# Example Request

```json
{
  "referenceId": "REF-001",
  "customer": {
    "firstName": "John",
    "lastName": "Doe"
  },
  "docNumber": "XYZ123"
}
```

**Input Transformation**

```jsonata
{
  "name": customer.firstName & " " & customer.lastName,
  "number": docNumber
}
```

**Sent to the Base API**

```json
{
  "name": "John Doe",
  "number": "XYZ123"
}
```

`referenceId` is not used in the expression, so it is not sent to the Base API.

# Example Response

**Base API response**

```json
{
  "result": {
    "field1": "value1",
    "field2": "value2",
    "field3": "value3"
  }
}
```

**Output Transformation**

```jsonata
{
  "outputA": result.field1,
  "outputB": result.field2
}
```

**Returned to you**

```json
{
  "outputA": "value1",
  "outputB": "value2"
}
```

`field3` is not used in the expression, so it is not returned.

**When to Use**

- Use **Input Transformation** when your system already sends requests in a fixed format and you don't want to change it to match the Base API.
- Use **Output Transformation** when your system expects a fixed response format, or needs only a few fields from a large Base API response.
- Use **both** to connect an existing integration to a Signzy API without changing any request or response handling on your side.

### Transformation API Example

```curl
curl -X POST https://<endpoint>/api/v3/studio/<id>/<base-api-id> \
  -H 'Authorization:<your-signzy-auth-key>' \
  -H 'Content-type:application/json' \
  -d '<Request body in your own format>'
```

![](https://api.archbee.com/api/optimize/w0YdjmC6Uxu0AJ6sPj9OT/zHslMpTb3v9Z_vvgaHTu4_image.png)

