PUT /accounts/{account_id}/flagship/apps/{app_id}/flags/{flag_key}

Replaces the entire flag definition. Omitted fields are dropped, not preserved — read before writing. Each update appends a changelog entry.

Servers

Path parameters

Name Type Required Description
flag_key String Yes

Flag key (slug).

app_id String Yes

App identifier.

account_id String Yes

Cloudflare account ID.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
rules[] Array Yes

Targeting rules evaluated in ascending priority; the first matching rule wins. An empty array means the flag always serves default_variation.

rules[].priority Integer Yes

Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules.

rules[].rollout Object No
rules[].rollout.percentage Number Yes

Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100).

rules[].rollout.attribute String No

Context attribute used for sticky bucketing. Defaults to targetingKey. If absent at evaluation time, bucketing is random per request.

rules[].conditions[] Array Yes

Conditions the context must satisfy for this rule to match. An empty array matches all contexts.

rules[].serve_variation String Yes

Variation served when this rule matches. Must be a key in variations.

variations Object Yes

Map of variation name to value. All values must be the same type (boolean, string, number, or JSON object/array). Each serialized value must be 10KB or smaller.

variations.realtimekit_success Boolean No
description String No
key String Yes

Unique identifier for the flag within an app. Used in all evaluation and SDK calls.

enabled Boolean Yes

When false, the flag bypasses all rules and always serves default_variation.

type String No

Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests.

Valid values:

  • "string"
  • "boolean"
  • "json"
  • "number"
default_variation String Yes

Variation served when no rule matches or the flag is disabled. Must be a key in variations.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.