# Create value set

`POST /v1/operations/valuesets`

Available as MCP tool `create-value-set` (Write).

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;

### Create value set

Create a value set for a specific environment within a Redox organization. You can specify up to 7,500 values in one value set. 

You can create a value set via API or the Redox dashboard ([create a value set in the dashboard](https://docs.redoxengine.com/permalink/57h6bja3T7Qy0Mf1ai7uMQ)).

This endpoint allows you to create one value 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 body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `environment` | object | Yes | Contains metadata about the Redox environment that you're operating in or on behalf of. |
| `environment.id` | string (uuid) | Yes | Contains the unique identifier of the Redox environment. |
| `organization` | object | Yes | Contains metadata about the Redox organization that you're operating in or on behalf of. |
| `organization.id` | number | Yes | Contains the unique identifier of the Redox organization. |
| `name` | string | Yes | Contains the human-readable name of the asset. |
| `values` | Array of object | Yes |  |
| `values[].id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `values[].value` | string | No | Contains the actual string value data. |

## Request example

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

```bash
curl 'https://api.redoxengine.com/platform/v1/operations/valuesets' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "environment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  },
  "organization": {
    "id": 122
  },
  "name": "string",
  "values": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "value": "5792-7"
    }
  ]
}'
```

## Responses

### 200

Contains a payload object with the created value 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 a value set. |
| `payload.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.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.name` | string | No | Contains the human-readable name of the asset. |
| `payload.environmentId` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.organizationId` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `payload.creatingUserId` | number | No | Contains the unique identifier of the user. |
| `payload.updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `payload.lastUpdatingUserId` | number | No | Contains the unique identifier of the user. |
| `payload.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.deletingUserId` | number, nullable | No | Contains the unique identifier of the user. |
| `payload.values` | Array of object | No |  |
| `payload.values[].id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.values[].value` | string | No | Contains the actual string value data. |
| `payload.promotionAssociations` | Array of object | No | Contains a list of promotions associated with this asset. |
| `payload.promotionAssociations[].organization` | object | No | Describes the Redox organization that the asset belongs to. |
| `payload.promotionAssociations[].organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.promotionAssociations[].organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.promotionAssociations[].fromAsset` | object | No | Describes the original asset that was created in staging and promoted to production. |
| `payload.promotionAssociations[].fromAsset.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.promotionAssociations[].fromAsset.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `payload.promotionAssociations[].fromAsset.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.promotionAssociations[].fromAsset.type` | string | No | Possible values: configModifier, filter, translationSet |
| `payload.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.promotionAssociations[].toAsset` | object | No | Describes the promoted asset that can be used or linked to subscriptions in production. |
| `payload.promotionAssociations[].toAsset.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.promotionAssociations[].toAsset.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `payload.promotionAssociations[].toAsset.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.promotionAssociations[].toAsset.type` | string | No | Possible values: configModifier, filter, translationSet |
| `payload.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.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.promotionAssociations[].createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `payload.promotionAssociations[].createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `payload.promotionAssociations[].createdBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.promotionAssociations[].createdBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.promotionAssociations[].updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `payload.promotionAssociations[].updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.promotionAssociations[].updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.promotionAssociations[].updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.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.promotionAssociations[].deletedBy` | object, nullable | No | Contains the metadata about the user who deleted the asset. |
| `payload.promotionAssociations[].deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.promotionAssociations[].deletedBy.name` | string, nullable | No | Displays the user's full name. |

_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",
    "version": 2,
    "name": "string",
    "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
    "organizationId": 122,
    "createdAt": "2024-04-25T18:17:16.719Z",
    "creatingUserId": 0,
    "updatedAt": "2024-04-25T18:17:16.719Z",
    "lastUpdatingUserId": 0,
    "deletedAt": "2024-04-25T18:17:16.719Z",
    "deletingUserId": 0,
    "values": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "value": "5792-7"
      }
    ],
    "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"
        }
      }
    ]
  }
}
```

### 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
    }
  }
}
```
