# Creating & Managing Flags

Flags are the core building blocks of Feature Entitlements. Each flag represents a feature or behavior you want to control.

## Creating a Flag

1. Go to **Feature Entitlements** and select your project.
2. Click **Create Flag**.
3. Fill in the details:

| Field          | Description                                                                             | Required |
| -------------- | --------------------------------------------------------------------------------------- | -------- |
| Name           | A human-readable name (e.g., "New Dashboard")                                           | Yes      |
| Key            | A unique identifier used in code (e.g., `new-dashboard`). Auto-generated from the name. | Yes      |
| Type           | Boolean, String, Number, or JSON                                                        | Yes      |
| Description    | Explain what this flag controls                                                         | No       |
| Tags           | Labels for filtering and organizing flags                                               | No       |
| Include in JWT | Embed this flag's value in user access tokens                                           | No       |

4. Click **Create**.

## Flag Types

| Type    | Use case                      | Example values                   |
| ------- | ----------------------------- | -------------------------------- |
| Boolean | Simple on/off toggles         | `true`, `false`                  |
| String  | Text-based configuration      | `"dark"`, `"light"`, `"auto"`    |
| Number  | Numeric settings              | `5`, `100`, `0.5`                |
| JSON    | Complex configuration objects | `{"limit": 10, "enabled": true}` |

## Editing a Flag

1. Click the flag name to open its detail page.
2. Update the name, description, tags, or JWT setting.
3. Click **Save**.

> **Note:** The flag key cannot be changed after creation because it may be referenced in your application code.

## Archiving and Deleting Flags

### Archive

Archiving a flag stops it from being evaluated. All users receive the default value. Use this when you plan to revisit the flag later.

1. Open the flag and click **Archive**.
2. The flag moves to the **Archived** tab.
3. You can restore it at any time.

### Delete

Deleting a flag permanently removes it and all its targeting rules.

1. Open the flag and click **Delete**.
2. Confirm the action.

> **Warning:** Make sure the flag is no longer referenced in your application code before deleting it.

## Organizing Flags

* **Tags**: Add tags like `frontend`, `experiment`, or `billing` to group related flags.
* **Search**: Use the search bar to find flags by name or key.
* **Filter**: Filter by tag, type, or status (active, archived).


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://accessiq.gitbook.io/accessiq-docs/feature-entitlements/creating-flags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
