# createLabels

Mutation

Create labels in the workspace creator label taxonomy; a name already present (ignoring case and surrounding whitespace) is returned unchanged.

Available to agents as MCP tool `createLabels` — see [Write tools](/api/v2/docs/mcp/write-tools#create-labels).

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `labelNames` | `[String!]!` | Yes | — | Label names to create. At least 1 and at most 50, each at most 100 characters. Matching ignores case and surrounding whitespace, so a name that already exists is returned with its stored spelling and nothing is created. |

## Returns

| Name | Type | Description |
| --- | --- | --- |
| `labels` | [`[Label!]!`](/api/v2/docs/types/label) | The stored spelling of every submitted name, in submission order. Names that differ only by case or surrounding whitespace collapse to one entry. Empty when userErrors is non-empty. |
| `userErrors` | [`[UserError!]!`](/api/v2/docs/types/user-error) | Errors that refused the whole request: an empty or oversized list, a blank or over-long name, or a label being deleted. Empty on success. |

## Examples

### Create labels

Create labels by name; a name the workspace already carries is returned with its stored spelling.

```graphql
mutation CreateLabelsDefault($labelNames: [String!]!) {
  createLabels(labelNames: $labelNames) {
    labels {
      name
      deleting
    }
    userErrors {
      field
      message
    }
  }
}
```

Variables:

```json
{
  "labelNames": [
    "Holiday 2025",
    "vip"
  ]
}
```

Response — HTTP 200:

```json
{
  "data": {
    "createLabels": {
      "labels": [
        {
          "name": "Holiday 2025",
          "deleting": false
        },
        {
          "name": "VIP",
          "deleting": false
        }
      ],
      "userErrors": []
    }
  }
}
```
