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 paginationUpdating objects with the Public APIPublic API errorsPublic API rate limitsPublic API data formatsWebhook notificationsTerraformMCP serverPower BI and Excel
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
Users
    List usersgetInvite userpostGet userget
Teams
    List teamsgetCreate teampostGet teamgetUpdate teamputDelete teamdeleteAdd team memberpostUpdate team memberputRemove team memberdeleteList team workspace accessgetSet team workspace accessputRemove team workspace accessdelete
Tags
    Get tag keygetDelete tag keydeleteGet the workspace's tag policygetReplace the workspace's tag policyputList 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 folderdeleteSet folder saved filterput
Exchange Rates
    Get available currenciesgetGet exchange rategetGet the workspace's exchange rate policygetList exchange ratesget
Dashboards
    List dashboardsgetCreate dashboardpostCreate dashboard widgetpostGet dashboardgetUpdate dashboardputDelete dashboarddeleteGet dashboard widgetgetUpdate dashboard widgetputDelete dashboard widgetdeleteSet dashboard defaultputSet dashboard saved filterput
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
Business Metrics
    List business metricsgetCreate business metricpostGet business metricgetUpdate business metricputDelete business metricdeleteList business metric valuesgetImport business metric valuespost
Budgets
    List budgetsgetCreate budgetpostGet budgetgetUpdate budgetputDelete budgetdelete
Billing
    Get the account's entitlementgetGet the account's metered usageget
Audit Logs
    List audit logget
Apps
    List appsgetCreate apppostGet appgetUpdate appputDelete appdelete
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

Updating objects with the Public API

How a Costfluent Public API update changes only the fields it names, empties a field with its clear flag, and replaces a list whole.

Every update in the Public API, a PUT or a PATCH, changes the object in place: it keeps its ID and everything that hangs off it. A field you leave out keeps its value, so a client sends only what changed.

Change, keep or empty a field

You sendThe field
A valuetakes the value
Nothing, or nullkeeps its value
Its clear flag, such as "clearDescription": trueis emptied
A value and its clear flag togetheris not changed: the request is refused with 400 and nothing changes

A field that has no clear flag cannot be emptied by an update.

A list, such as appIds on a budget or a cost alert, is replaced whole: send every item it should hold. An empty list removes them all.

To return a budget from a saved cost report to the whole workspace:

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

Clear flags

ObjectClear flags
Budget, PUT /v1/budgets/{budgetId}clearSegment, clearCostReport
Cost alert, PUT /v1/cost-alerts/{alertId}clearComparisonPeriod, clearMinimumAmount, clearFilter
Cost report, PUT /v1/cost-reports/{costReportId}clearFolder, clearFilter, clearStartDate, clearEndDate
Folder, PUT /v1/folders/{folderId}clearParent
Integration, PUT /v1/providers/{providerId}clearDescription, clearSettings
Virtual tag, PATCH /v1/virtual-tags/{virtualTagId}clearDescription, clearDefaultValue

How it behaves

  • An update answers 200 with the object as stored, as reading it would, and a deletion answers 204 with no body. Setting a team member or a team's workspace access answers 204, because it links two objects rather than holding one.
  • Renaming an integration with name keeps its ID, its credentials and the costs it has already collected.
  • A budget measures a segment, a saved cost report or the whole workspace. Naming segmentId or costReportId moves it there, and its clear flag returns it to the whole workspace.
  • A segment always has an owner. Naming teamId replaces its team label, and naming teamLabel replaces its team.
  • A cost report with a custom interval needs both dates, so clearing either is refused until the report uses another interval.
  • An integration's settings are replaced whole when you send at least one; an empty map keeps them.
  • The saved-filter operations of a dashboard and a folder are the one exception: there, savedFilterId: null detaches the saved filter.
  • An allocation rule's update names its name, filter and segmentId every time, and a team, a team member and a team's workspace access are updated whole.
  • A workspace's tag policy, PUT /v1/workspaces/{workspaceId}/tag-policy, is replaced whole: rules is required, and an empty list clears the policy.

Where reading an object answers with an ETag, send it back as If-Match, and the update is refused when someone changed the object since you read it. See Data formats.

Related

  • Data formats
  • Errors
  • API reference
Public API paginationPublic API errors
On this page
  • Change, keep or empty a field
  • Clear flags
  • How it behaves
  • Related