For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Trebellar Platform
DocsGuidesAPI Reference
DocsGuidesAPI Reference
  • API Reference
    • Introduction
  • API Resources
      • POSTAdd cost lines in batch
      • GETList normalized costs
      • DELDelete cost line
      • PATCHUpdate a cost line
      • POSTBind a cost line to an asset(s)
      • POSTUnbind a cost line to an asset(s)
      • GETList Cost Categories
      • GETGet Cost Category
      • DELDelete Cost Category
      • PATCHUpdate Cost Category
      • POSTAdd Cost Category
Trebellar Platform
LogoLogo
API ResourcesCosts

Update a cost line

||View as Markdown|
PATCH
https://api.trebellar.app/api/v2/costs/line/:id
PATCH
/api/v2/costs/line/:id
1import { TrebellarApiClient } from "@trebellar/api-sdk";
2
3async function main() {
4 const client = new TrebellarApiClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.costs.updateCostLine("eid:sfo-001", {
8 value: 5170,
9 category: "facilities.utilities",
10 });
11}
12main();
1{
2 "costLine": {
3 "name": " Utilities",
4 "cadence": "COST_LINE_CADENCE_ONE_TIME",
5 "type": "COST_LINE_TYPE_ACTUAL",
6 "periodStartAt": 1756710000000,
7 "periodEndAt": 1759215600000,
8 "id": "c123456",
9 "categoryPath": "facilities.utilities",
10 "value": 5170,
11 "createdAt": 1767340800000
12 }
13}
Was this page helpful?
Previous

Delete cost line

Next

Bind a cost line to an asset(s)

Built with

Authentication

X-Trebellar-Api-Keystring
API Key authentication via header
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired

A unique identifier for an asset. Can be an AssetId or an ExternalId. ExternalIds are denoted by the “eid:” prefix.

Request

This endpoint expects an object.
namestringOptional
cadence"COST_LINE_CADENCE_UNKNOWN" or "COST_LINE_CADENCE_ONE_TIME" or "COST_LINE_CADENCE_MONTHLY" or "COST_LINE_CADENCE_QUARTERLY" or "COST_LINE_CADENCE_TWICE_A_YEAR" or "COST_LINE_CADENCE_ANNUAL"Optional
type"COST_LINE_TYPE_UNKNOWN" or "COST_LINE_TYPE_ACTUAL" or "COST_LINE_TYPE_BUDGET" or "COST_LINE_TYPE_FORECAST"Optional
periodStartAtdoubleOptional
periodEndAtdoubleOptional
valuedoubleOptional
notesstringOptional
tagstringOptional
currencystringOptional
categorystringOptional

Response

Cost line updated successfully
costLineobject
A stored CostLine object

Errors

400
Bad Request Error
500
Internal Server Error