> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/tags.md).

# tags

Short, shareable labels that mark resources (flows, errors, integrations) so teams can filter and triage them consistently.

**REST API**: [Tags](https://developer.celigo.com/api/api-reference/monitoring/tags). Tag references appear on other resources (notifications, flow errors) via the `tagIds` field.

**OpenAPI spec**: `dist/tag.yml` in `@celigo/api-specs` — see [OpenAPI specs](https://developer.celigo.com/api/using-the-api/openapi-specs)

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

## Subcommands

| Command                         | Purpose                                                                  |
| ------------------------------- | ------------------------------------------------------------------------ |
| [`list`](#celigo-tags-list)     | List every tag on the account.                                           |
| [`get`](#celigo-tags-get)       | Fetch one tag by id.                                                     |
| [`create`](#celigo-tags-create) | Create a new tag from a JSON body (`--file <path>` or stdin).            |
| [`update`](#celigo-tags-update) | Full-replace PUT from a JSON body (`--file <path>` or stdin).            |
| [`set`](#celigo-tags-set)       | Patch fields with `key=value` assignments. Supports `key=file://<path>`. |
| [`delete`](#celigo-tags-delete) | Delete a tag.                                                            |

## celigo tags list

List every tag. Columns: `_id`, `tag`, `tagId`. Since celigo-cli 2026.10.1 the table has no `lastModified` column, which tags do not carry.

In celigo-cli 2026.8.1 through 2026.8.8 the default `list` failed with `422 Unprocessable Entity` because the endpoint rejects the `include` projection, and only `--fields all` worked; since 2026.9.1 the default form works again (rows are trimmed client-side to the same columns).

| Flag              | Description                                                                                                                                                                                                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--fields <spec>` | Fields to return per row: `default` (`_id`, `name`, and the table columns), `all` (complete documents), or a comma-separated field list (dot notation allowed). Applied client-side — see [field projection](https://developer.celigo.com/cli/getting-started/global-flags.md). |
| `--limit <n>`     | Return at most `<n>` rows, fetching a single page.                                                                                                                                                                                                                              |

```bash
celigo tags list
celigo tags list --limit 20 --format table
```

**Corresponds to**: [`GET /v1/tags`](https://developer.celigo.com/api/api-reference/monitoring/tags#get-v1-tags)

## celigo tags get

Fetch one tag by id.

```bash
celigo tags get <id>
```

**Corresponds to**: [`GET /v1/tags/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/tags#get-v1-tags-_id)

## celigo tags create

Create a tag from a JSON body. Read the body from a file with `-f, --file` (recommended), or pipe it on stdin (`--file -` also means stdin). The minimal shape is `{"tag":"<label>"}`.

| Flag                | Description                                                                                                  |
| ------------------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |

```bash
echo '{"tag":"priority"}' | celigo tags create
celigo tags create --file tag.json
```

**Corresponds to**: [`POST /v1/tags`](https://developer.celigo.com/api/api-reference/monitoring/tags#post-v1-tags)

## celigo tags update

Full-replace PUT. Reads the complete tag document from `-f, --file` or stdin — omitted fields are erased.

> ⚠️ **`update` replaces the entire tag.** `PUT` erases any field you omit. `GET` the tag first, edit it, then send the complete document back — or use `set` for partial edits.

| Flag                | Description                                                                                                  |
| ------------------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |
| `--force`           | Submit even if the body contains masked credential values (`"******"`) copied from a GET.                    |

```bash
celigo tags update <id> --file tag.json
celigo tags update <id> < tag.json
```

**Corresponds to**: [`PUT /v1/tags/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/tags#put-v1-tags-_id)

## celigo tags set

Patch individual fields with `key=value` assignments. `tag` is the PATCH-whitelisted field and is applied via an atomic `PATCH`; other fields go through GET → modify → PUT so omitted fields are preserved. Values are auto-parsed as JSON. A `key=file://<path>` value loads that field from a file instead of the command line (a leading `~` and relative paths are supported). Added in celigo-cli 2026.6.1.

The tags PATCH takes `replace` only, so since celigo-cli 2026.10.1 a removal — `<field>=null`, `tag=null` included — goes through GET → modify → PUT instead of sending a `remove` the API refuses.

`set` on a tag needs `full` mode: no tag field is an operate-level field.

```bash
celigo tags set <id> tag="Priority - triage"
```

**Corresponds to**: [`PATCH /v1/tags/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/tags) for a value assigned to `tag`; otherwise [`GET /v1/tags/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/tags#get-v1-tags-_id) then [`PUT /v1/tags/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/tags#put-v1-tags-_id)

## celigo tags delete

Delete the tag. Prompts for confirmation unless `-y` is supplied.

> ⚠️ **Deleting a tag cannot be undone.** The tag is permanently removed from the account, and resources that referenced its `tagId` no longer resolve to it.

| Flag        | Description        |
| ----------- | ------------------ |
| `-y, --yes` | Skip confirmation. |

```bash
celigo tags delete <id> -y
```

**Corresponds to**: [`DELETE /v1/tags/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/tags#delete-v1-tags-_id)

## Gotchas

* **Two identifiers, two uses.** `_id` is the Mongo id used to `get`, `update`, `set`, and `delete` the tag itself. `tagId` is the short human code (e.g. `F3ZBQ`) that other resources reference in their `tagIds` arrays — see [`flows tag-errors`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-tag-errors).
* **Minimal create payload.** Only `tag` is required; the server assigns `_id` and `tagId`. Fuller fields (color, description, etc.) vary by account and are not documented in the Tags spec.
* **Clearing a field is a full PUT.** Since celigo-cli 2026.10.1, `set tag=null` — like any `<field>=null` — reads the tag and PUTs the complete document without the field, because the tags PATCH cannot remove one.

## Related

* [`flows`](https://developer.celigo.com/cli/commands/flows.md) — [`flows tag-errors`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-tag-errors) applies tag codes (`tagId`, not `_id`) to flow errors for triage; tags also surface on error records under a `tags` field.
* [`notifications`](https://developer.celigo.com/cli/commands/notifications.md) — notification subscriptions can target tagged resources.
* [`integrations`](https://developer.celigo.com/cli/commands/integrations.md) — integrations and their children can carry tags for search and filtering.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/tags.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
