---
title: Query automatic cost allocation results by tag
slug: reference/query-automatic-cost-allocation-results-by-tag
docTags: 
createdAt: 2025-07-03T16:20:35.017Z
---

{
  "id": "SzO3fc1NB_yPYUCNRkJoY",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.amberflo.io/business-unit/focus-allocation/automatic/query",
    "servers": [
      {
        "url": "https://app.amberflo.io/business-unit/focus-allocation/automatic/query"
      }
    ],
    "name": "Query automatic cost allocation results by tag",
    "description": "<p>Queries FOCUS cost amounts allocated to business units through automatic allocation rules based on resource tags and metadata.\nAnalyzes current allocation status showing which FOCUS values are assigned and which remain unallocated.</p>\n<p>Required parameters:</p>\n<ul>\n<li><code>columns</code>: Minimum set of FOCUS columns to include in allocation analysis</li>\n</ul>\n<p>Optional parameters:</p>\n<ul>\n<li><code>tagName</code>: Specific FOCUS tag name to analyze for business unit allocations</li>\n</ul>\n<p>Returns allocation analysis with assigned values mapped to business units and unassigned values available for rule configuration.\nIncludes metadata about cost amounts, row counts, and tag value relationships for allocation management.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "tagName",
          "type": "string",
          "description": "FOCUS tag name to analyze for automatic allocation status. Filters allocation analysis to specific tag key used for business unit cost assignment."
        },
        {
          "kind": "required",
          "name": "columns",
          "type": "array",
          "description": "Minimum set of FOCUS column names to include in allocation analysis. Additional columns referenced by automatic rules are automatically included.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        }
      ],
      "bodyDataParameters": [],
      "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": "Response showing FOCUS value allocation status for automatic cost assignment. Separates values already assigned to business units from unassigned values requiring attention.",
            "customType": "business_unit.details.AutoAllocatedFocusValuesResponse.out",
            "schema": [
              {
                "name": "tagName",
                "kind": "optional",
                "type": "string",
                "description": "FOCUS tag name being analyzed for automatic allocation rules. Represents the column key used for cost assignment and business unit mapping.",
                "example": ""
              },
              {
                "name": "columns",
                "kind": "optional",
                "type": "array",
                "description": "Array of FOCUS column names included in the allocation analysis. Contains minimum requested columns plus any additional columns referenced by automatic rules.",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "assignedValues",
                "kind": "optional",
                "type": "array",
                "description": "FOCUS values already assigned to business units through automatic allocation rules. Each entry includes value metadata and business unit assignment details.",
                "modelRef": "#/components/schemas/business_unit.details.AutoAllocatedFocusValuesResponse.AssignedValueMetadata.out",
                "customType": "business_unit.details.AutoAllocatedFocusValuesResponse.AssignedValueMetadata.out[]",
                "schema": [
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "array",
                    "description": "Array of FOCUS column values representing resource attributes assigned to business unit through automatic allocation rules.",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "rowCount",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Number of cost records associated with this assigned value combination. Indicates allocation coverage for business unit tracking.",
                    "example": 0
                  },
                  {
                    "name": "totalBilledCost",
                    "kind": "optional",
                    "type": "number",
                    "description": "Total cost amount allocated to business unit for this value combination. Represents financial impact of automatic allocation rules.",
                    "example": ""
                  },
                  {
                    "name": "tagValue",
                    "kind": "optional",
                    "type": "string",
                    "description": "Specific tag value used for cost assignment to business unit. Corresponds to FOCUS tag used in allocation logic.",
                    "example": ""
                  }
                ]
              },
              {
                "name": "unassignedValues",
                "kind": "optional",
                "type": "array",
                "description": "FOCUS values not yet assigned to any business unit. Available for manual assignment or additional automatic rule configuration.",
                "modelRef": "#/components/schemas/focus.query.ColumnValueMetadata.out",
                "customType": "focus.query.ColumnValueMetadata.out[]",
                "schema": [
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "array",
                    "description": "Ordered list of column values forming distinct tuple combination for queried FOCUS column names with\nnull values represented as null elements in array\n",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "rowCount",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Total number of records in FOCUS dataset matching this specific column value combination for\noccurrence frequency analysis\n",
                    "example": 0
                  },
                  {
                    "name": "totalBilledCost",
                    "kind": "optional",
                    "type": "number",
                    "description": "Sum of all billed costs for records matching this column value combination rounded to\ntwo decimal places for cost impact analysis\n",
                    "example": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/business_unit.details.AutoAllocatedFocusValuesResponse.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "Pg5o07abCMa3zOJg5vi5Z",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://app.amberflo.io/business-unit/focus-allocation/automatic/query?columns=array' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "f73eQTJgjUjEKh9FL-BeQ",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/business-unit/focus-allocation/automatic/query?columns=array\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "5pmNlafUpAuMmBvy0OX-K",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/business-unit/focus-allocation/automatic/query?columns=array\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "581lTUci8LO0B2KCZWC29",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/business-unit/focus-allocation/automatic/query?columns=array\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Pg5o07abCMa3zOJg5vi5Z"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful request\n{\n  \"tagName\": \"\",\n  \"columns\": [\n    \"\"\n  ],\n  \"assignedValues\": [\n    {\n      \"value\": [\n        \"\"\n      ],\n      \"rowCount\": \"\",\n      \"totalBilledCost\": 0,\n      \"tagValue\": \"\"\n    }\n  ],\n  \"unassignedValues\": [\n    {\n      \"value\": [\n        \"\"\n      ],\n      \"rowCount\": \"\",\n      \"totalBilledCost\": 0\n    }\n  ]\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": "",
      "id": "T4GlMNF-llokuzbGFBvNh"
    }
  ]
}