Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

If using Bearer auth, pass the Secret Key as the token:

Query Parameters

skipSchemaValidation
deprecated

Deprecated — pass skipSchemaValidation in the request body instead.

Allowed value: "true"
ignoreWarnings
deprecated

Deprecated — pass ignoreWarnings in the request body instead.

Allowed value: "true"

Body

application/json
id
string
required

Unique, permanent key, shown as the Feature Flag's name in the UI and used in code. Keep it short. If featureRegexValidator in GET /api/v1/settings is set, follow it (featureKeyExample shows the format); otherwise use kebab-case (e.g. checkout-express-pay). Put context in description.

Minimum string length: 1
Pattern: ^[a-zA-Z0-9_.:\|\-]+$
valueType
enum<string>
required

The data type of the feature payload. Boolean by default.

Available options:
boolean,
string,
number,
json
defaultValue
string
required

Default value when feature is enabled. Type must match valueType. In Config mode (baseConfig set) the default must be exactly a config with no overrides: send "{}" to use baseConfig, or set defaultValueConfig to point at a descendant.

archived
boolean
description
string

Markdown. What the Feature Flag gates and why, rollout plan, and links. Put context here, not in the key.

Maximum string length: 10000
owner
string

The userId or email address of the owner. If an email address is provided, it will be used to look up the userId of the matching organization member. If an ID is provided, it will be validated as existing in the organization. When omitted, it defaults to the requesting member: a personal access token's owner, or the member an organization API key assumes. An organization API key acting as itself must send it, or the request fails with a 400.

project
string

An associated project ID

targetingAllProjects
boolean

Make this feature discoverable in — and served to — every project, beyond its primary project. Requires the targetFeatures permission (FlagsTarget policy) unscoped to any project. Governance stays with project.

targetingProjects
string[]

Secondary project IDs this feature is targeted in and served to, beyond its primary project. Adding a project requires the targetFeatures permission (FlagsTarget policy) in that project. Governance stays with project.

baseConfig
string | null

Key of the config backing this flag ("Config mode"). Requires valueType: "json" and a live config. The config supplies the base JSON and schema; defaultValue and rule values are override patches on top. null or omitted for a plain flag.

defaultValueConfig
string | null

Optional. A config within baseConfig's family that the default value resolves to instead of baseConfig itself. null or omitted means the default is baseConfig. The default is exactly this config and carries no overrides of its own.

tags
string[]

Tags for filtering and grouping. Use these instead of encoding groups in names.

rules
object[]

Feature rules. Each rule carries its own environment scope via allEnvironments / environments.

environments
object

Per-environment enabled state, keyed by environment ID. An environment you leave out uses its "Default state for new features" setting, which may be enabled. To create the Feature Flag disabled, list every environment with enabled: false. Rules go on the top-level rules field.

prerequisites
string[]

Feature IDs. Each feature must evaluate to true

jsonSchema
string

Use JSON schema to validate the payload of a JSON-type feature value (enterprise only).

customFields
object
comment
string

Comment to record on the feature's initial revision. Defaults to an empty comment.

ignoreWarnings
boolean

Set to true to acknowledge the warnings listed in a blocked response and continue. This covers experiment guards, locked dependents, and references affected by an archive. When the organization treats schema failures as warnings, it also covers schema and invariant warnings. It never bypasses a rejected Custom Hook. On revision publish endpoints, it can also force-publish an out-of-date draft when the caller has Bypass draft approvals access. Only set this when a person has explicitly asked you to. If a check blocks you, stop and ask a person instead of working around it.

skipSchemaValidation
boolean

Set to true to publish despite schema validation errors, failed invariants, or schema changes that invalidate dependent resources. This does not bypass a rejected Custom Hook; use skipHooks for that. The caller must have Bypass draft approvals access for Feature Flags, Configs, and Constants in every Project. Otherwise, this field is ignored. Only set this when a person has explicitly asked you to. If a check blocks you, stop and ask a person instead of working around it.

skipHooks
boolean

Set to true to publish despite a Custom Hook rejection. This does not bypass schema validation; use skipSchemaValidation for that. The caller must have Bypass draft approvals access for Feature Flags, Configs, and Constants in every Project. Otherwise, this field is ignored. Only set this when a person has explicitly asked you to. If a check blocks you, stop and ask a person instead of working around it.

Response

Resource created

feature
object
required