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>Path parameters
The project key
The project key
Query parameters
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
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