v5

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-02-283466592.5 MB
Feature flags

Create a feature flag

Create a feature flag with the given name, key, and variations.

<details> <summary>Click to expand instructions for <strong>creating a migration flag</strong></summary>

Creating a migration flag

When you create a migration flag, the variations are pre-determined based on the number of stages in the migration.

To create a migration flag, omit the variations and defaults information. Instead, provide a purpose of migration, and migrationSettings. If you create a migration flag with six stages, contextKind is required. Otherwise, it should be omitted.

Here's an example:

{
  "key": "flag-key-123",
  "purpose": "migration",
  "migrationSettings": {
    "stageCount": 6,
    "contextKind": "account"
  }
}

To learn more, read Migration Flags.

</details>
post/api/v2/flags/{projectKey}

Path parameters

projectKeystring string required

The project key

The project key

Query parameters

clonestring string

The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey copies the full targeting configuration for all environments, including on/off state, from the original flag to the new flag.

The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey copies the full targeting configuration for all environments, including on/off state, from the original flag to the new flag.

Request body

namestring required

A human-friendly name for the feature flag

keystring required

A unique key used to reference the flag in your code

descriptionstring

Description of the feature flag. Defaults to an empty string.

includeInSnippetboolean

Deprecated, use <code>clientSideAvailability</code>. Whether this flag should be made available to the client-side JavaScript SDK. Defaults to <code>false</code>.

temporaryboolean

Whether the flag is a temporary flag. Defaults to <code>true</code>.

tagsstring[]

Tags for the feature flag. Defaults to an empty array.

customPropertiesCustomProperties
purpose'migration' | 'holdout'

Purpose of the flag

maintainerIdstring

The ID of the member who maintains this feature flag

maintainerTeamKeystring

The key of the team that maintains this feature flag

isFlagOnboolean

Whether to automatically turn the flag on across all environments at creation. Defaults to <code>false</code>.

Example request

{
  "name": "My flag",
  "key": "flag-key-123abc",
  "description": "This flag controls the example widgets",
  "clientSideAvailability": {
    "usingEnvironmentId": true,
    "usingMobileKey": true
  },
  "variations": [
    {
      "value": true
    },
    {
      "value": false
    }
  ],
  "tags": [
    "example-tag"
  ],
  "defaults": {
    "offVariation": 1
  },
  "purpose": "migration",
  "maintainerId": "12ab3c45de678910fgh12345",
  "maintainerTeamKey": "team-1"
}

Response

Global flag response

namestring required

A human-friendly name for the feature flag

kind'boolean' | 'multivariate' required

Kind of feature flag

descriptionstring

Description of the feature flag

keystring required

A unique key used to reference the flag in your code

_versioninteger required

Version of the feature flag

creationDateinteger required
includeInSnippetboolean

Deprecated, use <code>clientSideAvailability</code>. Whether this flag should be made available to the client-side JavaScript SDK

temporaryboolean required

Whether the flag is a temporary flag

tagsstring[] required

Tags for the feature flag

_linksobject required

The location and content type of related resources

maintainerIdstring

Associated maintainerId for the feature flag

maintainerTeamKeystring

The key of the associated team that maintains this feature flag

goalIdsstring[]

Deprecated, use <code>experiments</code> instead

customPropertiesCustomProperties required
archivedboolean required

Boolean indicating if the feature flag is archived

archivedDateinteger
deprecatedboolean

Boolean indicating if the feature flag is deprecated

deprecatedDateinteger
_purposestring
environmentsobject

Details on the environments for this flag. Only returned if the request is filtered by environment, using the <code>filterEnv</code> query parameter.