# Create a Set of Values

Use the REST API to create a reusable set of values that can be assigned to a custom field. In the REST API, a set of values is represented by a bundle entity.

This use case creates an enum bundle. You can use the same pattern with other bundle types, such as [BuildBundle](api-entity-BuildBundle.html), [OwnedBundle](api-entity-OwnedBundle.html), [StateBundle](api-entity-StateBundle.html), and [VersionBundle](api-entity-VersionBundle.html).

For details about enum bundles, see [Enum Bundles](resource-api-admin-customFieldSettings-bundles-enum.html).

## Summary

To create a set of values, send a `POST` request to the bundle endpoint for the target field type:

```
/api/admin/customFieldSettings/bundles/enum?fields={fields}
```

## Step-by-Step

Procedure: To create an enum set of values

1. Prepare the request body with the name of the bundle and the values that you want to add to it.

```JSON
{
    "name": "Customer Impact",
    "values": [
        {"name": "Low", "$type": "EnumBundleElement"},
        {"name": "Medium", "$type": "EnumBundleElement"},
        {"name": "High", "$type": "EnumBundleElement"}
    ],
    "$type": "EnumBundle"
}
```

2. Create the enum bundle with a `POST` request.

```CURL
curl -X POST 'https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/enum?fields=id,name,values(id,name)' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Content-Type: application/json' \
-d '{
    "name": "Customer Impact",
    "values": [
        {"name": "Low", "$type": "EnumBundleElement"},
        {"name": "Medium", "$type": "EnumBundleElement"},
        {"name": "High", "$type": "EnumBundleElement"}
    ],
    "$type": "EnumBundle"
}'
```

3. Check the response body. If the request is successful, the response contains the created bundle.

```JSON
{
    "values": [
        {
            "name": "Low",
            "id": "67-12",
            "$type": "EnumBundleElement"
        },
        {
            "name": "Medium",
            "id": "67-13",
            "$type": "EnumBundleElement"
        },
        {
            "name": "High",
            "id": "67-14",
            "$type": "EnumBundleElement"
        }
    ],
    "name": "Customer Impact",
    "id": "86-10",
    "$type": "EnumBundle"
}
```

As a result, you have created an enum bundle that can be referenced by REST API requests. The bundle is not available in issues until you assign it to a project custom field.

To create an enum custom field with this set of values and add it to a project, see [Create an Enum Custom Field and Add It to a Project](api-usecase-create-enum-custom-field.html). To replace the set of values for an existing project custom field, see [Replace the Set of Values for a Custom Field](api-usecase-replace-field-bundle.html).

