Costfluent Public API

List cost reports

GET
https://api.costfluent.com
/v1/cost-reports
Bearer (API token)

Returns all cost reports for a workspace, optionally filtered by folder.

Needs a token with viewCostReports on the workspace.

List cost reports › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
folderId
​
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 cost reports › Responses

Success

​PaginationLinks · required
​CostReportResponse[] · required

Create cost report

POST
https://api.costfluent.com
/v1/cost-reports
Bearer (API token)

Creates a new cost report configuration.

Needs a token with createCostReport on the workspace.

Create cost report › 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 cost report › Request Body

workspaceId
​WorkspacePublicId · minLength: 1 · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
title
​string · minLength: 0 · maxLength: 200 · required
​
filter
​string | null
​array | null
​
startDate
​string | null · date
endDate
​string | null · date
chartType
​ChartType · enum
Enum values:
line
bar
stackedBar
area
pie
table
​
​
​

Create cost report › Responses

Created

id
​CostReportPublicId · pattern: ^crp_[A-Za-z0-9_-]{2… · required
title
​string · required

Get cost report

GET
https://api.costfluent.com
/v1/cost-reports/{costReportId}
Bearer (API token)

Returns a specific cost report configuration.

Needs a token with viewCostReports on the workspace.

Get cost report › path Parameters

costReportId
​CostReportPublicId · pattern: ^crp_[A-Za-z0-9_-]{2… · required

Get cost report › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required

Get cost report › Responses

Success

id
​CostReportPublicId · pattern: ^crp_[A-Za-z0-9_-]{2… · required
title
​string · required
​ReportGroupingResponse[] · required
dateInterval
​string · required
chartType
​string · required
chartAxis
​string · required
dateBin
​string · required
​CostReportSettingsResponse · required
createdAt
​string · date-time · required
isDefault
​boolean · required
​
filter
​string | null
startDate
​string | null · date
endDate
​string | null · date
updatedAt
​string | null · date-time

Update cost report

PUT
https://api.costfluent.com
/v1/cost-reports/{costReportId}
Bearer (API token)

Updates a cost report configuration.

Needs a token with updateCostReport on the workspace.

Update cost report › path Parameters

costReportId
​CostReportPublicId · pattern: ^crp_[A-Za-z0-9_-]{2… · required

Update cost report › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required

Update cost report › 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 cost report › Request Body

title
​string | null
​
clearFolder
​boolean
filter
​string | null
clearFilter
​boolean
​array | null
​
startDate
​string | null · date
clearStartDate
​boolean
endDate
​string | null · date
clearEndDate
​boolean
​
​
​
​

Update cost report › Responses

Success

id
​CostReportPublicId · pattern: ^crp_[A-Za-z0-9_-]{2… · required
title
​string · required
​ReportGroupingResponse[] · required
dateInterval
​string · required
chartType
​string · required
chartAxis
​string · required
dateBin
​string · required
​CostReportSettingsResponse · required
createdAt
​string · date-time · required
isDefault
​boolean · required
​
filter
​string | null
startDate
​string | null · date
endDate
​string | null · date
updatedAt
​string | null · date-time

Delete cost report

DELETE
https://api.costfluent.com
/v1/cost-reports/{costReportId}
Bearer (API token)

Deletes a cost report, removes the dashboard widgets that show it and deactivates its subscriptions. Refused with 409 in_use, naming the budgets, while a budget measures it, and with 422 for the workspace's default report.

Needs a token with deleteCostReport on the workspace.

Delete cost report › path Parameters

costReportId
​CostReportPublicId · pattern: ^crp_[A-Za-z0-9_-]{2… · required

Delete cost report › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required

Delete cost report › 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 cost report › Responses

No Content

No data returned

Get cost report data

GET
https://api.costfluent.com
/v1/cost-reports/{costReportId}/data
Bearer (API token)

Returns the computed cost data for a report. A breakdown row's percent is its share of the window's total cost; with conversion off over several currencies, of the total in its own currency.

Needs a token with viewCosts on the workspace for every report, and viewCostReports too for a report that charts a business metric.

Get cost report data › path Parameters

costReportId
​CostReportPublicId · pattern: ^crp_[A-Za-z0-9_-]{2… · required

Get cost report data › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required

Get cost report data › Responses

Success

​ReportSummaryResponse · required
​ReportTimeSeriesResponse[] · required
​ReportBreakdownResponse[] · required
startDate
​string · date · required
endDate
​string · date · required
historyFloor
​string | null · date
​
​
dataThrough
​string | null · date
​