Costfluent Public API

List cost alerts

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

Returns all cost alerts for a workspace.

Needs a token with viewCosts on the workspace.

List cost alerts › 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 cost alerts › Responses

Success

​PaginationLinks · required
​CostAlertResponse[] · required

Create cost alert

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

Creates a new cost alert. thresholdType sets what thresholdValue measures: absolute, the increase in cost against comparisonPeriod, in the alert's currency; percentageIncrease, that increase as a percentage; budgetPercentage, the month-to-date spend, from the 1st of the month through the last settled day, reaching thresholdValue in the alert's currency; tagCoverageBelow, the workspace's tag coverage falling below thresholdValue percent. budgetPercentage references no budget; its name is kept for compatibility.

Needs a token with manageAlerts on the workspace.

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

workspaceId
​WorkspacePublicId · minLength: 1 · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
name
​string · minLength: 0 · maxLength: 255 · required
thresholdType
​AlertThresholdType · required
thresholdValue
​string · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,… · required
​
minimumAmount
​string | null · decimal · min: 0 · pattern: ^-?[0-9]+(\.[0-9]{1,…
providerIds
​array | null
filter
​string | null
appIds
​array | null
evaluationFrequencyMinutes
​integer · int32 · min: 15 · max: 1440

Create cost alert › Responses

Created

id
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required
name
​string · required

Get cost alert

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

Returns a specific cost alert.

Needs a token with viewCosts on the workspace.

Get cost alert › path Parameters

alertId
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required

Get cost alert › query Parameters

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

Get cost alert › Responses

Success

id
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required
name
​string · required
thresholdType
​AlertThresholdType · required
thresholdValue
​string · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,… · required
appIds
​AppPublicId[] · required
evaluationFrequencyMinutes
​integer · int32 · required
status
​AlertStatus · required
createdAt
​string · date-time · required
providerIds
​array | null
filter
​string | null
comparisonPeriod
​string | null
minimumAmount
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
lastEvaluatedAt
​string | null · date-time
updatedAt
​string | null · date-time

Update cost alert

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

Updates a cost alert and returns it as stored. thresholdType sets what thresholdValue measures: absolute, the increase in cost against comparisonPeriod, in the alert's currency; percentageIncrease, that increase as a percentage; budgetPercentage, the month-to-date spend, from the 1st of the month through the last settled day, reaching thresholdValue in the alert's currency; tagCoverageBelow, the workspace's tag coverage falling below thresholdValue percent. budgetPercentage references no budget; its name is kept for compatibility.

Needs a token with manageAlerts on the workspace.

Update cost alert › path Parameters

alertId
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required

Update cost alert › query Parameters

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

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

name
​string | null · minLength: 0 · maxLength: 255
​
thresholdValue
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
​
clearComparisonPeriod
​boolean
minimumAmount
​string | null · decimal · min: 0 · pattern: ^-?[0-9]+(\.[0-9]{1,…
clearMinimumAmount
​boolean
providerIds
​array | null
filter
​string | null
clearFilter
​boolean
appIds
​array | null
evaluationFrequencyMinutes
​integer | null · int32 · min: 15 · max: 1440

Update cost alert › Responses

Success

id
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required
name
​string · required
thresholdType
​AlertThresholdType · required
thresholdValue
​string · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,… · required
appIds
​AppPublicId[] · required
evaluationFrequencyMinutes
​integer · int32 · required
status
​AlertStatus · required
createdAt
​string · date-time · required
providerIds
​array | null
filter
​string | null
comparisonPeriod
​string | null
minimumAmount
​string | null · decimal · pattern: ^-?[0-9]+(\.[0-9]{1,…
lastEvaluatedAt
​string | null · date-time
updatedAt
​string | null · date-time

Delete cost alert

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

Deletes a cost alert.

Needs a token with manageAlerts on the workspace.

Delete cost alert › path Parameters

alertId
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required

Delete cost alert › query Parameters

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

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

No Content

No data returned

Get cost alert events

GET
https://api.costfluent.com
/v1/cost-alerts/{alertId}/events
Bearer (API token)

Returns triggered events for a cost alert.

Needs a token with viewCosts on the workspace.

Get cost alert events › path Parameters

alertId
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required

Get cost alert events › 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

Get cost alert events › Responses

Success

​PaginationLinks · required
​CostAlertEventResponse[] · required

Pause cost alert

POST
https://api.costfluent.com
/v1/cost-alerts/{alertId}/pause
Bearer (API token)

Pauses evaluation of a cost alert.

Needs a token with manageAlerts on the workspace.

Pause cost alert › path Parameters

alertId
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required

Pause cost alert › query Parameters

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

Pause cost alert › 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.

Pause cost alert › Responses

No Content

No data returned

Resume cost alert

POST
https://api.costfluent.com
/v1/cost-alerts/{alertId}/resume
Bearer (API token)

Resumes evaluation of a paused cost alert.

Needs a token with manageAlerts on the workspace.

Resume cost alert › path Parameters

alertId
​CostAlertPublicId · pattern: ^alrt_[A-Za-z0-9_-]{… · required

Resume cost alert › query Parameters

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

Resume cost alert › 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.

Resume cost alert › Responses

No Content

No data returned