---
title: "Replace the set of labels applied to a dataset"
method: PUT
path: "/v1/datasets/{dataset_identifier}/labels"
tags: ["datasets"]
---

# Replace the set of labels applied to a dataset

`PUT /v1/datasets/{dataset_identifier}/labels`

Replace the entire set of labels applied to a dataset. Labels present in the request but not currently applied are added; labels currently applied but absent from the request are removed. An empty list removes all labels.

## Path parameters

- `dataset_identifier` string, required — The dataset identifier: either the dataset ID (GlobalID) or its name.

## Request body

- SetDatasetLabelsRequestBody
  - `dataset_label_ids` string[] — The complete set of dataset label GlobalIDs to apply to the dataset. Labels not in this list are removed from the dataset; an empty list removes all labels.

## Response `200`

Successful Response

- SetDatasetLabelsForDatasetResponseBody
  - `data` DatasetLabel[], required
    - `id` string, required
    - `name` string, required
    - `description` string, nullable, required
    - `color` string, required

## Other responses

- `403` — Forbidden
- `404` — Dataset or one or more dataset labels not found
- `422` — Invalid dataset identifier or request body

---

[API](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api.md) · [All operations](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/arize-ai/arize-phoenix-rest-api/versions/5339b2afd3a2/schema)
