> ## Documentation Index
> Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Apply a label to a dataset

> Apply an existing label to a dataset. This operation is idempotent: applying a label that is already applied is a no-op that returns the label.



## OpenAPI

````yaml put /v1/datasets/{dataset_identifier}/labels/{label_id}
openapi: 3.1.0
info:
  title: Arize-Phoenix REST API
  description: Schema for Arize-Phoenix REST API
  version: '1.0'
servers: []
security: []
paths:
  /v1/datasets/{dataset_identifier}/labels/{label_id}:
    put:
      tags:
        - datasets
      summary: Apply a label to a dataset
      description: >-
        Apply an existing label to a dataset. This operation is idempotent:
        applying a label that is already applied is a no-op that returns the
        label.
      operationId: addDatasetLabelToDataset
      parameters:
        - name: dataset_identifier
          in: path
          required: true
          schema:
            type: string
            description: >-
              The dataset identifier: either the dataset ID (GlobalID) or its
              name.
            title: Dataset Identifier
          description: >-
            The dataset identifier: either the dataset ID (GlobalID) or its
            name.
        - name: label_id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the dataset label to apply
            title: Label Id
          description: The ID of the dataset label to apply
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDatasetLabelToDatasetResponseBody'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                type: string
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Dataset or dataset label not found
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: Invalid dataset identifier or dataset label ID
components:
  schemas:
    AddDatasetLabelToDatasetResponseBody:
      properties:
        data:
          $ref: '#/components/schemas/DatasetLabel'
      type: object
      required:
        - data
      title: AddDatasetLabelToDatasetResponseBody
    DatasetLabel:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        color:
          type: string
          title: Color
      type: object
      required:
        - id
        - name
        - description
        - color
      title: DatasetLabel

````