---
title: "Create a Reusable Record Transform"
method: POST
path: "/transforms"
tags: ["Transforms"]
---

# Create a Reusable Record Transform

`POST /transforms`

## Request

- Base URL: `https://dataops.nexla.io/nexla-api`
- URL: `https://dataops.nexla.io/nexla-api/transforms`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/nexla/apis/nexla-rest-api/docs/transforms/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new reusable record transform.

## Request body

- TransformMutable
  - `name` string, required
  - `description` string
  - `output_type` 'record', required: Type of code container. This must be set to `record` to signify that this code container is to be used to convert an input record of a Nexset into an output record for that Nexset.
  - `reusable` boolean, required: Whether or not this transform can be referenced by multiple Nexsets. This should always be `true` for reusable record transforms.
  - `code_type` 'jolt_custom' | 'jolt_standard', required: Type of code in the `code` block. Use `jolt_custom` if the code in the code block is a `python`, `python3` or `javascript` transform code block wrapped inside a Jolt operation block.
  - `code_encoding` 'none', required: Whether or not the code in the `code` block is encoded. Set this to `none` for reusable record transforms.
  - `code` union, required: Code to be executed for transforming records. If you wish to execute a Python or Javascript code snippet during transformation, you'll need to `base64`-encode that code snippet and wrap it inside the following Jolt operation object. For example, if you want to execute this Python code as a reusable record transform ```python def transform(input, metadata, args): # Sample python transform to pass all attributes through return input ``` the corresponding `code` object would be ```json [ { "operation": "nexla.custom", "spec": { "language": "python", "encoding": "base64", "script": "ZGVmIHRyYW5zZm9ybShpbnB1dCwgbWV0YWRhdGEsIGFyZ3MpOgogICMgU2FtcGxlIHB5dGhvbiB0cmFuc2Zvcm0gdG8gcGFzcyBhbGwgYXR0cmlidXRlcyB0aHJvdWdoCiAgcmV0dXJuIGlucHV0" } } ] ```
    - object[]
      - `operation` 'nexla.custom': Jolt operation for this code block. For `python`, `python3` and `javascript`, it must be `nexla.custom`.
      - `spec` object: Jolt specification for this block. See the Python example above for sample specs.
        - `language` 'python' | 'python3' | 'javascript': Code language of the encoded script.
        - `encoding` 'base64': Python or Javascript code snippets must always be Base64-encoded.
        - `script` string: Base64-encoded Python or Javascript code snippet that must be executed for transforming records.
    - object[]
  - `custom_config` object: Configuration block useful for converting code into Nexla UI's Nexset Designer Rule blocks. This should not be sent in the payload unless the transform is being created using the Nexla UI's Nexset Designer screen.
  - `tags` string[]

## Response `200`

Success

- Transform
  - `id` integer
  - `name` string
  - `resource_type` 'transform'
  - `reusable` boolean
  - `owner` UserSimplified
    - `id` integer
    - `full_name` string
    - `email` string
    - `email_verified_at` string, date-time
  - `org` OrgSimplified
    - `id` integer
    - `name` string
    - `email_domain` string
    - `email` string
    - `client_identifier` string
    - `org_webhook_host` string
  - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
  - `data_credentials` object
    - `id` integer
    - `name` string
    - `description` string
    - `updated_at` string, date-time
    - `created_at` string, date-time
  - `runtime_data_credentials` object
    - `id` integer
    - `name` string
    - `description` string
    - `updated_at` string, date-time
    - `created_at` string, date-time
  - `description` string
  - `code_type` 'jolt_standard' | 'jolt_custom'
  - `output_type` 'record'
  - `code_config` object
  - `custom_config` object
  - `code_encoding` string
  - `code` object[]
  - `managed` boolean
  - `data_sets` integer[]
  - `copied_from_id` integer
  - `updated_at` string, date-time
  - `created_at` string, date-time
  - `tags` string[]

## Other responses

- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/nexla/apis/nexla-rest-api.md) - [All operations](https://skmtc.dev/nexla/apis/nexla-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nexla/apis/nexla-rest-api/revisions/ef02be92fe7b?raw)
