# Apps ## List apps `flagship.apps.list(AppListParams**kwargs) -> SyncSinglePage[AppListResponse]` **get** `/accounts/{account_id}/flagship/apps` Lists all apps in the account. Returns identity and audit fields only — flag definitions are not included. ### Parameters - `account_id: str` Cloudflare account ID. ### Returns - `class AppListResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.flagship.apps.list( account_id="account_id", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": [ { "id": "id", "created_at": "created_at", "name": "name", "updated_at": "updated_at", "updated_by": "updated_by" } ], "success": true } ``` ## Get app `flagship.apps.get(strapp_id, AppGetParams**kwargs) -> AppGetResponse` **get** `/accounts/{account_id}/flagship/apps/{app_id}` Returns an app's name and audit fields. Flag definitions are not included. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. ### Returns - `class AppGetResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) app = client.flagship.apps.get( app_id="app_id", account_id="account_id", ) print(app.id) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "id": "id", "created_at": "created_at", "name": "name", "updated_at": "updated_at", "updated_by": "updated_by" }, "success": true } ``` ## Create app `flagship.apps.create(AppCreateParams**kwargs) -> AppCreateResponse` **post** `/accounts/{account_id}/flagship/apps` Creates an app. The returned `id` is used in all subsequent flag, changelog, and evaluation requests. ### Parameters - `account_id: str` Cloudflare account ID. - `name: str` ### Returns - `class AppCreateResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) app = client.flagship.apps.create( account_id="account_id", name="x", ) print(app.id) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "id": "id", "created_at": "created_at", "name": "name", "updated_at": "updated_at", "updated_by": "updated_by" }, "success": true } ``` ## Update app `flagship.apps.update(strapp_id, AppUpdateParams**kwargs) -> AppUpdateResponse` **put** `/accounts/{account_id}/flagship/apps/{app_id}` Updates an app. Only `name` is mutable. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `name: Optional[str]` ### Returns - `class AppUpdateResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) app = client.flagship.apps.update( app_id="app_id", account_id="account_id", ) print(app.id) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "id": "id", "created_at": "created_at", "name": "name", "updated_at": "updated_at", "updated_by": "updated_by" }, "success": true } ``` ## Delete app `flagship.apps.delete(strapp_id, AppDeleteParams**kwargs) -> AppDeleteResponse` **delete** `/accounts/{account_id}/flagship/apps/{app_id}` Deletes an app and all its flags and changelog history. Returns 409 if any Worker still references this app via a Flagship binding. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. ### Returns - `class AppDeleteResponse: …` - `id: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) app = client.flagship.apps.delete( app_id="app_id", account_id="account_id", ) print(app.id) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "id": "id" }, "success": true } ``` ## Domain Types ### App List Response - `class AppListResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### App Get Response - `class AppGetResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### App Create Response - `class AppCreateResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### App Update Response - `class AppUpdateResponse: …` - `id: str` - `created_at: str` - `name: str` - `updated_at: str` - `updated_by: str` Email of the actor who last modified the app, or `edge-gateway` for gateway-authenticated changes. ### App Delete Response - `class AppDeleteResponse: …` - `id: str` # Flags ## List flags `flagship.apps.flags.list(strapp_id, FlagListParams**kwargs) -> SyncCursorPaginationAfter[FlagListResponse]` **get** `/accounts/{account_id}/flagship/apps/{app_id}/flags` Lists an app's flags ordered by key. Pass `cursor` from `result_info` to page forward; a null cursor indicates the last page. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `cursor: Optional[str]` Pagination cursor from a previous response. - `limit: Optional[str]` Max items to return (1–200). ### Returns - `class FlagListResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.flagship.apps.flags.list( app_id="app_id", account_id="account_id", ) page = page.result[0] print(page.default_variation) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": [ { "default_variation": "x", "enabled": true, "key": "x", "rules": [ { "conditions": [ { "attribute": "x", "operator": "equals", "value": {} } ], "priority": 1, "serve_variation": "x", "rollout": { "percentage": 0, "attribute": "x" } } ], "variations": { "foo": "string" }, "description": "description", "type": "boolean", "updated_at": "updated_at", "updated_by": "updated_by" } ], "result_info": { "count": 0, "cursor": "cursor" }, "success": true } ``` ## Get flag `flagship.apps.flags.get(strflag_key, FlagGetParams**kwargs) -> FlagGetResponse` **get** `/accounts/{account_id}/flagship/apps/{app_id}/flags/{flag_key}` Returns the full flag definition including rules, variations, and audit fields. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `flag_key: str` Flag key (slug). ### Returns - `class FlagGetResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) flag = client.flagship.apps.flags.get( flag_key="flag_key", account_id="account_id", app_id="app_id", ) print(flag.default_variation) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "default_variation": "x", "enabled": true, "key": "x", "rules": [ { "conditions": [ { "attribute": "x", "operator": "equals", "value": {} } ], "priority": 1, "serve_variation": "x", "rollout": { "percentage": 0, "attribute": "x" } } ], "variations": { "foo": "string" }, "description": "description", "type": "boolean", "updated_at": "updated_at", "updated_by": "updated_by" }, "success": true } ``` ## Create flag `flagship.apps.flags.create(strapp_id, FlagCreateParams**kwargs) -> FlagCreateResponse` **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. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: Iterable[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: Iterable[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Sequence[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `Iterable[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `Iterable[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` ### Returns - `class FlagCreateResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) flag = client.flagship.apps.flags.create( app_id="app_id", account_id="account_id", default_variation="x", enabled=True, key="x", rules=[{ "conditions": [{ "attribute": "x", "operator": "equals", "value": {}, }], "priority": 1, "serve_variation": "x", }], variations={ "foo": "string" }, ) print(flag.default_variation) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "default_variation": "x", "enabled": true, "key": "x", "rules": [ { "conditions": [ { "attribute": "x", "operator": "equals", "value": {} } ], "priority": 1, "serve_variation": "x", "rollout": { "percentage": 0, "attribute": "x" } } ], "variations": { "foo": "string" }, "description": "description", "type": "boolean", "updated_at": "updated_at", "updated_by": "updated_by" }, "success": true } ``` ## Update flag `flagship.apps.flags.update(strflag_key, FlagUpdateParams**kwargs) -> FlagUpdateResponse` **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. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `flag_key: str` Flag key (slug). - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: Iterable[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: Iterable[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Iterable[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: Sequence[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `Iterable[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `Iterable[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` ### Returns - `class FlagUpdateResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) flag = client.flagship.apps.flags.update( flag_key="flag_key", account_id="account_id", app_id="app_id", default_variation="x", enabled=True, key="x", rules=[{ "conditions": [{ "attribute": "x", "operator": "equals", "value": {}, }], "priority": 1, "serve_variation": "x", }], variations={ "foo": "string" }, ) print(flag.default_variation) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "default_variation": "x", "enabled": true, "key": "x", "rules": [ { "conditions": [ { "attribute": "x", "operator": "equals", "value": {} } ], "priority": 1, "serve_variation": "x", "rollout": { "percentage": 0, "attribute": "x" } } ], "variations": { "foo": "string" }, "description": "description", "type": "boolean", "updated_at": "updated_at", "updated_by": "updated_by" }, "success": true } ``` ## Delete flag `flagship.apps.flags.delete(strflag_key, FlagDeleteParams**kwargs) -> FlagDeleteResponse` **delete** `/accounts/{account_id}/flagship/apps/{app_id}/flags/{flag_key}` Permanently deletes a flag. Subsequent evaluations fall back to the caller-supplied default. Cannot be undone. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `flag_key: str` Flag key (slug). ### Returns - `class FlagDeleteResponse: …` - `key: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) flag = client.flagship.apps.flags.delete( flag_key="flag_key", account_id="account_id", app_id="app_id", ) print(flag.key) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "key": "key" }, "success": true } ``` ## Domain Types ### Flag List Response - `class FlagListResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Flag Get Response - `class FlagGetResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Flag Create Response - `class FlagCreateResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Flag Update Response - `class FlagUpdateResponse: …` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[Rule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[RuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class RuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1: …` - `clauses: List[RuleConditionUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class RuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[RuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` ### Flag Delete Response - `class FlagDeleteResponse: …` - `key: str` # Changelog ## Get flag changelog `flagship.apps.flags.changelog.list(strflag_key, ChangelogListParams**kwargs) -> SyncCursorPaginationAfter[ChangelogListResponse]` **get** `/accounts/{account_id}/flagship/apps/{app_id}/flags/{flag_key}/changelog` Returns the audit history for a flag, newest first. Each entry includes the event type and full flag state after the change; `update` entries include a field-level diff. Capped at 200 entries per flag. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `flag_key: str` Flag key (slug). - `cursor: Optional[str]` Pagination cursor from a previous response. - `limit: Optional[str]` Max items to return (1–200). ### Returns - `ChangelogListResponse` - `class UnionMember0: …` - `after: UnionMember0After` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[UnionMember0AfterRule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[UnionMember0AfterRuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class UnionMember0AfterRuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[UnionMember0AfterRuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` - `event: Literal["create"]` - `"create"` - `flag_key: str` - `class UnionMember1: …` - `after: UnionMember1After` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[UnionMember1AfterRule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[UnionMember1AfterRuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class UnionMember1AfterRuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[UnionMember1AfterRuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` - `event: Literal["delete"]` - `"delete"` - `flag_key: str` - `class UnionMember2: …` - `after: UnionMember2After` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[UnionMember2AfterRule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[UnionMember2AfterRuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class UnionMember2AfterRuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[UnionMember2AfterRuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` - `diff: Dict[str, UnionMember2Diff]` - `from_: Optional[Union[Optional[str], float, bool, 3 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `to: Optional[Union[Optional[str], float, bool, 3 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `event: Literal["update"]` - `"update"` - `flag_key: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.flagship.apps.flags.changelog.list( flag_key="flag_key", account_id="account_id", app_id="app_id", ) page = page.result[0] print(page) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": [ { "after": { "default_variation": "x", "enabled": true, "key": "x", "rules": [ { "conditions": [ { "attribute": "x", "operator": "equals", "value": {} } ], "priority": 1, "serve_variation": "x", "rollout": { "percentage": 0, "attribute": "x" } } ], "variations": { "foo": "string" }, "description": "description", "type": "boolean", "updated_at": "updated_at", "updated_by": "updated_by" }, "event": "create", "flag_key": "flag_key" } ], "result_info": { "count": 0, "cursor": "cursor" }, "success": true } ``` ## Domain Types ### Changelog List Response - `ChangelogListResponse` - `class UnionMember0: …` - `after: UnionMember0After` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[UnionMember0AfterRule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[UnionMember0AfterRuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class UnionMember0AfterRuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember0AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[UnionMember0AfterRuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` - `event: Literal["create"]` - `"create"` - `flag_key: str` - `class UnionMember1: …` - `after: UnionMember1After` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[UnionMember1AfterRule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[UnionMember1AfterRuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class UnionMember1AfterRuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember1AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[UnionMember1AfterRuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` - `event: Literal["delete"]` - `"delete"` - `flag_key: str` - `class UnionMember2: …` - `after: UnionMember2After` - `default_variation: str` Variation served when no rule matches or the flag is disabled. Must be a key in `variations`. - `enabled: bool` When false, the flag bypasses all rules and always serves `default_variation`. - `key: str` Unique identifier for the flag within an app. Used in all evaluation and SDK calls. - `rules: List[UnionMember2AfterRule]` Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. - `conditions: List[UnionMember2AfterRuleCondition]` Conditions the context must satisfy for this rule to match. An empty array matches all contexts. - `class UnionMember2AfterRuleConditionUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1Clause]` - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember0: …` - `attribute: str` - `operator: Literal["equals", "not_equals", "greater_than", 8 more]` - `"equals"` - `"not_equals"` - `"greater_than"` - `"less_than"` - `"greater_than_or_equals"` - `"less_than_or_equals"` - `"contains"` - `"starts_with"` - `"ends_with"` - `"in"` - `"not_in"` - `value: object` Value to compare against the context attribute. Must be an array for `in` and `not_in`; numeric and ISO-8601 datetime strings are accepted by the ordering operators. - `class UnionMember2AfterRuleConditionUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1ClauseUnionMember1: …` - `clauses: List[Union[Optional[str], float, bool, 2 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `logical_operator: Literal["AND", "OR"]` - `"AND"` - `"OR"` - `priority: int` Evaluation order; lower numbers are evaluated first. Must be unique across the flag's rules. - `serve_variation: str` Variation served when this rule matches. Must be a key in `variations`. - `rollout: Optional[UnionMember2AfterRuleRollout]` - `percentage: float` Percentage of matching traffic (0–100) served this variation. For multi-way splits, use cumulative upper bounds across rules (e.g. 30, 70, 100). - `attribute: Optional[str]` Context attribute used for sticky bucketing. Defaults to `targetingKey`. If absent at evaluation time, bucketing is random per request. - `variations: Dict[str, Union[Optional[str], float, bool, 2 more]]` 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. - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `description: Optional[str]` - `type: Optional[Literal["boolean", "string", "number", "json"]]` Value type of the flag's variations. Inferred from the variation values on write, so it may be omitted in requests. - `"boolean"` - `"string"` - `"number"` - `"json"` - `updated_at: Optional[str]` - `updated_by: Optional[str]` - `diff: Dict[str, UnionMember2Diff]` - `from_: Optional[Union[Optional[str], float, bool, 3 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `to: Optional[Union[Optional[str], float, bool, 3 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` - `event: Literal["update"]` - `"update"` - `flag_key: str` # Evaluate ## Evaluate flag `flagship.apps.evaluate.get(strapp_id, EvaluateGetParams**kwargs) -> EvaluateGetResponse` **get** `/accounts/{account_id}/flagship/apps/{app_id}/evaluate` Evaluates a flag against the provided context. Pass context attributes as query parameters; boolean and numeric strings are coerced automatically. For low-latency in-Worker evaluation, prefer the Flagship binding over this endpoint. ### Parameters - `account_id: str` Cloudflare account ID. - `app_id: str` App identifier. - `flag_key: str` The flag key to evaluate. - `targeting_key: Optional[str]` Context targeting key (per OpenFeature spec); used for percentage rollout bucketing. ### Returns - `class EvaluateGetResponse: …` - `flag_key: str` - `reason: Literal["TARGETING_MATCH", "DEFAULT", "DISABLED", "SPLIT"]` - `"TARGETING_MATCH"` - `"DEFAULT"` - `"DISABLED"` - `"SPLIT"` - `variant: str` - `value: Optional[Union[Optional[str], float, bool, 3 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) evaluate = client.flagship.apps.evaluate.get( app_id="app_id", account_id="account_id", flag_key="flagKey", ) print(evaluate.flag_key) ``` #### Response ```json { "flagKey": "flagKey", "reason": "TARGETING_MATCH", "variant": "variant", "value": "string" } ``` ## Domain Types ### Evaluate Get Response - `class EvaluateGetResponse: …` - `flag_key: str` - `reason: Literal["TARGETING_MATCH", "DEFAULT", "DISABLED", "SPLIT"]` - `"TARGETING_MATCH"` - `"DEFAULT"` - `"DISABLED"` - `"SPLIT"` - `variant: str` - `value: Optional[Union[Optional[str], float, bool, 3 more]]` - `Optional[str]` - `float` - `bool` - `Dict[str, object]` - `List[object]`