Skip to content

Understand spend

Unit costs

Spend divided by what your business does, such as orders or active workspaces, month by month and customer by customer, with targets that alert.

A unit cost divides spend by a measure of your business: cost per order, per contract reviewed, per active workspace. Find them under Business, Unit costs.

A unit cost has two parts:

  • A business metric: something your business does each day, whose values you send from a CSV file or from your own systems.
  • The spend it divides: all of the project's spend, or a view saved in Explore, such as one service, one provider or one team's spend.

Business metrics

Create a metric with New metric. Each one has:

  • Name, such as Orders, and what one of it is called, such as order, so a unit cost reads as cost per order.
  • Kind:
    • A count: each day says how many happened that day, such as orders. A month adds its days up.
    • A level: each day says how many there were that day, such as active workspaces. A month averages the days a value was sent.
  • Values are sent for: the whole project, or each customer, feature or team. A metric sent per customer lets a unit cost divide each customer's own spend by that customer's own values. This is fixed once the metric is made.

Owners, admins and billing members create metrics and unit costs. Everyone who can see the project's costs can read them.

Sending values

A value is one day's figure: a date as YYYY-MM-DD and a number of zero or more. A metric sent per customer, feature or team also names it, as the same key your tags and usage data use, such as cust-1042. A day sent again for the same owner replaces the value it held, so a corrected day or file is simply sent again.

Values may be dated up to 24 months back and through tomorrow, in batches of up to 5,000. A batch is taken whole or not at all: if any value is wrong, nothing is stored and every problem is named.

From a CSV file

Choose Send values on the metric. The file has a header naming date and value, and the owner column, such as customer, for a metric sent per owner, in any order:

date,value,customer
2026-11-01,1250,cust-1042
2026-11-01,830,cust-1187

Download the template gives the columns for the metric. A file with any other column is refused, so a file meant for another metric is never half read.

From your own systems

POST the values as JSON to the metric's endpoint, shown under Send values, with an API key of the project whose scope is Send data only:

curl -X POST "https://api.costreveal.com/api/v1/metrics/<metric>/values" \
  -H "Authorization: Bearer crm_..." \
  -H "Content-Type: application/json" \
  -d '{"values": [{"date": "2026-11-01", "value": 1250, "customer": "cust-1042"}]}'

The answer says how many days were added and how many replaced: {"added": 1, "replaced": 0}. A refused batch is answered with status 400, naming each value that was wrong; see Errors.

Unit costs

Create one with New unit cost: its name, the metric it divides by, the spend it divides, and, once a source states one, the cost type that spend is in. Each unit cost shows:

  • Cost per unit for the month: its spend over the metric's units.
  • Month before, and how far the cost per unit moved.
  • Spend and the metric's units for the month.
  • A trend of the last 13 months, and the month day by day. A month or day with no units has no bar, as it has no cost per unit.
  • For a metric sent per customer, feature or team, each one's own figure: its own spend over its own units. Spend no owner of that kind explains is stated below, and is in no owner's figure.

While a month is still running, it is read through the last day both its spend and its metric reach, and the month before through the same day. A bill arrives a day or more after the usage it charges, so a metric sent for today never makes the month's cost per unit look lower than it is.

A unit cost whose metric is sent per customer can divide a view filtered by customer, service or provider, but not one filtered by another owner such as a team: spend is explained by one owner at a time.

A metric or a saved view cannot be deleted while a unit cost uses it.

Targets

A target is the most one unit should cost, in a currency you choose. When a month's cost per unit passes it, the people chosen for Unit cost over target in Settings, Notifications are emailed, and your Slack channel and the webhooks set for it are told, once for that month and target. The check uses the same days as the figure, in the target's currency, and never alerts on a month with no units. A unit cost past its target is marked Over target.

In reports and the API

The Business report has a table of every unit cost's month beside the month before, with its target. A read only or read and write API key reads them at GET /costs/unit-costs.