---
title: "Update generator (partial)"
method: PATCH
path: "/generators/{key}"
tags: ["generators"]
---

# Update generator (partial)

`PATCH /generators/{key}`

Update the specified generator. Requires user to have write permision. If a field is not included in the query body, that field will not be updated.

## Path parameters

- `key` string, required

## Request body

- object — A generator configration object.
  - `description` string — A description of the generator.
  - `helpEmail` string — The email address where a user can go to get more help about the generator.
  - `helpUrl` string — The url where a user can go to get more help about the generator.
  - `intervalSecs` integer — Interval (seconds) between each collection.
  - `name` string — The generator's name.
  - `subjectQuery` string — The query to append to GET subjects. Only "absolutePath", "name", "tags" are allowed in subjectQuery.
  - `aspects` string[] — Names of the aspects.
  - `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 (-).
  - `connection` object — Information about the connection.
  - `context` object — Variables accessible inside the transform function.
  - `collectorGroup` string — Name of set of collectors this Sample Generator should try to use.
  - `isActive` boolean — Default false. When set to true, the generator will be assigned to a running collector and regularly send in samples.
  - `generatorTemplate` object — Details of Generator Template.
    - `name` string — The Generator Template's name.
    - `version` string — A Generator Template version number (MAJOR.MINOR.PATCH) or a valid x-range, tilde range or caret range. Any of X, x, or * may be used to "stand in" for one of the numeric major, minor or patch values. A tilde range allows patch-level changes if a minor version is specified on the comparator, or allows minor-level changes if not. A caret range allows changes that do not modify the left-most non-zero major, minor or patch number. See https://github.com/npm/node-semver for more details on semver matching.
  - `owner` string — The name of the user to assign as the owner. Defaults to the user that created it

## Response `200`

Success, returns the updated generator.

- GeneratorResponse — The designation of which subjects and aspects to collect, plus any additional context data
  - `description` string — A description of the generator.
  - `helpEmail` string — The email address where a user can go to get more help about the generator.
  - `helpUrl` string — The url where a user can go to get more help about the generator.
  - `createdBy` string — Id of the User who created this Generator.
  - `id` string — The collector id.
  - `intervalSecs` integer — Interval (seconds) between each collection.
  - `isActive` boolean — Default false. When set to true, the generator will be assigned to a running collector and regularly send in samples.
  - `name` string — The generator's name.
  - `subjectQuery` string — The query to append to GET subjects. Only "absolutePath", "name", "tags" are allowed in subjectQuery.
  - `collectorGroup` object — Specifies set of collectors this Sample Generator should try to use.
  - `aspects` string[] — Names of the aspects.
  - `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 (-).
  - `connection` object — Information about the connection.
  - `context` object — Variables accessible inside the transform function.
  - `currentCollector` object — Current collector assigned to the generator.
  - `generatorTemplate` 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
- `404` — Resource Not Found
- `default` — Error

---

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