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

# Labs

> Logical groupings for experiments.

A Lab is simply a logical grouping of experiment resources. In the future, other potential resource assets may be group-able into Labs, but for now, think of a Lab as a folder or workspace that experiments live inside. Common use cases for labs include:

* by org (i.e., Marketing, Engineering)
* by team
* used as folders

There are no limits to the number of labs that can be created. Go crazy!

## YAML

### Metadata

<Note>
  The possible statuses for labs are: `active` or `archived`. `parentKind` and `parentId` should be excluded.
</Note>

When defining a resource in YAML, each must have a `metadata` section. The following properties within `metadata` are shared across all resource types:

| Key               | Data Type                           | Description                                                                                                                                                                                                   |
| ----------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`              | `string`                            | Unique identifier. Case insensitive and consist of alphanumeric characters, '-', '\_' or '.’ For example: `home-page-test`. IDs will be stored and displayed in UPPERCASE.                                    |
| `name`            | `string`                            | Name of the resource.                                                                                                                                                                                         |
| `description`     | `string`                            | Description of the resource.                                                                                                                                                                                  |
| `resourceVersion` | `int`                               | Modification version for a given resource. Incremented each time the resource is updated. This will be shown when retreiving a resource, but is ignored if provided as part of a resource update.             |
| `status`          | [`ResourceStatus`](#resourcestatus) | The status of the resource.                                                                                                                                                                                   |
| `parentKind`      | `lab`                               | The kind of resouce this one belongs to. Only applies to experiments, in which case the value is `lab`. Exclude for non experiments.                                                                          |
| `parentId`        | `string`                            | The ID of the resources parent. Only applies to experiments and the ID of its parent lab. Exclude for non experiments.<br /><br />If an experiment does not specified a `parentID`, it defaults to `DEFAULT`. |

#### `ResourceStatus`

Possible statuses include:

| Status            | Description                                                      | Resources  |
| ----------------- | ---------------------------------------------------------------- | ---------- |
| `draft`           | The experiment exists, but is not ready to go live.              | Experiment |
| `active`          | The experiment is live and making/tracking/returned assignments. | All        |
| `winner_declared` | A winner has been declared.                                      | Experiment |
| `ended`           | The experiment has ended. No assignments are made/returned.      | Experiment |
| `archived`        | The experiment has ended and is archived from view.              | All        |

### Spec

Labs don’t have any special that needs to be defined that isn’t in the metadata, so no `spec` is necessary.

### Example

```yaml theme={null}
schemaVersion: 1
kind: lab
metadata:
  id: marketing
  resourceVersion: 1
  status: active
  name: Marketing
  description: All initiatives for the marketing org.
```
