---
title: "Create an allocation"
method: POST
path: "/analytics/v1/allocations"
tags: ["Allocations"]
---

# Create an allocation

`POST /analytics/v1/allocations`

Creates a new allocation.

## Request body

- CreateAllocationRequest — Request body for creating an allocation.
  - `name` string, required — Allocation name.
  - `description` string, required — Allocation description.
  - `rule` AllocationRule, nullable — Single allocation rule. Components can reference other existing allocation rules by using the "allocation_rule" dimension type.
    - `components` AllocationComponent[], required — List of allocation filter components.
      - `key` string, required — Key of an existing dimension. Examples: "billing_account_id", "country". When type is "allocation_rule", the key must be set to "allocation_rule". Use `GET /analytics/v1/dimensions` to retrieve all available dimensions.
      - `type` 'datetime' | 'fixed' | 'optional' | 'label' | 'tag' | 'project_label' | 'system_label' | 'allocation_rule' | 'gke' | 'gke_label', required — Dimension filter type for allocation rule components. See `DimensionsTypes` for per-value meanings. Allocation components do not support `allocation`, `attribution`, or `attribution_group` types.
      - `values` string[], required — Values to filter on. When type is "allocation_rule", the values are IDs of existing allocation rules.
      - `inverse` boolean — If true, all selected values will be excluded.
      - `inverse_selection` boolean — If true, all selected values will be excluded.
      - `includeNull` boolean — Include null values.
      - `caseInsensitive` boolean — If true, string matching is case-insensitive. Effective only for starts_with, ends_with, and contains modes; rejected otherwise.
      - `mode` 'is' | 'starts_with' | 'ends_with' | 'contains' | 'regexp', required — Filter mode to apply. When type is "allocation_rule", only "is" and "contains" modes are supported.
    - `formula` string, required — Formula for combining components (A is the first component, B is the second one, etc.).
  - `rules` GroupAllocationRule[]
    - `name` string — Name of the allocation rule.
    - `description` string — Description of the allocation rule.
    - `action` 'create' | 'update' | 'select', required — Action to perform with this rule.
    - `id` string — ID of existing allocation (required for 'update' or 'select' action).
    - `components` AllocationComponent[] — List of allocation filter components (required for 'create' or 'update' action). Can include components of type "allocation_rule" to reference existing allocation rules.
      - `key` string, required — Key of an existing dimension. Examples: "billing_account_id", "country". When type is "allocation_rule", the key must be set to "allocation_rule". Use `GET /analytics/v1/dimensions` to retrieve all available dimensions.
      - `type` 'datetime' | 'fixed' | 'optional' | 'label' | 'tag' | 'project_label' | 'system_label' | 'allocation_rule' | 'gke' | 'gke_label', required — Dimension filter type for allocation rule components. See `DimensionsTypes` for per-value meanings. Allocation components do not support `allocation`, `attribution`, or `attribution_group` types.
      - `values` string[], required — Values to filter on. When type is "allocation_rule", the values are IDs of existing allocation rules.
      - `inverse` boolean — If true, all selected values will be excluded.
      - `inverse_selection` boolean — If true, all selected values will be excluded.
      - `includeNull` boolean — Include null values.
      - `caseInsensitive` boolean — If true, string matching is case-insensitive. Effective only for starts_with, ends_with, and contains modes; rejected otherwise.
      - `mode` 'is' | 'starts_with' | 'ends_with' | 'contains' | 'regexp', required — Filter mode to apply. When type is "allocation_rule", only "is" and "contains" modes are supported.
    - `formula` string — Formula for combining components (A is the first component, B is the second one, etc.)
  - `unallocatedCosts` string, nullable — Custom label for values that do not fit into allocation (required for group type allocation).
  - `folderId` string — Identifier of the folder that contains the allocation. Set to "root" if the allocation is at the top level (not in a folder).

## Response `200`

OK - The request succeeded.

