Allocations API
Programmatically manage Allocations that you use across DoiT Cloud Intelligence™ for reports, budgets, alerts, anomalies, and more.
Allocations API
Programmatically manage Allocations that you use across DoiT Cloud Intelligence™ for reports, budgets, alerts, anomalies, and more.
Allocations let you group and segment cloud costs using allocation rules. These rules define which resources belong to each business unit, team, product, or environment, and can also split shared costs between multiple groupings (group allocations). (DoiT Help Center)
Required permissions
- To view allocations, your API key must belong to a user with Cloud Analytics User or higher.
- To create, update, or delete allocations, your API key must belong to a user who can manage Allocations in the DoiT console (typically Cloud Analytics Admin or a similar role).
- For details, see the Roles and permissions documentation in the Help Center.
Operations
GET /analytics/v1/allocationsLists allocations.GET /analytics/v1/allocations/{id}Retrieves a single allocation.POST /analytics/v1/allocationsCreates an allocation.PATCH /analytics/v1/allocations/{id}Updates an allocation.DELETE /analytics/v1/allocations/{id}Deletes an allocation (with validation if it is in use). (DoiT Cloud Intelligence)
Concepts
Allocations in the API follow the same model as in the console.
-
Allocation rules – Each allocation is defined by one or more allocation rules. A rule groups cloud resources using dimensions, labels, and tags (for example, environment, project, team, or cost center). (DoiT Help Center)
-
Single-rule allocations – A single allocation rule that defines one grouping (for example, “Product A”, “Team X”, “Environment: production”). These can be used to:
- Scope Cloud Analytics reports.
- Drive custom metrics.
- Scope alerts, budgets, anomaly monitors, digests, and organizations. (DoiT Help Center)
-
Group allocations – A collection of rules that split shared or untagged costs across multiple groupings (for example, several teams sharing the same infrastructure). Group allocations:
- Always include a built-in
Unallocatedrule to capture unmatched data. - Require at least one additional rule besides
Unallocated. - Assign shared data to the first matching rule in the group. (DoiT Help Center)
- Always include a built-in
The Allocations API exposes these objects so you can create and manage them from CI/CD, internal tools, or other systems.
Schema
The exact schemas are defined in the OpenAPI spec under:
AllocationListItemAllocationCreateAllocationRequestUpdateAllocationRequestNewAllocationResponseAllocationDeleteValidation(DoiT Cloud Intelligence)
Below is what you will typically see in allocation responses.
Common properties
These properties appear on list items and on the full Allocation object.
| Property | Type | Description |
|---|---|---|
id | string | Allocation ID. Use this in the GET, PATCH, and DELETE path. |
name | string | Human-readable name of the allocation. Used in filters and UI. |
description | string | Optional description of the allocation’s purpose. |
type | string | Allocation type. Distinguishes between different allocation strategies (for example, single-rule vs group allocations) as described in the Allocations Help Center. |
owner | string | User or identity that owns the allocation. Used in filtering and permissions. |
createTime | int64 | Time when the allocation was created, in milliseconds since the Unix epoch. |
updateTime | int64 | Time when the allocation was last updated, in milliseconds since the Unix epoch. (DoiT Cloud Intelligence) |
The full Allocation object also includes a nested configuration that defines allocation rules and matching conditions (dimensions, labels, tags, membership in group allocations, and the built-in Unallocated rule). Refer to the API reference schemas for the full shape of these nested fields.
List response
GET /analytics/v1/allocations returns a paginated collection:
| Property | Type | Description |
|---|---|---|
pageToken | string | Token from a previous response, used to fetch the next page. |
rowCount | integer | Total number of allocations in the result set. |
allocations | Allocation[] | Array of allocation list items. (DoiT Cloud Intelligence) |
List allocations
The listAllocations operation returns allocations your account has access to, ordered in reverse chronological order by default. (DoiT Cloud Intelligence)
Query parameters
| Parameter | Type | Description |
|---|---|---|
maxResults | integer | Maximum number of results to return in a single page. If not set, a default is applied. Uses the shared pagination behavior described in MaxResults and Pagination. |
pageToken | string | Token from a previous response, used to fetch the next page of results. |
filter | string | Filter expression. Valid fields: type, owner, name. Example: type:custom. Multiple filters can be combined with | (pipe). See Filters for syntax details. |
sortBy | string | Field used to sort the results. One of id, name, owner, description, type, createTime, updateTime. |
sortOrder | string | Sort direction. Reuses the common sortOrder parameter, typically asc or desc. (DoiT Cloud Intelligence) |
Sample request
curl -X GET \
'https://api.doit.com/analytics/v1/allocations?maxResults=20&filter=owner:[email protected]' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'accept: application/json'Sample response body (truncated)
This example focuses on top-level metadata; the actual API may return additional nested configuration fields.
{
"pageToken": "YWxsb2NhdGlvbnNfcGFnZV8y",
"rowCount": 2,
"allocations": [
{
"id": "al_01JB2C7H0GS0J9YYQ0X49DYQ4Z",
"name": "Prod – Web team",
"description": "All production web workloads owned by the Web team",
"type": "single_rule",
"owner": "[email protected]",
"createTime": 1732479600000,
"updateTime": 1732479600000
},
{
"id": "al_01JB2C8T4GDC3W4YWK3W0VH8KJ",
"name": "Shared infrastructure – group allocation",
"description": "Shared Kubernetes and networking split between teams",
"type": "group",
"owner": "[email protected]",
"createTime": 1732393200000,
"updateTime": 1732566000000
}
]
}Retrieve an allocation
The getAllocation operation returns the full configuration of an allocation, including its rules and (for group allocations) the group structure. (DoiT Cloud Intelligence)
Path parameter
| Parameter | Type | Description |
|---|---|---|
id | string | Allocation ID. |
Sample request
curl -X GET \
'https://api.doit.com/analytics/v1/allocations/al_01JB2C7H0GS0J9YYQ0X49DYQ4Z' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'accept: application/json'Sample response body (skeleton)
The real response includes the full rule configuration. Only the high-level metadata is shown here; consult the API reference schema for all nested fields.
{
"id": "al_01JB2C7H0GS0J9YYQ0X49DYQ4Z",
"name": "Prod – Web team",
"description": "All production web workloads owned by the Web team",
"type": "single_rule",
"owner": "[email protected]",
"createTime": 1732479600000,
"updateTime": 1732479600000,
"config": {
"...": "Allocation rules, dimensions, labels, tags and other settings"
}
}Create an allocation
The createAllocation operation creates a new allocation. (DoiT Cloud Intelligence)
The request body uses the CreateAllocationRequest schema. At a high level, you provide:
- Main metadata (name, description, type).
- One or more allocation rules, each defined by conditions on dimensions, labels, and tags.
- For group allocations, the ordered list of member rules and the built-in
Unallocatedrule.
Exact field names and nested structures are defined in the OpenAPI schema.
Sample request (conceptual)
The following example illustrates the intent. It is schematic and does not list all required fields. Use the API Reference or the downloaded OpenAPI spec for the full schema.
curl -X POST \
'https://api.doit.com/analytics/v1/allocations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Prod – Web team",
"description": "All production web workloads owned by the Web team",
"type": "single_rule",
"rules": [
{
"name": "Prod web",
"conditions": {
"dimensions": [
{
"id": "environment",
"type": "label",
"values": ["prod"]
}
]
}
}
]
}'Sample response body (skeleton)
The NewAllocationResponse schema wraps the created allocation. (DoiT Cloud Intelligence)
{
"allocation": {
"id": "al_01JB2C7H0GS0J9YYQ0X49DYQ4Z",
"name": "Prod – Web team",
"description": "All production web workloads owned by the Web team",
"type": "single_rule",
"owner": "[email protected]",
"createTime": 1732479600000,
"updateTime": 1732479600000,
"config": {
"...": "Allocation rules as created"
}
}
}Update an allocation
The updateAllocation operation updates an existing allocation by ID. Use this to change metadata, adjust rules, or convert an allocation into or out of a group allocation, depending on your configuration. (DoiT Cloud Intelligence)
Path parameter
| Parameter | Type | Description |
|---|---|---|
id | string | Allocation ID. |
The request body follows the UpdateAllocationRequest schema and supports updating mutable fields such as name, description, type, and rules. Some changes may be restricted if the allocation is used by other resources.
Sample request (conceptual)
curl -X PATCH \
'https://api.doit.com/analytics/v1/allocations/al_01JB2C7H0GS0J9YYQ0X49DYQ4Z' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Prod – Web and API team",
"description": "Production workloads for the Web and API team"
}'Sample response body (skeleton)
{
"allocation": {
"id": "al_01JB2C7H0GS0J9YYQ0X49DYQ4Z",
"name": "Prod – Web and API team",
"description": "Production workloads for the Web and API team",
"type": "single_rule",
"owner": "[email protected]",
"createTime": 1732479600000,
"updateTime": 1732566000000,
"config": {
"...": "Updated allocation rules"
}
}
}Delete an allocation
The deleteAllocation operation permanently deletes an allocation. (DoiT Cloud Intelligence)
Path parameter
| Parameter | Type | Description |
|---|---|---|
id | string | Allocation ID. |
Behavior
- On success, returns HTTP
200with no body. - If the allocation is used by other resources (for example, reports, budgets, alerts, anomalies, or digests), the API may return HTTP
409 Conflictwith a payload describing the dependencies via theAllocationDeleteValidationschema. You must remove or reconfigure these dependencies before retrying the deletion. (DoiT Cloud Intelligence)
Sample request
curl -X DELETE \
'https://api.doit.com/analytics/v1/allocations/al_01JB2C7H0GS0J9YYQ0X49DYQ4Z' \
-H 'Authorization: Bearer YOUR_API_KEY'Recommended usage patterns
Typical ways to use the Allocations API in FinOps and CloudOps workflows:
-
Provision allocations as part of onboarding When you onboard a new team, product, or customer, automatically create corresponding allocations and wire them into reports, dashboards, budgets, and alerts so stakeholders immediately see their scoped view of spend.
-
Keep allocations in sync with org structure Drive allocation definitions from your HRIS or CMDB. When teams merge or split, update allocations programmatically so that all dependent analytics, budgets, and anomaly monitors follow the new structure.
-
Model shared-cost strategies Use group allocations to define and evolve your shared-cost strategy (for example, networking, shared Kubernetes clusters, or central platforms). Automate updates as you refine the rules and ensure the Unallocated bucket stays small. (DoiT Help Center)
-
Integrate with tagging and data quality workflows Combine allocations with tag enforcement and data quality checks. When new tags or labels are introduced, update allocation rules so that cost and usage are still mapped correctly without manual work in the console.
For authentication, rate limits, filter syntax, and pagination, reuse the same concepts described in the generic DoiT Platform API documentation (Get Started, Filters, Resource IDs, and MaxResults and Pagination). (DoiT Cloud Intelligence)
Updated 3 days ago
