POST /accounts/{account_id}/flagship/apps/{app_id}/flags
Creates a flag. Returns 409 if the key already exists. type is inferred from variation values and may be omitted.
Servers
- https://api.cloudflare.com/client/v4
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
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 |
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 |
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 |
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 |
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:
|
default_variation |
String | Yes |
Variation served when no rule matches or the flag is disabled. Must be a key in |
How to start integrating
- Add HTTP Task to your workflow definition.
- 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.
- Click Test request to test run your request to the API and see the API's response.