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

# Labels

> What labels are and how they classify variants in Composer.

## What Is a Label?

A **label** is a semantic tag that classifies a variant — it captures the intent, tone, or strategy behind a piece of message copy. Examples: `Curiosity`, `Urgency`, `Calm`, `Social Proof`.

Labels are how Aampe learns which type of message resonates with which user. Over time, Aampe associates each user with the labels they respond to and selects variants accordingly.

***

## Labels and Component Types

Every label is scoped to a specific **component type** via its `variant_type` field. A label with `variant_type: "Offering"` can only be used on Offering variants — it cannot be applied to a `ValueProposition` or `CallToAction` variant.

This means you need separate labels for each component type you use in a formula.

<Warning>
  If you try to attach a label to a variant whose component type doesn't match the label's `variant_type`, the API will return an error.
</Warning>

***

## How Labels Flow Through the System

```
Label (id, variant_type, label_name)
  │
  ├─► Formula-level label association
  │     {"label_id": 101, "variant_type": "Offering", "component_type_id": "..."}
  │     Declares which labels this formula uses per component type
  │
  └─► Variant-level label assignment
        {"component_id": "...", "content": "...", "label_id": 101}
        Tags each individual alternate with its semantic meaning
```

Labels appear in two places:

* **On the formula** (`labels` array at creation time) — declares which labels are associated with each component type in this formula
* **On each variant** (`label_id` at variant creation time) — tags the specific alternate with its meaning

***

## Label Fields

| Field               | Type             | Description                                           |
| ------------------- | ---------------- | ----------------------------------------------------- |
| `id`                | integer          | The label's unique ID — used as `label_id` everywhere |
| `label_name`        | string           | Human-readable name (e.g. `"Curiosity"`)              |
| `label_description` | string           | What this label means                                 |
| `variant_type`      | string           | The component type `data_key` this label applies to   |
| `archived_at`       | datetime or null | If set, the label is archived and should not be used  |

See [Manage Labels](./manage-labels) for how to fetch and create labels.
