PUT
/
flags
/
{flag_id}
/
rules
curl --request PUT \
  --url https://api.schematichq.com/flags/{flag_id}/rules \
  --header 'Content-Type: application/json' \
  --header 'X-Schematic-Api-Key: <api-key>' \
  --data '{
  "rules": [
    {
      "condition_groups": [
        {
          "conditions": [
            {
              "comparison_trait_id": "<string>",
              "condition_type": "company",
              "event_subtype": "<string>",
              "id": "<string>",
              "metric_period": "current_month",
              "metric_value": 123,
              "operator": "eq",
              "resource_ids": [
                "<string>"
              ],
              "trait_id": "<string>",
              "trait_value": "<string>"
            }
          ],
          "flag_id": "<string>",
          "id": "<string>",
          "plan_id": "<string>"
        }
      ],
      "conditions": [
        {
          "comparison_trait_id": "<string>",
          "condition_type": "company",
          "event_subtype": "<string>",
          "id": "<string>",
          "metric_period": "current_month",
          "metric_value": 123,
          "operator": "eq",
          "resource_ids": [
            "<string>"
          ],
          "trait_id": "<string>",
          "trait_value": "<string>"
        }
      ],
      "id": "<string>",
      "name": "<string>",
      "priority": 123,
      "rule_type": "global_override",
      "value": true
    }
  ]
}'
{
  "data": {
    "Flag": {
      "created_at": "2023-11-07T05:31:56Z",
      "default_value": true,
      "description": "<string>",
      "feature_id": "<string>",
      "flag_type": "<string>",
      "id": "<string>",
      "key": "<string>",
      "name": "<string>",
      "updated_at": "2023-11-07T05:31:56Z"
    },
    "rules": [
      {
        "condition_groups": [
          {
            "conditions": [
              {
                "comparison_trait": {
                  "created_at": "2023-11-07T05:31:56Z",
                  "display_name": "<string>",
                  "entity_type": "<string>",
                  "hierarchy": [
                    "<string>"
                  ],
                  "id": "<string>",
                  "trait_type": "<string>",
                  "updated_at": "2023-11-07T05:31:56Z"
                },
                "comparison_trait_id": "<string>",
                "condition_group_id": "<string>",
                "condition_type": "<string>",
                "created_at": "2023-11-07T05:31:56Z",
                "environment_id": "<string>",
                "event_subtype": "<string>",
                "flag_id": "<string>",
                "id": "<string>",
                "metric_period": "<string>",
                "metric_value": 123,
                "operator": "<string>",
                "plan_id": "<string>",
                "resource_ids": [
                  "<string>"
                ],
                "resources": [
                  {
                    "id": "<string>",
                    "name": "<string>"
                  }
                ],
                "rule_id": "<string>",
                "trait": {
                  "created_at": "2023-11-07T05:31:56Z",
                  "display_name": "<string>",
                  "entity_type": "<string>",
                  "hierarchy": [
                    "<string>"
                  ],
                  "id": "<string>",
                  "trait_type": "<string>",
                  "updated_at": "2023-11-07T05:31:56Z"
                },
                "trait_entity_type": "<string>",
                "trait_id": "<string>",
                "trait_value": "<string>",
                "updated_at": "2023-11-07T05:31:56Z"
              }
            ],
            "created_at": "2023-11-07T05:31:56Z",
            "environment_id": "<string>",
            "flag_id": "<string>",
            "id": "<string>",
            "plan_id": "<string>",
            "rule_id": "<string>",
            "updated_at": "2023-11-07T05:31:56Z"
          }
        ],
        "conditions": [
          {
            "comparison_trait": {
              "created_at": "2023-11-07T05:31:56Z",
              "display_name": "<string>",
              "entity_type": "<string>",
              "hierarchy": [
                "<string>"
              ],
              "id": "<string>",
              "trait_type": "<string>",
              "updated_at": "2023-11-07T05:31:56Z"
            },
            "comparison_trait_id": "<string>",
            "condition_group_id": "<string>",
            "condition_type": "<string>",
            "created_at": "2023-11-07T05:31:56Z",
            "environment_id": "<string>",
            "event_subtype": "<string>",
            "flag_id": "<string>",
            "id": "<string>",
            "metric_period": "<string>",
            "metric_value": 123,
            "operator": "<string>",
            "plan_id": "<string>",
            "resource_ids": [
              "<string>"
            ],
            "resources": [
              {
                "id": "<string>",
                "name": "<string>"
              }
            ],
            "rule_id": "<string>",
            "trait": {
              "created_at": "2023-11-07T05:31:56Z",
              "display_name": "<string>",
              "entity_type": "<string>",
              "hierarchy": [
                "<string>"
              ],
              "id": "<string>",
              "trait_type": "<string>",
              "updated_at": "2023-11-07T05:31:56Z"
            },
            "trait_entity_type": "<string>",
            "trait_id": "<string>",
            "trait_value": "<string>",
            "updated_at": "2023-11-07T05:31:56Z"
          }
        ],
        "created_at": "2023-11-07T05:31:56Z",
        "environment_id": "<string>",
        "flag_id": "<string>",
        "id": "<string>",
        "name": "<string>",
        "plan_id": "<string>",
        "priority": 123,
        "rule_type": "<string>",
        "updated_at": "2023-11-07T05:31:56Z",
        "value": true
      }
    ]
  },
  "params": {}
}

Authorizations

X-Schematic-Api-Key
string
headerrequired

Path Parameters

flag_id
string
required

flag_id

Body

application/json
rules
object[]
required

Response

200 - application/json
data
object
required

The updated resource

params
object
required

Input parameters