> For the complete documentation index, see [llms.txt](https://docs.terrakube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terrakube.io/2.34.0/set-up/organizations/tags.md).

# Tags

You can use tags to categorize, sort, and even filter workspaces based on the tags.

A tag is made of a **key** and an optional **value**. The organization manages the tag keys, and each workspace sets its own value for a key, for example `env = dev` on one workspace and `env = prod` on another. A tag without a value is a key-only tag, which is how tags worked before values were introduced.

You can manage tag keys for the organization in **Organization Settings > Tags**. This section lets you create, rename and delete tag keys. Alternatively, you can add existing keys or create new ones, and set their values, in the [Workspace overview page](/2.34.0/run-terraform/workspaces/overview.md).

{% hint style="info" %}
A tag key can have up to 128 characters and a tag value up to 256 characters. A workspace holds one value per key.
{% endhint %}

### Creating a Tag Key

Once you are in the desired organization, open **Organization Settings**, select **Tags** in the left menu and click the **Create tag key** button.

<figure><img src="https://1229094460-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTN6M529qVFnas8hChf2y%2Fuploads%2Fgit-blob-1beb08e034b61e39cafeedeb5d346cc37c608062%2Ftags-empty-list.png?alt=media" alt=""><figcaption></figcaption></figure>

In the **Create a tag key** popup, provide the required values. Use the below table as reference:

| Field | Description         |
| ----- | ------------------- |
| Key   | Unique tag key name |

Finally click the **Create tag key** button in the popup and the tag key will be created.

<figure><img src="https://1229094460-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTN6M529qVFnas8hChf2y%2Fuploads%2Fgit-blob-e5c28e4ced931b02f5c14e762748a0ba2a2a2ae7%2Ftags-create-form.png?alt=media" alt=""><figcaption></figcaption></figure>

You will see the new tag key in the list. And now you can use the tag key in the workspaces within the organization, with or without a value.

<figure><img src="https://1229094460-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTN6M529qVFnas8hChf2y%2Fuploads%2Fgit-blob-fdb1155b411514a75972def996f75d9c17eb5a5c%2Ftags-list.png?alt=media" alt=""><figcaption></figcaption></figure>

### Edit a Tag Key

Click the edit (pencil) icon next to the tag key you want to edit.

<figure><img src="https://1229094460-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTN6M529qVFnas8hChf2y%2Fuploads%2Fgit-blob-59781d6ba00c1d169435e488d1d1dcfa8e54ee8e%2Ftags-edit-button.png?alt=media" alt=""><figcaption></figcaption></figure>

Change the key and click the **Save changes** button. The new key shows on every workspace that uses it, and the values that workspaces have set for it are kept.

<figure><img src="https://1229094460-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTN6M529qVFnas8hChf2y%2Fuploads%2Fgit-blob-45062cd5fff56ec8c04596148e901a4beaf6f259%2Ftags-edit-form.png?alt=media" alt=""><figcaption></figcaption></figure>

### Delete a Tag Key

Click the delete (trash) icon next to the tag key you want to delete, and then click the **Delete tag** button to confirm the deletion. Please take in consideration the deletion is irreversible and the tag will be removed from all the workspaces using it, together with the values they set for it.

<figure><img src="https://1229094460-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTN6M529qVFnas8hChf2y%2Fuploads%2Fgit-blob-cf268508fe50abaa704f20ff696fcd23147d8cfc%2Ftags-delete-confirmation.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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://docs.terrakube.io/2.34.0/set-up/organizations/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.
