# Update translation set

`PATCH /v1/operations/translationsets/{translationSetId}`

Available as MCP tool `update-translation-set` (Replace).

Translation set endpoints allow you to review and manage value sets, translation sets, and related translation set links. 

A <u>value set</u> is a list of values (e.g., LOINC, SNOMED, or a custom code set) that should be translated during the process of data exchange. [Learn about value sets](https://docs.redoxengine.com/permalink/57h6bja3T7Qy0Mf1ai7uMQ).

A <u>translation set</u> contains two value sets: one for incoming values and one for outgoing values between systems. A translation set also defines how those values should map to each other. [Learn about translation sets](https://docs.redoxengine.com/permalink/4GJXunyoAI3s05VrrRkJ09). 

A <u>translation set link</u> defines where the translation set should be applied in log processing for a specific subscription.

Anyone in a Redox organization can view translation sets and related value sets or links, but you must be assigned to an engineer or support role to update or delete them.

You can:

- retrieve a list of value sets by environment or organization;
- retrieve a list of translation sets by environment or organization;
- create, update, or delete value sets;
- create, update, or delete translation sets or links;
- create, update, or delete a value in a value set; or
- create or delete a translation in a translation set;

### Update translation set

Update a translation set by either adding new mappings or changing or deleting existing mappings. It may be helpful to use the `Get translation set` endpoint first to review current mappings before updating. 

Whether adding, updating, or deleting mappings, the `translations` array in the request body should include _all_ current mappings with their respective `fromValueId` and `toValueId`. Then: 

- To add mappings, add entries for new mappings with both their `fromValueId` and `toValueId` properties specified. 
- To update existing mappings, include both the `fromValueId` and `toValueId,` whether you want to retain the value as-is or change it to the new value.  
- To delete values, exclude the current mapping from the `translations` array altogether. 

This endpoint allows you to update one translation set at a time.

> **Only for engineer or support roles**
>
> Any user may view existing data operations (e.g., filters, translation sets, config modifiers) for subscriptions in a given environment. However, you must be assigned to an engineer or a support role to create and manage data operations. [Learn about roles](/basics/managing-access-for-your-redox-organization/what-are-user-roles-and-groups).

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `translationSetId` | path | string | Yes | Contains the unique identifier for the translation set. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | Contains the human-readable name of the asset. |
| `fromValueSetId` | string (uuid) | No | Identifies the value set you to translate FROM. |
| `toValueSetId` | string (uuid) | No | Identifies the value set you want to translate TO. |
| `translations` | Array of object | No | Contains the list of mapped value pairs by their respective unique identifiers. |
| `translations[].toValueId` | string (uuid) | No | Specifies the unique identifier of a value in the TO value set. |
| `translations[].fromValueId` | string (uuid) | No | Specifies the unique identifier of a value in the FROM value set. |
| `isCaseSensitive` | boolean | No | Indicates if the translation set is case sensitive or not. |

## Request example

_Generated from the schema: the values are placeholders, not a real payload._

```bash
curl 'https://api.redoxengine.com/platform/v1/operations/translationsets/{translationSetId}' \
--request PATCH \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "name": "string",
  "fromValueSetId": "76844187-ad05-41ea-a530-4e46b8701250",
  "toValueSetId": "462a3a3c-7aa0-4f81-bdb7-9daf9a8a7f2b",
  "translations": [
    {
      "toValueId": "3f954e50-cf5a-47c2-bf36-b9b4c78e515f",
      "fromValueId": "d27ff859-f1ef-4d7d-be2b-6ac0f43abb0c"
    }
  ],
  "isCaseSensitive": true
}'
```

## Responses

### 200

Contains a payload object with the updated translation set.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `meta` | object | No |  |
| `meta.version` | string | No | Lists the major and minor version number for the format of the returned payload. The payload format or shape may change between minor versions, like including additional or extended fields in later versions. We include the version data in each response so that you have the option to handle the signaled differences. |
| `payload` | object | No | Contains details about the updated translation set. |
| `payload.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet` | object | No |  |
| `payload.translationSet.createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `payload.translationSet.createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `payload.translationSet.createdBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.createdBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `payload.translationSet.updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.translationSet.updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.deletedAt` | string, nullable | No | Displays the date and time that the asset was deleted. Returns a `null` value if the asset hasn't been deleted. |
| `payload.translationSet.deletedBy` | object, nullable | No | Contains the metadata about the user who deleted the asset. |
| `payload.translationSet.deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.deletedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `payload.translationSet.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.translationSet.organization` | object | No | Describes the Redox organization that the asset belongs to. |
| `payload.translationSet.organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.translationSet.organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.translationSet.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet.version` | number | No | Contains the numeric version of the asset. Version numbers start at 1 and increment in whole numbers whenever the asset is updated. |
| `payload.translationSet.name` | string | No | Contains the human-readable name of the asset. |
| `payload.translationSet.toValueSet` | object | No | Contains details about a value set. |
| `payload.translationSet.toValueSet.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet.toValueSet.name` | string | No | Contains the human-readable name of the asset. |
| `payload.translationSet.fromValueSet` | object | No | Contains details about a value set. |
| `payload.translationSet.fromValueSet.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet.fromValueSet.name` | string | No | Contains the human-readable name of the asset. |
| `payload.translationSet.isCaseSensitive` | boolean | No | Indicates if the translation set is case sensitive or not. |
| `payload.translationSet.usage` | Array of object | No | Lists the translation set's subscription links. Each `linkId` identifies an individual subscription link. |
| `payload.translationSet.usage[].linkId` | string (uuid) | No | Contains the unique identifier of the link for a specified asset. |
| `payload.translationSet.usage[].dataModel` | string | No | Specifies the Redox data model that the link applies to or should apply to. |
| `payload.translationSet.usage[].destination` | object | No | Specifies the destination of the subscription that an asset is or should be linked to. |
| `payload.translationSet.usage[].destination.id` | string (uuid) | Yes | Contains the unique identifier of the destination. |
| `payload.translationSet.usage[].direction` | string | No | Indicates the direction in which the translation set is or should be linked. This can be either `from-to` (translates a "from" value into a "to" value), or `to-from` (tranlates a "to" value into a "from" value). Possible values: from-to, to-from |
| `payload.translationSet.usage[].organization` | object | No | Describes the Redox organization that the asset belongs to. |
| `payload.translationSet.usage[].organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.translationSet.usage[].organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.translationSet.usage[].connectingOrganization` | object | No | Specifies the organization at the other side of the subscription that an asset is or should be linked to. |
| `payload.translationSet.usage[].connectingOrganization.id` | number | Yes | Contains the unique identifier of the Redox organization. |
| `payload.translationSet.usage[].paths` | Array of object | No | Lists the field paths linked to a translation set. These paths must be unique on the path property. |
| `payload.translationSet.usage[].paths[].dataType` | string | No | Describes the format of the data found at the path location. |
| `payload.translationSet.usage[].paths[].title` | string | No | Specifies a human-readable title for the field path. |
| `payload.translationSet.usage[].paths[].path` | string | No | Specifies the path in a message to the location of the data to be translated. The path must always start with a $ to be considered valid. |
| `payload.translationSet.usage[].processingLocation` | string | No | Identifies where a link will be applied during log processing. There are up to four stages that an asset can be linked to, depending on whether you own either the source, the destination, or both. Possible values: source-request, destination-request, source-response, destination-response |
| `payload.translationSet.usage[].source` | object | No | Specifies the source of the subscription that an asset is or should be linked to. |
| `payload.translationSet.usage[].source.id` | string (uuid) | Yes | Contains the unique identifier of the source. |
| `payload.translationSet.usage[].version` | string | No | Specifies the version of the translation set link. Right now this will always be '1.0.0'. Value: 1.0.0 |
| `payload.translationSet.usage[].createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `payload.translationSet.usage[].createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `payload.translationSet.usage[].createdBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.usage[].createdBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.usage[].updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `payload.translationSet.usage[].updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.translationSet.usage[].updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.usage[].updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.usage[].deletedAt` | string, nullable | No | Displays the date and time that the asset was deleted. Returns a `null` value if the asset hasn't been deleted. |
| `payload.translationSet.usage[].deletedBy` | object, nullable | No | Contains the metadata about the user who deleted the asset. |
| `payload.translationSet.usage[].deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.usage[].deletedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.promotionAssociations` | Array of object | No | Contains a list of promotions associated with this asset. |
| `payload.translationSet.promotionAssociations[].organization` | object | No | Describes the Redox organization that the asset belongs to. |
| `payload.translationSet.promotionAssociations[].organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.translationSet.promotionAssociations[].organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.translationSet.promotionAssociations[].fromAsset` | object | No | Describes the original asset that was created in staging and promoted to production. |
| `payload.translationSet.promotionAssociations[].fromAsset.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet.promotionAssociations[].fromAsset.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `payload.translationSet.promotionAssociations[].fromAsset.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.translationSet.promotionAssociations[].fromAsset.type` | string | No | Possible values: configModifier, filter, translationSet |
| `payload.translationSet.promotionAssociations[].fromAsset.latestVersion` | number | No | Displays the most recent version of the original asset in staging. This may vary from the version number in production. A different version number may indicate you need to re-promote the asset to production. |
| `payload.translationSet.promotionAssociations[].toAsset` | object | No | Describes the promoted asset that can be used or linked to subscriptions in production. |
| `payload.translationSet.promotionAssociations[].toAsset.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet.promotionAssociations[].toAsset.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `payload.translationSet.promotionAssociations[].toAsset.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.translationSet.promotionAssociations[].toAsset.type` | string | No | Possible values: configModifier, filter, translationSet |
| `payload.translationSet.promotionAssociations[].toAsset.latestVersion` | number | No | Displays the most recent version of the promoted asset in production. This may vary from the version number in staging. A different version number may indicate you need to re-promote the staging asset to production. |
| `payload.translationSet.promotionAssociations[].toAsset.outOfDate` | boolean | No | Indicates whether the version of the promoted asset in production is different from the version of the original asset in staging. |
| `payload.translationSet.promotionAssociations[].createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `payload.translationSet.promotionAssociations[].createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `payload.translationSet.promotionAssociations[].createdBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.promotionAssociations[].createdBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.promotionAssociations[].updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `payload.translationSet.promotionAssociations[].updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.translationSet.promotionAssociations[].updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.promotionAssociations[].updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.promotionAssociations[].deletedAt` | string, nullable | No | Displays the date and time that the asset was deleted. Returns a `null` value if the asset hasn't been deleted. |
| `payload.translationSet.promotionAssociations[].deletedBy` | object, nullable | No | Contains the metadata about the user who deleted the asset. |
| `payload.translationSet.promotionAssociations[].deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.promotionAssociations[].deletedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.translations` | Array of object | No | Contains the values which will be mapped FROM and TO. |
| `payload.translationSet.translations[].id` | string (uuid) | No | Contains the unique identifier for the translation. |
| `payload.translationSet.translations[].fromValue` | object | No | Details about the value being mapped FROM. |
| `payload.translationSet.translations[].fromValue.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet.translations[].fromValue.value` | string | No | Contains the actual string value data. |
| `payload.translationSet.translations[].toValue` | object | No | Details about the value being mapped TO. |
| `payload.translationSet.translations[].toValue.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.translationSet.translations[].toValue.value` | string | No | Contains the actual string value data. |
| `payload.translationSet.previousVersions` | Array of object, nullable | No |  |
| `payload.translationSet.previousVersions[].version` | number | No | Contains the numeric version of the asset. Version numbers start at 1 and increment in whole numbers whenever the asset is updated. |
| `payload.translationSet.previousVersions[].updatedAt` | string | No | Displays the date and time that the asset was last updated. |
| `payload.translationSet.previousVersions[].updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.translationSet.previousVersions[].updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.previousVersions[].updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.previousVersions[].updatedBy.email` | string, nullable | No | Displays the user's email address. |
| `payload.translationSet.previousVersions[].deletedAt` | string, nullable | No | Displays the date and time that the asset was deleted. Returns a `null` value if the asset hasn't been deleted. |
| `payload.translationSet.previousVersions[].deletedBy` | object, nullable | No | Displays the user that deleted the asset. Returns a `null` value if the asset hasn't been deleted. |
| `payload.translationSet.previousVersions[].deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.translationSet.previousVersions[].deletedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.translationSet.previousVersions[].deletedBy.email` | string, nullable | No | Displays the user's email address. |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "translationSet": {
      "createdAt": "2024-04-25T18:17:16.719Z",
      "createdBy": {
        "id": 0,
        "name": "string"
      },
      "updatedAt": "2024-04-25T18:17:16.719Z",
      "updatedBy": {
        "id": 0,
        "name": "string"
      },
      "deletedAt": "2024-04-25T18:17:16.719Z",
      "deletedBy": {
        "id": 0,
        "name": "string"
      },
      "environment": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      },
      "organization": {
        "id": 122,
        "name": "string"
      },
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "version": 2,
      "name": "string",
      "toValueSet": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "string"
      },
      "fromValueSet": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "string"
      },
      "isCaseSensitive": true,
      "usage": [
        {
          "linkId": "009f739c-6620-43b0-978e-b245e723c57a",
          "dataModel": "PatientAdmin",
          "destination": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          },
          "direction": "to-from",
          "organization": {
            "id": 122,
            "name": "string"
          },
          "connectingOrganization": {
            "id": 122
          },
          "paths": [
            {
              "dataType": "string",
              "title": "Custom Path",
              "path": "$.Allergies[*].Type.Code"
            }
          ],
          "processingLocation": "source-request",
          "source": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          },
          "version": "1.0.0",
          "createdAt": "2024-04-25T18:17:16.719Z",
          "createdBy": {
            "id": 0,
            "name": "string"
          },
          "updatedAt": "2024-04-25T18:17:16.719Z",
          "updatedBy": {
            "id": 0,
            "name": "string"
          },
          "deletedAt": "2024-04-25T18:17:16.719Z",
          "deletedBy": {
            "id": 0,
            "name": "string"
          }
        }
      ],
      "promotionAssociations": [
        {
          "organization": {
            "id": 122,
            "name": "string"
          },
          "fromAsset": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "environment": {
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            },
            "type": "configModifier",
            "latestVersion": 0
          },
          "toAsset": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "environment": {
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            },
            "type": "configModifier",
            "latestVersion": 0,
            "outOfDate": true
          },
          "createdAt": "2024-04-25T18:17:16.719Z",
          "createdBy": {
            "id": 0,
            "name": "string"
          },
          "updatedAt": "2024-04-25T18:17:16.719Z",
          "updatedBy": {
            "id": 0,
            "name": "string"
          },
          "deletedAt": "2024-04-25T18:17:16.719Z",
          "deletedBy": {
            "id": 0,
            "name": "string"
          }
        }
      ],
      "translations": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "fromValue": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "value": "5792-7"
          },
          "toValue": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "value": "5792-7"
          }
        }
      ],
      "previousVersions": [
        {
          "version": 2,
          "updatedAt": "string",
          "updatedBy": {
            "id": 0,
            "name": "string",
            "email": "string"
          },
          "deletedAt": "string",
          "deletedBy": {
            "id": 0,
            "name": "string",
            "email": "string"
          }
        }
      ]
    }
  }
}
```

### 400

Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.id` | string | No | Contains a unique identifier for the given error instance. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Bad Request`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Bad Request",
      "code": "validation.error.bad.request",
      "detail": "Error details",
      "status": 400,
      "transient": false
    }
  }
}
```

### 403

Forbidden

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.errors` | Array of object | No |  |
| `payload.errors[].title` | string | No | Displays the high-level error message, typically something succinct like `Forbidden`. |
| `payload.errors[].code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |

```json
{
  "payload": {
    "errors": [
      {
        "title": "Forbidden",
        "code": "authorization.forbidden"
      }
    ]
  }
}
```

### 500

Internal Server Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Failed in step X`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Internal Server Error",
      "code": "failed.db.lookup",
      "detail": "Error details",
      "status": 500,
      "transient": true
    }
  }
}
```
