Update a cost record
PATCH
/api/v1/costs/{id}
const url = 'https://example.com/api/v1/costs/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"linkId":"550e8400-e29b-41d4-a716-446655440000","breakdownKey":"sub_id_2","breakdownValue":"ad_12345","periodStart":"2026-03-01","periodEnd":"2026-03-01","amount":42.5,"currency":"USD","source":"manual","notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/api/v1/costs/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "linkId": "550e8400-e29b-41d4-a716-446655440000", "breakdownKey": "sub_id_2", "breakdownValue": "ad_12345", "periodStart": "2026-03-01", "periodEnd": "2026-03-01", "amount": 42.5, "currency": "USD", "source": "manual", "notes": "example" }'Authorizations
Заголовок раздела «Authorizations»Parameters
Заголовок раздела «Parameters»Path Parameters
Заголовок раздела «Path Parameters»id
required
string
Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
linkId
Link this cost applies to. Omit for a workspace-wide (unallocated) cost.
string
Example
550e8400-e29b-41d4-a716-446655440000breakdownKey
Breakdown dimension key, e.g. “sub_id_2”
string
Example
sub_id_2breakdownValue
Breakdown dimension value, e.g. “ad_12345”
string
Example
ad_12345periodStart
Period start (date)
string
Example
2026-03-01periodEnd
Period end (date)
string
Example
2026-03-01amount
number
Example
42.5currency
string
Example
USDsource
string
notes
string
Responses
Заголовок раздела «Responses»Media typeapplication/json
object
id
required
string
linkId
object
breakdownKey
object
breakdownValue
object
periodStart
required
string
periodEnd
required
string
amount
required
number
currency
required
string
source
required
string
notes
object
createdAt
required
string
updatedAt
required
string
Example generated
{ "id": "example", "linkId": {}, "breakdownKey": {}, "breakdownValue": {}, "periodStart": "example", "periodEnd": "example", "amount": 1, "currency": "example", "source": "example", "notes": {}, "createdAt": "example", "updatedAt": "example"}