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

# Tags

> List, create, update, delete, and merge article tags.

A tag is a label you attach to articles. For fields and response details, see the [API reference](https://apidocs.neetokb.com/api/tags/list.md).

## List tags

This command lists tags with the number of articles that use each one. Use this to find a tag ID before you update, delete, or merge it.

```bash theme={"system"}
neetokb tags list
neetokb tags list --search-term bill
neetokb tags list --sort-by articles_count
```

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--order-by` | `string` | | | Sort order: asc or desc |
| `--page` | `int` | | `0` | Page number |
| `--page-size` | `int` | | `0` | Items per page (max 100) |
| `--search-term` | `string` | | | Show tags whose name contains this text |
| `--sort-by` | `string` | | | Sort field: name or articles\_count |

`--sort-by` takes `name` or `articles_count`. `--order-by` takes `asc` or `desc`. It defaults to `asc` for `name` and `desc` for `articles_count`.

## Create a tag

This command creates a tag. Tag names are unique in the workspace, ignoring case. Creating a tag needs the Manage tags permission.

```bash theme={"system"}
neetokb tags create --name Billing --style info
```

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--description` | `string` | | | Tag description |
| `--name` | `string` | Yes | | Tag name, unique ignoring case |
| `--style` | `string` | | | Tag colour: primary, secondary, info, success, warning or danger |

`--style` takes `primary`, `secondary`, `info`, `success`, `warning` or `danger`. It defaults to `secondary`.

## Update a tag

This command changes the name, description or style of a tag. Only the flags you pass change.

```bash theme={"system"}
neetokb tags update 7c1d9a52-3b8e-4f60-a2d4-91e5c0b7f318 --name "Payments"
```

**Required arguments:**

* `<id>` - Tag ID from `tags list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--description` | `string` | | | Tag description |
| `--name` | `string` | | | Tag name, unique ignoring case |
| `--style` | `string` | | | Tag colour: primary, secondary, info, success, warning or danger |

## Delete a tag

This command deletes a tag and removes it from every article. The articles are kept.

```bash theme={"system"}
neetokb tags delete 7c1d9a52-3b8e-4f60-a2d4-91e5c0b7f318
```

**Required arguments:**

* `<id>` - Tag ID from `tags list`

## Merge tags

This command merges tags into one. Articles that carry a secondary tag get the primary tag. The secondary tags are then deleted. Use this to clean up near-duplicate tags.

```bash theme={"system"}
neetokb tags merge \
  --primary-id 7c1d9a52-3b8e-4f60-a2d4-91e5c0b7f318 \
  --secondary-ids 0e4b6f81-5a2c-4d97-8c13-b6a7d2e90f45,3f8a1c64-9d0b-4e72-b5a1-c8e6d4f27a09
```

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--primary-id` | `string` | Yes | | ID of the tag that survives |
| `--secondary-ids` | `string` | Yes | | IDs of the tags merged into the primary tag and deleted (comma-separated) |

If any tag is unknown, nothing is merged. The primary tag cannot be in `--secondary-ids`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.