Costfluent Public API

List dashboards

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

Returns all dashboards for a workspace.

Needs a token with viewDashboards on the workspace.

List dashboards › query Parameters

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

Success

​PaginationLinks · required
​DashboardResponse[] · required

Create dashboard

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

Creates a new dashboard.

Needs a token with createDashboard on the workspace.

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

workspaceId
​WorkspacePublicId · minLength: 1 · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
title
​string · minLength: 0 · maxLength: 200 · required
isDefault
​boolean
dateInterval
​DateInterval
dateBin
​DateBin
startDate
​string | null · date
endDate
​string | null · date

Create dashboard › Responses

Created

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

Create dashboard widget

POST
https://api.costfluent.com
/v1/dashboards/{dashboardId}/widgets
Bearer (API token)

Adds a widget to a dashboard: a saved cost report drawn as a chart, a table or a KPI, or a text widget whose words are rendered as markdown emphasis without HTML. At most 50 per dashboard.

Needs a token with viewCostReports and updateDashboard on the workspace.

Create dashboard widget › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required

Create dashboard widget › query Parameters

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

Create dashboard widget › 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 dashboard widget › Request Body

title
​string · minLength: 0 · maxLength: 200 · required
​WidgetPositionRequest · required
type
​WidgetType
​
​
content
​string | null · minLength: 0 · maxLength: 10000

Create dashboard widget › Responses

Created

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

Get dashboard

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

Returns a specific dashboard with widgets.

Needs a token with viewDashboards on the workspace.

Get dashboard › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required

Get dashboard › query Parameters

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

Get dashboard › Responses

Success

id
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required
title
​string · required
isDefault
​boolean · required
dateInterval
​DateInterval · required
dateBin
​DateBin · required
​WidgetResponse[] · required
createdAt
​string · date-time · required
startDate
​string | null · date
endDate
​string | null · date
​

Update dashboard

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

Updates a dashboard.

Needs a token with updateDashboard on the workspace.

Update dashboard › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required

Update dashboard › query Parameters

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

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

title
​string | null
​
​
startDate
​string | null · date
endDate
​string | null · date

Update dashboard › Responses

Success

id
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required
title
​string · required
isDefault
​boolean · required
dateInterval
​DateInterval · required
dateBin
​DateBin · required
​WidgetResponse[] · required
createdAt
​string · date-time · required
startDate
​string | null · date
endDate
​string | null · date
​

Delete dashboard

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

Deletes a dashboard and all its widgets.

Needs a token with deleteDashboard on the workspace.

Delete dashboard › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required

Delete dashboard › query Parameters

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

Delete dashboard › 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 dashboard › Responses

No Content

No data returned

Get dashboard widget

GET
https://api.costfluent.com
/v1/dashboards/{dashboardId}/widgets/{widgetId}
Bearer (API token)

Returns one widget of a dashboard.

Needs a token with viewDashboards on the workspace.

Get dashboard widget › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required
widgetId
​DashboardWidgetPublicId · pattern: ^wdg_[A-Za-z0-9_-]{2… · required

Get dashboard widget › query Parameters

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

Get dashboard widget › Responses

Success

id
​DashboardWidgetPublicId · pattern: ^wdg_[A-Za-z0-9_-]{2… · required
type
​WidgetType · required
title
​string · required
​WidgetPositionResponse · required
​
​
content
​string | null
​object | null

Update dashboard widget

PUT
https://api.costfluent.com
/v1/dashboards/{dashboardId}/widgets/{widgetId}
Bearer (API token)

Changes the fields given. A report widget's display and a text widget's words are its own; the type and the report stay, so a different report is a new widget. An update that another request's change or delete of the widget overtook answers 409 concurrency_conflict and changes nothing.

Needs a token with updateDashboard on the workspace.

Update dashboard widget › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required
widgetId
​DashboardWidgetPublicId · pattern: ^wdg_[A-Za-z0-9_-]{2… · required

Update dashboard widget › query Parameters

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

Update dashboard widget › 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 dashboard widget › Request Body

title
​string | null · minLength: 0 · maxLength: 200
​
content
​string | null · minLength: 0 · maxLength: 10000
​

Update dashboard widget › Responses

Success

id
​DashboardWidgetPublicId · pattern: ^wdg_[A-Za-z0-9_-]{2… · required
type
​WidgetType · required
title
​string · required
​WidgetPositionResponse · required
​
​
content
​string | null
​object | null

Delete dashboard widget

DELETE
https://api.costfluent.com
/v1/dashboards/{dashboardId}/widgets/{widgetId}
Bearer (API token)

Removes one widget from a dashboard; the report it rendered is untouched. A delete that another request's change or delete of the widget overtook answers 409 concurrency_conflict and removes nothing.

Needs a token with updateDashboard on the workspace.

Delete dashboard widget › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required
widgetId
​DashboardWidgetPublicId · pattern: ^wdg_[A-Za-z0-9_-]{2… · required

Delete dashboard widget › query Parameters

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

Delete dashboard widget › 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 dashboard widget › Responses

No Content

No data returned

Set dashboard default

PUT
https://api.costfluent.com
/v1/dashboards/{dashboardId}/default
Bearer (API token)

Makes the dashboard the workspace's default, which the one that was default stops being, or with isDefault false clears it when it is the default, leaving the workspace without one. Repeating either changes nothing.

Needs a token with updateDashboard on the workspace.

Set dashboard default › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required

Set dashboard default › 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.

Set dashboard default › Request Body

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

Set dashboard default › Responses

Success

id
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required
title
​string · required
isDefault
​boolean · required
dateInterval
​DateInterval · required
dateBin
​DateBin · required
​WidgetResponse[] · required
createdAt
​string · date-time · required
startDate
​string | null · date
endDate
​string | null · date
​

Set dashboard saved filter

PUT
https://api.costfluent.com
/v1/dashboards/{dashboardId}/saved-filter
Bearer (API token)

Attaches a saved filter of the same workspace to the dashboard, so every report widget on it is read through that filter on top of its report's own. A null savedFilterId detaches the one attached.

Needs a token with updateDashboard on the workspace.

Set dashboard saved filter › path Parameters

dashboardId
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required

Set dashboard saved filter › 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.

Set dashboard saved filter › Request Body

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

Set dashboard saved filter › Responses

Success

id
​DashboardPublicId · pattern: ^dsh_[A-Za-z0-9_-]{2… · required
title
​string · required
isDefault
​boolean · required
dateInterval
​DateInterval · required
dateBin
​DateBin · required
​WidgetResponse[] · required
createdAt
​string · date-time · required
startDate
​string | null · date
endDate
​string | null · date
​