- Allocation — Allocation object, including rules and metadata.
  - `id` string — Allocation ID.
  - `name` string — Allocation name.
  - `description` string — Allocation description.
  - `type` string — Type of allocation (preset or custom).
  - `allocationType` 'single' | 'group' — Composition type of allocation.
  - `createTime` integer — The time when the allocation was created (in UNIX timestamp).
  - `updateTime` integer — Last time the allocation was modified (in UNIX timestamp).
  - `anomalyDetection` boolean, nullable — Whether anomaly detection is enabled for this allocation.
  - `rule` AllocationRule, nullable — Single allocation rule. Components can reference other existing allocation rules by using the "allocation_rule" dimension type.
    - `components` AllocationComponent[], required — List of allocation filter components.
      - `key` string, required — Key of an existing dimension. Examples: "billing_account_id", "country". When type is "allocation_rule", the key must be set to "allocation_rule". Use `GET /analytics/v1/dimensions` to retrieve all available dimensions.
      - `type` 'datetime' | 'fixed' | 'optional' | 'label' | 'tag' | 'project_label' | 'system_label' | 'allocation_rule' | 'gke' | 'gke_label', required — Dimension filter type for allocation rule components. See `DimensionsTypes` for per-value meanings. Allocation components do not support `allocation`, `attribution`, or `attribution_group` types.
      - `values` string[], required — Values to filter on. When type is "allocation_rule", the values are IDs of existing allocation rules.
      - `inverse` boolean — If true, all selected values will be excluded.
      - `inverse_selection` boolean — If true, all selected values will be excluded.
      - `includeNull` boolean — Include null values.
      - `caseInsensitive` boolean — If true, string matching is case-insensitive. Effective only for starts_with, ends_with, and contains modes; rejected otherwise.
      - `mode` 'is' | 'starts_with' | 'ends_with' | 'contains' | 'regexp', required — Filter mode to apply. When type is "allocation_rule", only "is" and "contains" modes are supported.
    - `formula` string, required — Formula for combining components (A is the first component, B is the second one, etc.).
  - `rules` GroupAllocationRule[]
    - `name` string — Name of the allocation rule.
    - `description` string — Description of the allocation rule.
    - `action` 'create' | 'update' | 'select', required — Action to perform with this rule.
    - `id` string — ID of existing allocation (required for 'update' or 'select' action).
    - `components` AllocationComponent[] — List of allocation filter components (required for 'create' or 'update' action). Can include components of type "allocation_rule" to reference existing allocation rules.
      - `key` string, required — Key of an existing dimension. Examples: "billing_account_id", "country". When type is "allocation_rule", the key must be set to "allocation_rule". Use `GET /analytics/v1/dimensions` to retrieve all available dimensions.
      - `type` 'datetime' | 'fixed' | 'optional' | 'label' | 'tag' | 'project_label' | 'system_label' | 'allocation_rule' | 'gke' | 'gke_label', required — Dimension filter type for allocation rule components. See `DimensionsTypes` for per-value meanings. Allocation components do not support `allocation`, `attribution`, or `attribution_group` types.
      - `values` string[], required — Values to filter on. When type is "allocation_rule", the values are IDs of existing allocation rules.
      - `inverse` boolean — If true, all selected values will be excluded.
      - `inverse_selection` boolean — If true, all selected values will be excluded.
      - `includeNull` boolean — Include null values.
      - `caseInsensitive` boolean — If true, string matching is case-insensitive. Effective only for starts_with, ends_with, and contains modes; rejected otherwise.
      - `mode` 'is' | 'starts_with' | 'ends_with' | 'contains' | 'regexp', required — Filter mode to apply. When type is "allocation_rule", only "is" and "contains" modes are supported.
    - `formula` string — Formula for combining components (A is the first component, B is the second one, etc.)
  - `unallocatedCosts` string, nullable — Custom label for values that do not fit into allocation (required for group type allocation).
  - `folderId` string — Identifier of the folder that contains the allocation. Set to "root" if the allocation is at the top level (not in a folder).

## Other responses

- `400` — Bad Request - The server cannot process the request, often due to a malformed request.
- `401` — Unauthorized - Invalid API key.
- `403` — Forbidden - The client is not authorized to perform the request.
- `404` — Not Found - The requested resource does not exist.

---

[API](https://skmtc.dev/doit/apis/doit-cloud-intelligence.md) · [All operations](https://skmtc.dev/doit/apis/doit-cloud-intelligence/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doit/doit-cloud-intelligence/revisions/9416402fc119/schema)
