---
title: Update automatic allocation rule configuration
slug: reference/update-automatic-allocation-rule-configuration
docTags: 
createdAt: 2025-07-03T16:20:35.017Z
---

{
  "id": "fKito7EYgBWWJsUazjs8h",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://app.amberflo.io/business-unit/focus-allocation/automatic/rule",
    "servers": [
      {
        "url": "https://app.amberflo.io/business-unit/focus-allocation/automatic/rule"
      }
    ],
    "name": "Update automatic allocation rule configuration",
    "description": "<p>Updates configuration and position of an existing automatic FOCUS allocation rule in the execution sequence.\nModifies rule properties including matching conditions, business unit assignments, and rule priority ordering.</p>\n<p>Required request body fields:</p>\n<ul>\n<li><code>id</code>: Identifier of the rule to update (must exist)</li>\n<li><code>provider</code>: Cloud provider for the rule (AWS, AZURE, GOOGLE_CLOUD)</li>\n<li><code>predicate</code>: Updated matching conditions that determine when the rule applies</li>\n</ul>\n<p>Optional request body fields:</p>\n<ul>\n<li><code>tagName</code>: Updated FOCUS tag name for cost allocation</li>\n<li><code>tagValue</code>: Updated specific tag value to match</li>\n<li><code>businessUnitId</code>: Updated target business unit for cost assignment</li>\n<li><code>label</code>: Updated display name for rule management</li>\n<li><code>description</code>: Updated explanation of rule purpose</li>\n<li><code>enabled</code>: Updated rule activation status</li>\n</ul>\n<p>Optional query parameters:</p>\n<ul>\n<li><code>placement</code>: New position in rule execution order (FIRST, LAST, BEFORE, AFTER)</li>\n<li><code>id</code>: Reference rule ID for relative positioning (used with BEFORE/AFTER)</li>\n</ul>\n<p>Returns updated rule with modified configuration and position metadata. Leave query parameters empty\nto update rule content without changing execution order position.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "placement",
          "type": "string",
          "description": "<p>New execution order position for the updated rule. FIRST/LAST for absolute positioning, BEFORE/AFTER for relative positioning with reference ID.</p>"
        },
        {
          "kind": "optional",
          "name": "id",
          "type": "string<uuid>",
          "example": "0e63b938-6785-429b-a89d-c4164144fc88",
          "description": "Reference rule identifier for relative positioning. Required when using BEFORE or AFTER placement options for sequential rule reordering."
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "Input model for creating automatic FOCUS allocation rules that assign cloud costs to business units based on resource tags and metadata conditions.",
          "customType": "business_unit.focus_allocation.automatic.AutomaticMatchingRule.in",
          "schema": [
            {
              "name": "provider",
              "kind": "required",
              "type": "string",
              "description": "Cloud provider for cost allocation filtering. Supported values include AWS, AZURE, GOOGLE_CLOUD for targeted rule application.",
              "modelRef": "#/components/schemas/focus.common.FocusProvider.in",
              "customType": "focus.common.FocusProvider.in",
              "schema": []
            },
            {
              "name": "predicate",
              "kind": "required",
              "type": "object",
              "description": "Matching conditions that determine when rule applies to cost records. Defines value matrix logic for resource identification.",
              "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.predicate.GroupKeyPredicate.in",
              "customType": "business_unit.focus_allocation.automatic.predicate.GroupKeyPredicate.in",
              "schema": [],
              "complexType": "oneOf",
              "complexItems": [
                {
                  "name": "business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.in",
                  "description": "",
                  "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.in",
                  "schema": [
                    {
                      "name": "type",
                      "kind": "required",
                      "type": "string",
                      "description": "Predicate type identifier for value matrix matching logic. Always set to 'value_matrix' for matrix-based resource filtering conditions.",
                      "example": "",
                      "default": "value_matrix"
                    },
                    {
                      "name": "columns",
                      "kind": "required",
                      "type": "array",
                      "description": "FOCUS column names for matrix dimension headers. Defines resource attributes used for matching conditions in allocation rules.",
                      "example": "",
                      "itemType": "string",
                      "customType": "string[]",
                      "itemExample": "",
                      "itemDefault": ""
                    },
                    {
                      "name": "rows",
                      "kind": "required",
                      "type": "array",
                      "description": "Matrix row definitions containing value combinations for resource matching. Each row represents specific resource attribute criteria for rule application.",
                      "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.ValueMatrixRow.in",
                      "customType": "business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.ValueMatrixRow.in[]",
                      "schema": [
                        {
                          "name": "values",
                          "kind": "required",
                          "type": "array",
                          "description": "Array of string values corresponding to matrix columns for resource matching. Each element matches position in predicate column array.",
                          "example": "",
                          "itemType": "string",
                          "customType": "string[]",
                          "itemExample": "",
                          "itemDefault": ""
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name": "tagName",
              "kind": "optional",
              "type": "string",
              "description": "FOCUS tag key for cost allocation target. Specifies resource tag name used for business unit assignment mapping.",
              "example": ""
            },
            {
              "name": "tagValue",
              "kind": "optional",
              "type": "string",
              "description": "Specific FOCUS tag value to match for cost allocation. Must be used with tagName for targeted resource matching.",
              "example": ""
            },
            {
              "name": "businessUnitId",
              "kind": "optional",
              "type": "string",
              "description": "Target business unit identifier for cost assignment. Alternative to tagName/tagValue approach for direct business unit allocation.",
              "example": ""
            },
            {
              "name": "label",
              "kind": "optional",
              "type": "string",
              "description": "Human-readable display name for rule management and identification. Used for administrative organization and rule tracking purposes.",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Detailed explanation of rule purpose and allocation logic. Provides context for rule configuration and business unit cost assignment.",
              "example": ""
            },
            {
              "name": "enabled",
              "kind": "optional",
              "type": "boolean",
              "description": "Rule activation status for automatic cost allocation processing. Controls whether rule participates in allocation execution sequence.",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.AutomaticMatchingRule.in",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Complete automatic FOCUS allocation rule configuration with system-generated metadata for cost assignment to business units based on resource tag matching.",
            "customType": "business_unit.focus_allocation.automatic.AutomaticMatchingRule.out",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "System-generated unique identifier for rule tracking. Required for rule updates, deletions, and position management in execution sequence.",
                "example": "0e63b938-6785-429b-a89d-c4164144fc88"
              },
              {
                "name": "provider",
                "kind": "required",
                "type": "string",
                "description": "Cloud provider for cost allocation filtering. Supported values include AWS, AZURE, GOOGLE_CLOUD for targeted rule application.",
                "modelRef": "#/components/schemas/focus.common.FocusProvider.out",
                "customType": "focus.common.FocusProvider.out",
                "schema": []
              },
              {
                "name": "predicate",
                "kind": "required",
                "type": "object",
                "description": "Matching conditions that determine when rule applies to cost records. Defines value matrix logic for resource identification.",
                "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.predicate.GroupKeyPredicate.out",
                "customType": "business_unit.focus_allocation.automatic.predicate.GroupKeyPredicate.out",
                "schema": [],
                "complexType": "oneOf",
                "complexItems": [
                  {
                    "name": "business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.out",
                    "description": "",
                    "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.out",
                    "schema": [
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string",
                        "description": "Predicate type identifier for value matrix matching logic. Always set to 'value_matrix' for matrix-based resource filtering conditions.",
                        "example": "",
                        "default": "value_matrix"
                      },
                      {
                        "name": "columns",
                        "kind": "required",
                        "type": "array",
                        "description": "FOCUS column names for matrix dimension headers. Defines resource attributes used for matching conditions in allocation rules.",
                        "example": "",
                        "itemType": "string",
                        "customType": "string[]",
                        "itemExample": "",
                        "itemDefault": ""
                      },
                      {
                        "name": "rows",
                        "kind": "required",
                        "type": "array",
                        "description": "Matrix row definitions containing value combinations for resource matching. Each row represents specific resource attribute criteria for rule application.",
                        "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.ValueMatrixRow.out",
                        "customType": "business_unit.focus_allocation.automatic.predicate.ValueMatrixPredicate.ValueMatrixRow.out[]",
                        "schema": [
                          {
                            "name": "values",
                            "kind": "required",
                            "type": "array",
                            "description": "Array of string values corresponding to matrix columns for resource matching. Each element matches position in predicate column array.",
                            "example": "",
                            "itemType": "string",
                            "customType": "string[]",
                            "itemExample": "",
                            "itemDefault": ""
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "name": "tagName",
                "kind": "optional",
                "type": "string",
                "description": "FOCUS tag key for cost allocation target. Specifies resource tag name used for business unit assignment mapping.",
                "example": ""
              },
              {
                "name": "tagValue",
                "kind": "optional",
                "type": "string",
                "description": "Specific FOCUS tag value to match for cost allocation. Must be used with tagName for targeted resource matching.",
                "example": ""
              },
              {
                "name": "businessUnitId",
                "kind": "optional",
                "type": "string",
                "description": "Target business unit identifier for cost assignment. Alternative to tagName/tagValue approach for direct business unit allocation.",
                "example": ""
              },
              {
                "name": "label",
                "kind": "optional",
                "type": "string",
                "description": "Human-readable display name for rule management and identification. Used for administrative organization and rule tracking purposes.",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Detailed explanation of rule purpose and allocation logic. Provides context for rule configuration and business unit cost assignment.",
                "example": ""
              },
              {
                "name": "enabled",
                "kind": "optional",
                "type": "boolean",
                "description": "Rule activation status for automatic cost allocation processing. Controls whether rule participates in allocation execution sequence.",
                "example": ""
              },
              {
                "name": "createTimeInMillis",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Rule creation timestamp in Unix time milliseconds. Tracks when automatic allocation rule was first established in system.",
                "example": 0
              },
              {
                "name": "updateTimeInMillis",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Rule modification timestamp in Unix time milliseconds. Tracks when automatic allocation rule configuration was last changed.",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/business_unit.focus_allocation.automatic.AutomaticMatchingRule.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "-L6OXLygW2Ggvy4tpcpua",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://app.amberflo.io/business-unit/focus-allocation/automatic/rule \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"provider\": \"\",\n     \"predicate\": {\n     \"type\": \"value_matrix\",\n     \"columns\": [],\n     \"rows\": [\n     {\n     \"values\": []\n     }\n     ]\n     }\n     }'"
        },
        {
          "id": "9MKiXOQPJhSZgMBBuB4lq",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"provider\": \"\",\n   \"predicate\": {\n      \"type\": \"value_matrix\",\n      \"columns\": [],\n      \"rows\": [\n         {\n            \"values\": []\n         }\n      ]\n   }\n});\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/business-unit/focus-allocation/automatic/rule\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "dc373HN52thtqBJtp5Jc_",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/business-unit/focus-allocation/automatic/rule\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"provider\": \"\",\n   \"predicate\": {\n      \"type\": \"value_matrix\",\n      \"columns\": [],\n      \"rows\": [\n         {\n            \"values\": []\n         }\n      ]\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Und56oIgKXSyYVyKN6Gfe",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/business-unit/focus-allocation/automatic/rule\"\n\npayload = json.dumps({\n   \"provider\": \"\",\n   \"predicate\": {\n      \"type\": \"value_matrix\",\n      \"columns\": [],\n      \"rows\": [\n         {\n            \"values\": []\n         }\n      ]\n   }\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "-L6OXLygW2Ggvy4tpcpua"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful request\n{\n  \"id\": \"0e63b938-6785-429b-a89d-c4164144fc88\",\n  \"provider\": \"\",\n  \"predicate\": {},\n  \"tagName\": \"\",\n  \"tagValue\": \"\",\n  \"businessUnitId\": \"\",\n  \"label\": \"\",\n  \"description\": \"\",\n  \"enabled\": false,\n  \"createTimeInMillis\": \"\",\n  \"updateTimeInMillis\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": "",
      "id": "YlF8OOmK8gFcHApaSh0VN"
    }
  ]
}