---
title: "Create generatorTemplate"
method: POST
path: "/generatorTemplates"
tags: ["generatorTemplates"]
---

# Create generatorTemplate

`POST /generatorTemplates`

Create a new generatorTemplate and makes the creator the writer of the generatorTemplate.

## Request body

- object — A generatorTemplate configuration object.
  - `description` string — A description of the generatorTemplate.
  - `helpEmail` string — The email address where a user can go to get more help about the generatorTemplate.
  - `helpUrl` string — The url where a user can go to get more help about the generatorTemplate.
  - `name` string, required — The generatorTemplate's name.
  - `version` string, required — The version, in semantic versioning format ( MAJOR.MINOR.PATCH )
  - `tags` string[] — Array of tag names. Tag name: Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-). Tag names cannot start with a dash (-).
  - `author` object, required — The author of this generatorTemplate.
  - `repository` object — The repository where this generatorTemplate is located.
  - `connection` object, required — Information about the connection.
  - `contextDefinition` object — Variables available to connection.url, connection.toUrl, and the transform function.
  - `transform` object, required — The body of a javascript function which transforms some data into an array of samples
  - `isPublished` boolean — Default false. When set to true, the generatorTemplate is available to all users.
  - `owner` string — The name of the user to assign as the owner. Defaults to the user that created it

## Response `201`

Created.

- GeneratorTemplateResponse — The transform logic and the definition of what additional context data is required.
  - `description` string — A description of the generatorTemplate.
  - `helpEmail` string — The email address where a user can go to get more help about the generatorTemplate.
  - `helpUrl` string — The url where a user can go to get more help about the generatorTemplate.
  - `name` string — The generatorTemplate's name.
  - `version` string — The version, in semantic versioning format ( MAJOR.MINOR.PATCH )
  - `tags` string[] — Array of tag names. Tag name: Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-). Tag names cannot start with a dash (-).
  - `author` object — The author of this generatorTemplate.
  - `repository` object — The repository where this generatorTemplate is located.
  - `connection` object — Information about the connection.
  - `contextDefinition` object — Variables available to connection.url, connection.toUrl, and the transform function.
  - `transform` object — The body of a javascript function which transforms some data into an array of samples
  - `isPublished` boolean — Default false. When set to true, the generatorTemplate is available to all users.
  - `id` string — The generatorTemplate id.
  - `createdBy` string — Id of the User who created this generatorTemplate.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `default` — Error

---

[API](https://skmtc.net/salesforce/apis/refocus-api.md) · [All operations](https://skmtc.net/salesforce/apis/refocus-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/salesforce/refocus-api/versions/42c2153b047e/schema)
