> ## Documentation Index
> Fetch the complete documentation index at: https://confidence-auth-testing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Flag

> Learn how to create a flag in Confidence to remotely control the behavior of your application.

**Create a Flag**

Learn how to create a flag in Confidence to remotely control the behavior of your application.

[Do this via the API →](/docs/reference/api/how-to-guides/flags/create-flag.md)

A [flag](/docs/capabilities/flags/create-flags.md) lets you remotely control the behavior in your application.

## Create a Flag

The flag creation wizard guides you through a series of steps. The number of steps depends on the flag type you select.

**1. Go to Confidence and select Flags on the left sidebar**

**2. Click Create to open the flag creation wizard**

**3. About**

Enter the **Flag key** that uniquely identifies your flag. This is the same ID you use in your code. You can't change the flag key after creation.

Optionally add a **Description** to explain what the flag is for and how to use it.

Select an **Owner** for the flag. The owner defaults to the current user.

**4. Type**

Select the type of flag:

* **Boolean**: A simple on/off flag to enable or disable a feature. Selecting this option takes you through a 4-step wizard.
* **JSON**: A flag with a schema that can store multiple values. Selecting this option takes you through a 6-step wizard with additional steps for defining the schema and creating an initial variant.

### Boolean Flag Steps

For Boolean flags, the wizard continues with:

**1. Client applications**

Select which [clients](/docs/capabilities/flags/clients.md) can access this flag. You can skip this step and add clients later.

**2. Summary**

Review your flag configuration. Click **Edit** next to any section to make changes. When ready, click **Create** to create the flag.

When you create a Boolean flag, Confidence automatically creates two variants: **enabled** and **disabled**. You can use these variants in rules to turn features on or off for different users.

### JSON Flag Steps

For JSON flags, the wizard includes additional steps to define the schema and optionally create a first variant:

**1. Properties**

Define the schema for your flag by adding properties. Each property has a name and a type (String, Integer, Double, or Boolean). These properties define the values your flag can return.

**2. First variant (optional)**

Create an initial variant with values for your properties. You can modify these values later or skip this step and create variants after the flag is created.

**3. Client applications**

Select which [clients](/docs/capabilities/flags/clients.md) can access this flag. You can skip this step and add clients later.

**4. Summary**

Review your flag configuration. Click **Edit** next to any section to make changes. When ready, click **Create** to create the flag.

> [!TIP]
>
> Use a flag key that is understandable and memorable. For example, `new-navbar`.
> Avoid long names, and don't include the configuration in the name itself.
> For example, don't use `new-navbar-mobile-experience` or `new-navbar-enabled`
> as the flag key.

> [!TIP]
>
> Mobile apps and websites batch resolve flags to reduce the number of requests
> made to Confidence. Associate a flag with as few clients as possible to limit
> the number of resolved flags. Doing so also reduces costs.

## Associate a Flag with More Clients

You can associate a flag with more clients by following these steps:

**1. Go to Confidence and select Flags on the left sidebar**

**2. Select the flag you want to add a client to**

**3. Click the icon next to Clients on the right sidebar**

This opens the clients dialog.

**4. Select the clients that should be able to resolve the flag**

**5. Click Save**

## View Code Snippets

To find instructions on how to use the SDKs for a particular flag, you can use
Confidence's code snippet feature.

**1. Go to Confidence and select Flags on the left sidebar**

**2. Go to the flag you want to preview the code for**

**3. Click Code snippets on the right sidebar**

**4. Select client and credential**

Select client and credential that you want to preview the code for.

**5. Pick the SDK you're interested in**

The code snippet shows you how to install, initialize, and resolve using
the Confidence SDK.

## Related Resources

> **[Edit Flag Schema](/docs/capabilities/flags/edit-flag-schema.md)**
>
> Define the properties and types for your flag

> **[Create Variants](/docs/capabilities/flags/create-flag-variant.md)**
>
> Add variants with different values for your flag

> **[Flags Reference](/docs/capabilities/flags/overview)**
>
> Deep dive into flag concepts and architecture

> **[Create Flag API](/docs/reference/api/how-to-guides/flags/create-flag.md)**
>
> API reference for flags
