# Archive a Value in a Set

Use the REST API to archive a value in a set of values for a custom field. In the REST API, a set of values for a custom field is represented by a bundle entity.

This use case archives a value in an enum bundle. You can use the same pattern with other bundle element types that support the `archived` attribute, such as [BuildBundleElement](api-entity-BuildBundleElement.html), [OwnedBundleElement](api-entity-OwnedBundleElement.html), [StateBundleElement](api-entity-StateBundleElement.html), and [VersionBundleElement](api-entity-VersionBundleElement.html).

> **Note:**
> Archiving a value updates the shared bundle. This can affect every custom field that uses this bundle.

## Summary

When you have the required IDs, update the value by sending a `POST` request to this endpoint:

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

## Step-by-Step

Procedure: To archive an enum value in a set

1. Get the list of enum bundles and their values. See [Enum Bundles](resource-api-admin-customFieldSettings-bundles-enum.html).

```CURL
curl -X GET 'https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/enum?fields=id,name,values(id,name,archived)' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Content-Type: application/json'
```

In the response, locate the bundle and value that you want to archive. This example uses the `Priorities` bundle with the entity ID `86-125` and the `Minor` value with the entity ID `67-5`.

```JSON
[
    {
        "values": [
            {
                "name": "Major",
                "archived": false,
                "id": "67-2",
                "$type": "EnumBundleElement"
            },
            {
                "name": "Normal",
                "archived": false,
                "id": "67-3",
                "$type": "EnumBundleElement"
            },
            {
                "name": "Minor",
                "archived": false,
                "id": "67-5",
                "$type": "EnumBundleElement"
            }
        ],
        "name": "Priorities",
        "id": "86-125",
        "$type": "EnumBundle"
    }
]
```

2. Archive the value by setting its `archived` attribute to `true`.

```CURL
curl -X POST 'https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/enum/86-125/values/67-5?fields=id,name,archived' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Content-Type: application/json' \
-d '{"archived": true}'
```

If the request is successful, the response contains the archived value.

```JSON
{
    "name": "Minor",
    "archived": true,
    "id": "67-5",
    "$type": "EnumBundleElement"
}
```

3. Optional. Check the value in the bundle.

```CURL
curl -X GET 'https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/enum/86-125?fields=id,name,values(id,name,archived)' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Content-Type: application/json'
```

The archived value is listed with the `archived` attribute set to `true`.

As a result, the value is archived in the set of values.

