# Rename or recolor a label

Source: https://docs.maylee.app/api-reference/labels/update-label

`PATCH https://api.maylee.app/api/v1/labels/{labelId}`

Scope: `write`.

Manual labels only: an AI label is renamed through its rule on `/ai-label-rules`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `labelId` | path | string | yes |  |

## Request body

`application/json`, required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `color` | string | no | Color name. The Maylee app renders `Pink`, `Blue`, `Red`, `Yellow`, `Green`, `Purple` and `Orange`; any other value is stored but shown without color. 1 to 30 characters. |
| `name` | string | no | Unique among all labels of the workspace, manual and AI. 1 to 50 characters. |

## Example request

```bash
curl -X PATCH "https://api.maylee.app/api/v1/labels/<labelId>" \
  -H "Authorization: Bearer $MAYLEE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "color": "Orange"
}'
```

## Responses

### 200

The updated label.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `label` | Label | yes |  |
| `label.color` | string | yes | Color name. The Maylee app renders `Pink`, `Blue`, `Red`, `Yellow`, `Green`, `Purple` and `Orange`; any other value is stored but shown without color. |
| `label.createdAt` | string (date-time) | yes |  |
| `label.id` | string | yes |  |
| `label.isAiLabel` | boolean | yes | True when the label is applied by the AI pipeline rather than a human. AI labels are managed through `/ai-label-rules`. |
| `label.name` | string | yes |  |

```json
{
  "label": {
    "color": "Green",
    "createdAt": "2026-06-02T09:20:00.000Z",
    "id": "cmtg1a2b3c4d5e6f7g8h9i0j",
    "isAiLabel": false,
    "name": "Quotes"
  }
}
```

### 400

Invalid or empty payload, or `INVALID_TAG` when the label is an AI label.

### 401

Missing, malformed, revoked or expired API key.

### 403

Key lacks the required scope, or outbound sending is not enabled on it.

### 404

Not found, or belongs to another workspace.

### 409

`DUPLICATE_TAG_NAME`: a label with this name already exists.

### 429

Per-minute rate limit (`RATE_LIMIT_EXCEEDED`) or monthly quota (`QUOTA_EXCEEDED`) exhausted.

Errors use the format `{ "code", "error", "details" }`: see [Errors](/errors.md).
