Cost Categories
Allows you to categorize based on business requirements and get a contextual view of your expenses.
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.
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns a Cost category object with all the cost and shared buckets, returns null if no Cost category exists for that particular identifier
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 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.
Bad Request
This is Failure entity as defied in Harness
Internal server error
A string text message whether the delete was successful or not. If the cost category is used in the perspective, the deletion will fail and it will send you the IDs of all the linked perspectives
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
Account Identifier for the Entity.
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns List of cost-category/cost-buckets
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
Given a Cost Category Id, find all Cost Categories that reference it in their rules
Bad Request
This is Failure entity as defied in Harness
Internal server error
Return LinkedBusinessMapping with Cost Category IDs and names that reference the given Cost Category
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"
}
]
}Given Cost Category Id, find out Perspectives where Cost Category is present in Rules or Group By
Bad Request
This is Failure entity as defied in Harness
Internal server error
Return list of perspectives corresponding to Cost Category Ids
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"
}
]
}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.
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns a List of Cost Categories
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 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.
^[^\d][^'"\\]*$Successfully created Cost Category with all cost buckets and shared costs
^[^\d][^'"\\]*$Bad Request - Invalid Cost Category definition
Internal server error
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 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.
^[^\d][^'"\\]*$Bad Request
This is Failure entity as defied in Harness
Internal server error
Successfully updated the 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?