> ## Documentation Index
> Fetch the complete documentation index at: https://api.lancepilot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Label

> Update an existing label in the specified workspace.

### JSON Request Example

```json theme={null}
{
  "name": "Very Important",
  "color": "#00AA00"
}
```

***

### 📝 Field Requirements

| Field   | Type             | Required | Notes                                                 |
| ------- | ---------------- | -------- | ----------------------------------------------------- |
| `name`  | string (max 255) | Yes      | New label name (must be unique within the workspace). |
| `color` | string (max 7)   | No       | Hex color code (e.g., #00AA00). Optional.             |

***

### 💡 Notes

* The label name must remain unique within the workspace
* You can update just the name, just the color, or both fields
* Updating a label does not affect contacts already tagged with this label


## OpenAPI

````yaml PUT /workspaces/{workspace}/labels/{label}
openapi: 3.1.0
info:
  title: Lancepilot API
  description: API for Lancepilot
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://lancepilot.com/api/v3
security:
  - bearerAuth: []
paths:
  /workspaces/{workspace}/labels/{label}:
    put:
      tags:
        - Labels
      summary: Update Label
      description: Update an existing label in the specified workspace.
      parameters:
        - name: workspace
          in: path
          description: ID of the workspace.
          required: true
          schema:
            type: string
            format: uuid
        - name: label
          in: path
          description: ID of the label.
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: New label name (unique per workspace).
                color:
                  type: string
                  maxLength: 7
                  nullable: true
                  description: 'Hex color code (e.g., #FF5733). Optional.'
                  example: '#00AA00'
            examples:
              update:
                summary: Update Label
                value:
                  name: Very Important
                  color: '#00AA00'
      responses:
        '200':
          $ref: '#/components/responses/Update200'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
components:
  responses:
    '401':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthenticated.
            required:
              - message
    '404':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Resource not found.
              status:
                type: integer
                example: 404
            required:
              - message
              - status
    '422':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Validation error
              errors:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
    Update200:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 200
              message:
                type: string
                example: Resource updated successfully.
              data:
                type: object
                description: Updated resource data.
            required:
              - status
              - message
              - data
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````