Costfluent Public API

List budgets

GET
https://api.costfluent.com
/v1/budgets
Bearer (API token)

Returns all budgets, optionally filtered by workspace.

Needs a token with viewBudgets; a workspace token lists its own workspace only.

List budgets › query Parameters

workspaceId
​
page
​integer · int32

The page to return, counted from 1. A page below 1 reads page 1; one past the last returns no items.

Default: 1
limit
​integer · int32

Items per page, from 1 to 100. A larger value is clamped to 100, a smaller one to 1.

Default: 20

List budgets › Responses

Success

​PaginationLinks · required
​BudgetResponse[] · required

Create budget

POST
https://api.costfluent.com
/v1/budgets
Bearer (API token)

Creates a budget over a workspace, a segment or a saved cost report: a start date, a cadence of N days, weeks, months or years, and one amount for every period or an amount per period, with optional alert thresholds on the spend so far or on the forecast for the period's end, and notification channels. A usage budget (measure usage) counts one usage unit on a saved cost report's rows instead of money, and takes no forecast threshold; a report holds at most one cost and one usage budget.

Needs a token with createBudget on the workspace.

Create budget › Headers

Idempotency-Key
​string · minLength: 1 · maxLength: 255

A unique value, at most 255 printable ASCII characters, such as a UUID, that makes retrying this create safe. A retry with the same key and the same request within 24 hours answers the first response again, marked Idempotent-Replayed: true, and creates nothing; the same key with another request answers 422 idempotency_key_reused. A key is kept only for a create that succeeded. Without it, every request creates.

Create budget › Request Body

workspaceId
​WorkspacePublicId · minLength: 1 · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
name
​string · minLength: 0 · maxLength: 200 · required
currency
​string · minLength: 3 · maxLength: 3 · pattern: ^[A-Z]{3}$ · required
measure
​BudgetMeasureValue · enum
Enum values:
cost
usage
usageUnit
​string | null · minLength: 0 · maxLength: 64
startDate
​string | null · date
intervalCount
​integer · int32 · min: 1 · max: 366
intervalUnit
​BudgetIntervalUnitValue · enum
Enum values:
day
week
month
year
amount
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
​array | null
​array | null
segmentId
​string | null
​
appIds
​array | null

Create budget › Responses

Created

id
​BudgetPublicId · pattern: ^bud_[A-Za-z0-9_-]{2… · required
name
​string · required
currency
​string · pattern: ^[A-Z]{3}$ · required
measure
​BudgetMeasure · required
startDate
​string · date · required
intervalCount
​integer · int32 · required
intervalUnit
​BudgetIntervalUnit · required
​BudgetPeriodResponse[] · required
status
​BudgetStatus · required
state
​BudgetState · required
spendAvailability
​SpendAvailability · required
​CurrencyAmount[] · required
​BudgetAlertResponse[] · required
createdAt
​string · date-time · required
amount
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
usageUnit
​string | null
​
​
​
currentSpend
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
budgetedToDate
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
projectedSpend
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
percentUsed
​number | null · double
historyFloor
​string | null · date
updatedAt
​string | null · date-time

Get budget

GET
https://api.costfluent.com
/v1/budgets/{budgetId}
Bearer (API token)

Returns a specific budget with current spend.

Needs a token with viewBudgets on the workspace.

Get budget › path Parameters

budgetId
​BudgetPublicId · pattern: ^bud_[A-Za-z0-9_-]{2… · required

Get budget › Responses

Success

id
​BudgetPublicId · pattern: ^bud_[A-Za-z0-9_-]{2… · required
name
​string · required
currency
​string · pattern: ^[A-Z]{3}$ · required
measure
​BudgetMeasure · required
startDate
​string · date · required
intervalCount
​integer · int32 · required
intervalUnit
​BudgetIntervalUnit · required
​BudgetPeriodResponse[] · required
status
​BudgetStatus · required
state
​BudgetState · required
spendAvailability
​SpendAvailability · required
​CurrencyAmount[] · required
​BudgetAlertResponse[] · required
createdAt
​string · date-time · required
amount
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
usageUnit
​string | null
​
​
​
currentSpend
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
budgetedToDate
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
projectedSpend
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
percentUsed
​number | null · double
historyFloor
​string | null · date
updatedAt
​string | null · date-time

Update budget

PUT
https://api.costfluent.com
/v1/budgets/{budgetId}
Bearer (API token)

Updates the name, the amounts, the scope (a segment, a cost report or the whole workspace), a usage budget's unit, the alert thresholds or the notification channels of a budget in place; the start date, cadence and measure are fixed once created, and a usage budget keeps a cost report. A field left out keeps its value; clearSegment and clearCostReport return the budget to the whole workspace. Alerts replace the thresholds: one kept at the same percent and basis keeps whether it fired this period.

Needs a token with updateBudget on the workspace.

Update budget › path Parameters

budgetId
​BudgetPublicId · pattern: ^bud_[A-Za-z0-9_-]{2… · required

Update budget › Headers

If-Match
​string

Applies the write only while the resource still has this ETag, and answers 412 precondition_failed otherwise. Without it, the last write wins.

Update budget › Request Body

name
​string | null
amount
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
​array | null
segmentId
​string | null
clearSegment
​boolean
​
clearCostReport
​boolean
appIds
​array | null
usageUnit
​string | null · minLength: 0 · maxLength: 64
​array | null

Update budget › Responses

Success

id
​BudgetPublicId · pattern: ^bud_[A-Za-z0-9_-]{2… · required
name
​string · required
currency
​string · pattern: ^[A-Z]{3}$ · required
measure
​BudgetMeasure · required
startDate
​string · date · required
intervalCount
​integer · int32 · required
intervalUnit
​BudgetIntervalUnit · required
​BudgetPeriodResponse[] · required
status
​BudgetStatus · required
state
​BudgetState · required
spendAvailability
​SpendAvailability · required
​CurrencyAmount[] · required
​BudgetAlertResponse[] · required
createdAt
​string · date-time · required
amount
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
usageUnit
​string | null
​
​
​
currentSpend
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
budgetedToDate
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
projectedSpend
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
percentUsed
​number | null · double
historyFloor
​string | null · date
updatedAt
​string | null · date-time

Delete budget

DELETE
https://api.costfluent.com
/v1/budgets/{budgetId}
Bearer (API token)

Deletes a budget and its alert configuration.

Needs a token with deleteBudget on the workspace.

Delete budget › path Parameters

budgetId
​BudgetPublicId · pattern: ^bud_[A-Za-z0-9_-]{2… · required

Delete budget › Headers

If-Match
​string

Applies the write only while the resource still has this ETag, and answers 412 precondition_failed otherwise. Without it, the last write wins.

Delete budget › Responses

No Content

No data returned