POST /accounts/{account_id}/billable/usage

Returns cost and usage data for a single Cloudflare account, aligned with the FinOps FOCUS v1.3 Cost and Usage dataset specification.

This is the filterable counterpart to GET on the same path. It is a read-only operation and requires only the #billing:read permission; POST is used so that filter criteria can be supplied in a request body rather than in the query string.

Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost.

Note: Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete.

The request body is optional. When it is omitted, or when TimePeriod is omitted, the range defaults to the start of the current month through today. The maximum date range is 31 days.

Filters are combined with AND. Filter values that do not match a known billable metric or product family simply match no usage, and the response is an empty result set.

Servers

Path parameters

Name Type Required Description
account_id String Yes

Identifies the Cloudflare account.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
FilterBy Object No

Usage filters. Filters of different kinds are combined with AND, so a record must match every filter present to be returned.

FilterBy.MetricIds[] Array No

Restrict results to rows whose x_BillableMetricId matches one of these billable metric ids (e.g. workers_standard_requests). Values must be unique.

FilterBy.ProductFamilyIds[] Array No

Restrict results to billable metrics belonging to these product families. Values must be unique UUIDs.

TimePeriod Object No

Charge period to query, i.e. when consumption happened, not when it was billed. From is inclusive and To is exclusive. From and To must be supplied together; supplying one without the other is an error. When both are omitted the range defaults to the start of the current month through today.

TimePeriod.To String No

End of the range (ISO 8601). Required if From is set. Must be after From and no more than 31 days after it.

TimePeriod.From String No

Start of the range (ISO 8601). Required if To is set.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.