Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cost Categories

Allows you to categorize based on business requirements and get a contextual view of your expenses.

Fetch details of a Cost category

get

Retrieve a specific Cost Category by its unique identifier. Returns the complete Cost Category configuration including all cost buckets, shared costs, and rule definitions. When overlap validation is COMPLETE, costBucketOverlapStats lists per-bucket cost, row count, overlap cost, and overlapping buckets. Those stats are not embedded on the cost buckets.

Path parameters
idstringRequired
Query parameters
accountIdentifierstringOptional
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/business-mapping/{id}
GET /business-mapping/{id} HTTP/1.1
Host: app.harness.io
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete a Cost category

delete

Delete a Cost Category by its unique identifier. The deletion will fail if the Cost Category is currently used in any Perspectives. Returns a list of linked Perspectives if deletion is blocked.

Path parameters
idstringRequired
Query parameters
accountIdentifierstring · min: 1 · max: 2147483647Required
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/business-mapping/{id}
DELETE /business-mapping/{id}?accountIdentifier=text HTTP/1.1
Host: app.harness.io
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get (cost-categories)/(cost buckets) for recommendation filter panel

get

Get (cost-categories)/(cost buckets) for recommendation filter panel

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

costCategorystringOptional
searchstringOptional
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/business-mapping/filter-panel
GET /business-mapping/filter-panel?accountIdentifier=text HTTP/1.1
Host: app.harness.io
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Return LinkedBusinessMapping containing Cost Category IDs and names that reference the given Cost Category

post

Given a Cost Category Id, find all Cost Categories that reference it in their rules

Path parameters
idstringRequired
Query parameters
accountIdentifierstringRequired
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/business-mapping/linkedBusinessMapping/{id}
POST /business-mapping/linkedBusinessMapping/{id}?accountIdentifier=text HTTP/1.1
Host: app.harness.io
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Return list of perspectives corresponding to Cost Category Ids

post

Given Cost Category Id, find out Perspectives where Cost Category is present in Rules or Group By

Query parameters
accountIdentifierstringOptional
Bodystring[]
string[]Optional
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/business-mapping/linkedPerspectives
POST /business-mapping/linkedPerspectives HTTP/1.1
Host: app.harness.io
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Return details of all the Cost categories

get

List all Cost Categories for your account with support for search, sorting, and pagination. Use this endpoint to browse and discover existing Cost Categories and their configurations. Each item includes hasOverlap: true when the last completed validation found overlapping buckets, false when it found none, and absent until validation has completed.

Query parameters
accountIdentifierstringOptional
searchKeystringOptional
sortTypestring · enumOptionalPossible values:
sortOrderstring · enumOptionalPossible values:
limitinteger · int32Optional
offsetinteger · int32Optional
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/business-mapping
GET /business-mapping HTTP/1.1
Host: app.harness.io
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Create a Cost Category

post

Create a Cost Category to organize and allocate cloud and AI costs based on your business structure. Define custom rules and cost buckets to automatically categorize expenses by teams, projects, environments, or any business dimension. Cost Categories enable accurate cost allocation, chargeback, and financial reporting across your organization.

