For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

Update feature flag

Updates feature flag metadata and rollout settings. Variant, tester, deployment, and link mutations will be exposed through dedicated subresources in a later slice.

patch/v1/projects/{project_id}/flags/{flag_id}

Authorizations

Authorizationstringrequired

http

Path parameters

project_idstringrequired

Amplitude project identifier, backed by the canonical app ID.

Example:12345
Constraints:pattern: ^[0-9]+$
flag_idstringrequired

Feature flag identifier.

Constraints:min length: 1

Header parameters

Idempotency-Keystringrequired

Unique idempotency key used to safely retry write operations.

Constraints:min length: 8max length: 255

Body

application/json
descriptionstring
Constraints:nullable
evaluation_modestring
Allowed values:localremote
rollout_percentageinteger
Constraints:min: 0max: 100
Other properties4
namestring
enabledboolean
bucketing_keystring
tagsstring[]

Response

application/json
200· Feature flag updated.
dataobjectrequired
Show child attributes
idstringrequired
project_idstringrequired
Constraints:pattern: ^[0-9]+$
keystringrequired
namestringrequired
descriptionstring
Constraints:nullable
deploymentsstring[]

Deployment IDs associated with this flag. Managed via the create/update deployment fields, not set directly on this field.

enabledbooleanrequired
evaluation_modestringrequired
Allowed values:localremote
variantsobject[]required
keystringrequired

Stable variant key. The value off is reserved.

Constraints:pattern: ^[A-Za-z0-9_-]+$
namestring
Constraints:nullable
descriptionstring
Constraints:nullable
payloadunknown

Optional JSON payload returned by evaluation.

bucketing_keystringrequired

Bucketing key used for assignment. Never null in responses; defaults to amplitude_id when not explicitly set.

bucketing_saltstring
Constraints:nullable
bucketing_unitstring
Constraints:nullable
rollout_percentageintegerrequired
Constraints:min: 0max: 100
rollout_weightsobjectrequired

Variant-keyed rollout weights. Values may be normalized to sum to 100 (percentages) or expressed as unnormalized relative weights (for example { "control": 1, "treatment": 1 } for an even split). Weights are non-negative and may be fractional.

target_segmentsobject[]required
namestring
Constraints:nullable
conditionsobject[]required
group_typestring
Constraints:nullable
propstringrequired

Property name or cohort identifier being targeted.

Constraints:min length: 1
prop_typestring

Namespace of the targeted property, for example user, event, or group. Omitted for conditions that target a cohort rather than a property.

Constraints:nullable
opstringrequired

Targeting operator applied to the property values.

Allowed values:isis notcontainsdoes not containlessless or equalgreatergreater or equalset isset is notset containsset does not containglob matchglob does not match
typestringrequired

Condition type, for example property or cohort.

valuesstring[]required

At least one value to match against. Conditions with no values are rejected.

percentageinteger

Segment rollout percentage.

Constraints:nullablemin: 0max: 100
rollout_weightsobject

Variant-keyed rollout weights. Values may be normalized to sum to 100 (percentages) or expressed as unnormalized relative weights (for example { "control": 1, "treatment": 1 } for an even split). Weights are non-negative and may be fractional.

bucketing_keystring
Constraints:nullable
testersobject[]
variant_keystringrequired
valuesstring[]required

User IDs, device IDs, or cohort identifiers included in this variant. At most 2000 entries per variant (the limit is 10 when the entries are cohort identifiers).

ownersstring[]
tagsstring[]required
created_bystring
Constraints:nullable
last_modified_bystring
Constraints:nullable
created_atstring
Constraints:format: date-timenullable
updated_atstring
Constraints:format: date-timenullable
parent_dependenciesobject
operatorstringrequired
Allowed values:allany
flagsobject[]required
flag_idstringrequired
allowed_variantsstring[]
linksobject[]
urlstringrequired
Constraints:format: uri
titlestringrequired
versionintegerrequired

Server-managed config version used for optimistic concurrency.

archivedbooleanrequired

Whether the resource is archived. Set via the archive (DELETE) operation.

urlstring
Constraints:format: urinullable
objectstringrequired

Resource-type discriminator. Always feature_flag.

Was this helpful?