Costfluent Docs
  • Pricing
  • Changelog
  • costfluent.com
  • Documentation
  • Guides
  • API Reference
Product
  • Pricing
  • Security
  • Changelog
Developers
  • API reference
  • Terraform
  • llms.txt
Legal
  • Privacy
  • Terms
  • Imprint
Get started
Concepts
Connect a source
Reporting
Allocation
Planning
Optimization
Administration
Developers
    Public API authenticationPublic API versioningPublic API paginationPublic API errorsPublic API rate limitsPublic API data formatsWebhook notificationsTerraform
Information
Workspaces
    List workspacesgetCreate workspacepostGet workspacegetUpdate workspaceputDelete workspacedelete
Workspace Providers
    List workspace providersgetCreate workspace providerpostGet workspace providergetUpdate workspace providerputDelete workspace providerdelete
Virtual Tags
    List virtual tagsgetCreate virtual tagpostGet virtual taggetDelete virtual tagdeleteUpdate virtual tagpatch
Utility
    Get current token infogetHealth checkget
Tags
    Get tag keygetDelete tag keydeleteList tag keysget
Saved Filters
    List saved filtersgetCreate saved filterpostGet saved filtergetUpdate saved filterputDelete saved filterdelete
Providers
    List providersgetConnect providerpostGet providergetUpdate providerputDelete providerdeleteGet available providersgetGet the AWS connectorgetGet provider sync historygetProvision the GCP service accountpostTest provider connectionpostTrigger provider syncpost
Kubernetes
    Report Kubernetes usagepost
Folders
    List foldersgetCreate folderpostGet foldergetUpdate folderputDelete folderdelete
Exchange Rates
    Get available currenciesgetGet exchange rategetGet the workspace's exchange rate policygetList exchange ratesget
Dashboards
    List dashboardsgetCreate dashboardpostGet dashboardgetUpdate dashboardputDelete dashboarddelete
Custom Provider
    List uploadsgetUpload cost filespostGet uploadgetDelete uploaddeleteSubmit costs batchpost
Report Notifications
    Activate report notificationpostList report notificationsgetCreate report notificationpostDeactivate report notificationpostGet report notificationgetDelete report notificationdeleteUpdate report notificationpatch
Cost Reports
    List cost reportsgetCreate cost reportpostGet cost reportgetUpdate cost reportputDelete cost reportdeleteGet cost report dataget
Cost Filters
    Translate a cost filterget
Cost Data
    Get cost datagetGet cost forecastgetGet cost summaryget
Cost Alerts
    List cost alertsgetCreate cost alertpostGet cost alertgetUpdate cost alertputDelete cost alertdeleteGet cost alert eventsgetPause cost alertpostResume cost alertpost
Contracting
    Get the data processing agreement statusget
Budgets
    List budgetsgetCreate budgetpostGet budgetgetUpdate budgetputDelete budgetdelete
Billing
    Get the account's entitlementgetGet the account's metered usageget
Anomalies
    Acknowledge anomalypostList anomaliesget
Allocation
    List allocation rulesgetCreate an allocation rulepostUpdate an allocation ruleputDelete an allocation ruledeleteReorder the allocation rule setpostRead allocation coveragegetList segmentsgetCreate a segmentpostUpdate a segmentputDelete a segmentdeletePreview an allocation rulepost
Schemas
Developers

Public API data formats

How the Costfluent Public API writes money, dates, currencies and IDs, and how a write is made conditional on the version you read.

The OpenAPI document declares each field's format. This page explains the ones an integration has to handle with care.

Money

Every amount of money is a decimal string, never a JSON number, so no client sums binary floats that drift:

Code
{ "amount": "1250.50000000", "currency": "EUR" }
  • Responses write every amount with exactly eight decimals, a point and no exponent.
  • Requests send an amount the same way, with up to eight decimals: "1250.5" and "1250.50000000" are the same amount. A JSON number, an exponent or a thousands separator is refused with 400.
  • A budget amount is kept to the cent, so a budget amount with more than two decimals is refused rather than rounded.
  • Compare amounts by value, not as text: "49" and "49.00000000" are equal.
  • Percentages, ratios such as allocation coverage, exchange rates and usage quantities stay JSON numbers.
  • A cost alert's thresholdValue is a decimal string whether it is an amount or a percentage, as its thresholdType says.

Dates and months

  • A date is YYYY-MM-DD, such as startDate, endDate and a custom integration's chargePeriodStart. A charge period is a day, so a time is refused.
  • A forecast month is YYYY-MM.
  • A timestamp, such as createdAt, is an ISO 8601 date and time.

Currencies

A currency is an upper-case three-letter ISO 4217 code, such as EUR or GBP.

IDs

Every Costfluent object is addressed by a prefixed ID, such as wsp_ for a workspace, bud_ for a budget, crp_ for a cost report, seg_ for a segment and prv_ for an integration. The prefix says what the ID names, and the API refuses an ID of the wrong kind. Treat the rest as opaque.

A batch of costs sent to a custom integration answers with a batchId beginning with cbt_: a receipt for that batch, not an upload you can read back.

Conditional updates

A budget read answers with an ETag header, the version of the budget it returned. Send it back as If-Match on the PUT that changes the budget:

TerminalCode
curl --request PUT https://api.costfluent.com/v1/budgets/$BUDGET_ID \ --header "Authorization: Bearer $COSTFLUENT_API_TOKEN" \ --header "If-Match: \"774\"" \ --header "Content-Type: application/json" \ --data '{"amount": "15000"}'

When someone changed the budget after your read, the PUT is refused with 412 and precondition_failed, and nothing changes: read it again, then decide. Without If-Match, the last write wins.

How it behaves

  • The create and the update of a budget answer with its new ETag too.
  • If-Match: * applies the update whatever the version.
  • The Terraform provider sends the ETag of its last read, so an edit made in Costfluent between a plan and its apply stops the apply instead of being overwritten.

Related

  • Errors
  • Public API versioning
  • API reference
Public API rate limitsWebhook notifications
On this page
  • Money
  • Dates and months
  • Currencies
  • IDs
  • Conditional updates
  • How it behaves
  • Related
JSON