Query parameters
accountIdentifierstringOptional
Body
uuidstringOptional
namestring · min: 1 · max: 32RequiredPattern: ^[^\d][^'"\\]*$
accountIdstringRequired
overlapValidationStatestring · enumOptionalPossible values:
hasOverlapbooleanOptional
overlapValidationInProgressbooleanOptional
overlapValidationStartedAtinteger · int64Optional
supportsTagNormalizationbooleanOptional
createdAtinteger · int64Optional
lastUpdatedAtinteger · int64Optional
Responses
200

Successfully created Cost Category with all cost buckets and shared costs

application/json
uuidstringOptional
namestring · min: 1 · max: 32RequiredPattern: ^[^\d][^'"\\]*$
accountIdstringRequired
overlapValidationStatestring · enumOptionalPossible values:
hasOverlapbooleanOptional
overlapValidationInProgressbooleanOptional
overlapValidationStartedAtinteger · int64Optional
supportsTagNormalizationbooleanOptional
createdAtinteger · int64Optional
lastUpdatedAtinteger · int64Optional
post/business-mapping
POST /business-mapping HTTP/1.1
Host: app.harness.io
Content-Type: application/json
Accept: */*
Content-Length: 286

{
  "name": "Engineering Teams",
  "accountId": "acc_xyz789",
  "costBuckets": [
    {
      "name": "Backend Team",
      "rules": [
        {
          "conditions": [
            {
              "type": "LABEL",
              "key": "team",
              "value": "backend"
            }
          ]
        }
      ]
    },
    {
      "name": "Frontend Team",
      "rules": [
        {
          "conditions": [
            {
              "type": "LABEL",
              "key": "team",
              "value": "frontend"
            }
          ]
        }
      ]
    }
  ],
  "sharedCosts": []
}
{
  "uuid": "text",
  "name": "text",
  "accountId": "text",
  "costTargets": [
    {
      "name": "text",
      "rules": [
        {
          "viewConditions": [
            {
              "type": "text"
            }
          ]
        }
      ]
    }
  ],
  "sharedCosts": [
    {
      "name": "text",
      "rules": [
        {
          "viewConditions": [
            {
              "type": "text"
            }
          ]
        }
      ],
      "strategy": "EQUAL",
      "splits": [
        {
          "costTargetName": "text",
          "percentageContribution": 1
        }
      ]
    }
  ],
  "unallocatedCost": {
    "strategy": "DISPLAY_NAME",
    "label": "text",
    "sharingStrategy": "EQUAL",
    "splits": [
      {
        "costTargetName": "text",
        "percentageContribution": 1
      }
    ]
  },
  "dataSources": [
    "CLUSTER"
  ],
  "overlapValidationState": "NOT_VALIDATED",
  "hasOverlap": true,
  "overlapValidationInProgress": true,
  "overlapValidationStartedAt": 1,
  "costBucketOverlapStats": [
    {
      "costBucketRef": {
        "uuid": "text",
        "name": "text",
        "shared": true
      },
      "cost": 1,
      "rows": 1,
      "overlapCost": 1,
      "overlappingBuckets": [
        {
          "uuid": "text",
          "name": "text",
          "shared": true
        }
      ]
    }
  ],
  "supportsTagNormalization": true,
  "createdAt": 1,
  "lastUpdatedAt": 1,
  "createdBy": {
    "uuid": "text",
    "name": "text",
    "email": "text",
    "externalUserId": "text"
  },
  "lastUpdatedBy": {
    "uuid": "text",
    "name": "text",
    "email": "text",
    "externalUserId": "text"
  }
}

Update a Cost category

put

Update an existing Cost Category configuration. Modify cost buckets, shared costs, rules, or rename the Cost Category. The update is identified by the UUID in the request body.

Query parameters
accountIdentifierstringOptional
Body
uuidstringOptional
namestring · min: 1 · max: 32RequiredPattern: ^[^\d][^'"\\]*$
accountIdstringRequired
overlapValidationStatestring · enumOptionalPossible values:
hasOverlapbooleanOptional
overlapValidationInProgressbooleanOptional
overlapValidationStartedAtinteger · int64Optional
supportsTagNormalizationbooleanOptional
createdAtinteger · int64Optional
lastUpdatedAtinteger · int64Optional
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/business-mapping
PUT /business-mapping HTTP/1.1
Host: app.harness.io
Content-Type: application/json
Accept: */*
Content-Length: 1268

{
  "uuid": "text",
  "name": "text",
  "accountId": "text",
  "costTargets": [
    {
      "name": "text",
      "rules": [
        {
          "viewConditions": [
            {
              "type": "text"
            }
          ]
        }
      ]
    }
  ],
  "sharedCosts": [
    {
      "name": "text",
      "rules": [
        {
          "viewConditions": [
            {
              "type": "text"
            }
          ]
        }
      ],
      "strategy": "EQUAL",
      "splits": [
        {
          "costTargetName": "text",
          "percentageContribution": 1
        }
      ]
    }
  ],
  "unallocatedCost": {
    "strategy": "DISPLAY_NAME",
    "label": "text",
    "sharingStrategy": "EQUAL",
    "splits": [
      {
        "costTargetName": "text",
        "percentageContribution": 1
      }
    ]
  },
  "dataSources": [
    "CLUSTER"
  ],
  "overlapValidationState": "NOT_VALIDATED",
  "hasOverlap": true,
  "overlapValidationInProgress": true,
  "overlapValidationStartedAt": 1,
  "costBucketOverlapStats": [
    {
      "costBucketRef": {
        "uuid": "text",
        "name": "text",
        "shared": true
      },
      "cost": 1,
      "rows": 1,
      "overlapCost": 1,
      "overlappingBuckets": [
        {
          "uuid": "text",
          "name": "text",
          "shared": true
        }
      ]
    }
  ],
  "supportsTagNormalization": true,
  "createdAt": 1,
  "lastUpdatedAt": 1,
  "createdBy": {
    "uuid": "text",
    "name": "text",
    "email": "text",
    "externalUserId": "text"
  },
  "lastUpdatedBy": {
    "uuid": "text",
    "name": "text",
    "email": "text",
    "externalUserId": "text"
  },
  "costTargetsWithUUID": [
    {
      "name": "text",
      "rules": [
        {
          "viewConditions": [
            {
              "type": "text"
            }
          ]
        }
      ]
    }
  ],
  "sharedCostsWithUUID": [
    {
      "name": "text",
      "rules": [
        {
          "viewConditions": [
            {
              "type": "text"
            }
          ]
        }
      ],
      "strategy": "EQUAL",
      "splits": [
        {
          "costTargetName": "text",
          "percentageContribution": 1
        }
      ]
    }
  ]
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Last updated

Was this helpful?