Skip to navigation

Analytics schema reference

This page documents all 20 views available to the Analytics API. You can also fetch this live for your account from GET /schema.

Conventions:

  • Monetary columns are cents. Divide by 100 for display. Most are integers; fact_cost.cost_amount is fractional cents (Decimal).
  • Credits are not money and not whole numbers. The fact_credit_transaction amount and balance columns are Decimal(30, 6): a spend can be a fraction of a credit. Do not divide them by 100.
  • UInt64/Int64 values are returned as JSON strings (precision-safe); parse client-side.
  • Decimal values are returned as JSON numbers, not strings; the 64-bit quoting above does not apply to them. A Decimal beyond 2^53 is therefore already rounded in the response; select toString(col) to get its exact digits as a string.
  • Nullable(...) columns can be null.
  • Facts join to dimensions on the *_id columns called out below.

How the tables join

dim_customer is the hub: every fact table carries a customer_id. Usage facts (fact_signal, fact_cost, fact_delivered_value) also carry a product_id and link to each other through trace_id and signal_id. Revenue facts chain from fact_order through fact_order_line to fact_invoice_line, and fact_payment and fact_usage_summary tie back to invoices and order lines. fact_credit_transaction joins to dim_credits_currency for credit reporting. Customer units (the teams, departments, or users inside a customer) are in dim_customer_unit; fact_signal and fact_credit_transaction carry the unit each row was attributed to. Spend caps on units are in dim_customer_unit_cap (every version) and dim_customer_unit_cap_current (the cap in force now, with its current period), and every change to a unit is in fact_customer_unit_event.

Common join keys:

FromColumnTo
any factcustomer_iddim_customer.id
any factproduct_iddim_product.id
fact_signaltrace_idfact_cost.trace_id (cost-per-signal)
fact_signalsignal_idfact_delivered_value.signal_id
fact_orderplan_iddim_plan.id
fact_invoice_lineorder_line_idfact_order_line.id (revenue by product)
fact_paymentinvoice_idfact_invoice.id
fact_credit_transactioncredits_currency_iddim_credits_currency.id
fact_signalcustomer_unit_iddim_customer_unit.id, with customer_id
fact_signal (pending unit)external_customer_unit_iddim_customer_unit.external_id, with customer_id
fact_credit_transactionexternal_customer_unit_iddim_customer_unit.external_id, with customer_id
dim_customer_unitiddim_customer_unit_ancestor.unit_id
dim_customer_unit_cap*customer_unit_iddim_customer_unit.id, with customer_id
dim_customer_unit_cap*customer_unit_iddim_customer_unit_ancestor.ancestor_id (usage)
dim_customer_unit_cap*credits_currency_iddim_credits_currency.id
fact_customer_unit_eventcustomer_unit_iddim_customer_unit.id, with customer_id

Dimensions

dim_customer

One row per customer. Join id to any fact’s customer_id. Supports hierarchy rollups (parent_customer_id), segmentation (annual_revenue, status, churn_date), and geography (country/state/city).

ColumnTypeDescription
idUUIDInternal customer UUID. Primary key.
nameStringCustomer display name.
legal_nameStringLegal entity name. May differ from display name.
emailStringPrimary email address.
external_idStringCustomer ID in your external system.
display_idStringHuman-readable short id (e.g. CUST-001).
parent_customer_idNullable(UUID)Parent customer for hierarchy rollups. NULL if top-level.
default_currencyStringDefault billing/reporting currency (e.g. USD).
statusStringLifecycle status (e.g. active, churned).
churn_dateNullable(DateTime64)When the customer churned. NULL if active.
annual_revenueNullable(Int64)Self-reported annual revenue in whole dollars.
creation_sourceStringAcquisition channel/source (e.g. api, csv_import).
countryStringCountry from billing address.
stateStringState/region from billing address.
cityStringCity from billing address.
created_atDateTime64When the record was created.
updated_atDateTime64When the record was last modified.

dim_customer_unit

One row per customer unit: a team, department, tenant, or user inside a customer, arranged as a tree. Deleted and draft units stay in the table so their history keeps a name.

Join from fact_credit_transaction on customer_id and external_customer_unit_id = external_id. Join from fact_signal on customer_id and customer_unit_id = id; when customer_unit_id is null (the signal named a unit that did not exist yet), match external_customer_unit_id = external_id within the same customer instead. Use LEFT JOIN so unassigned usage stays in your totals: an unmatched row returns an empty name, not null. See usage by customer unit for complete queries.

ColumnTypeDescription
idUUIDCustomer unit UUID. Primary key.
customer_idUUIDCustomer that owns the unit. Include it in every unit join.
parent_idNullable(UUID)Parent unit. null for the customer’s root unit. Reflects the current tree.
external_idStringYour key for the unit, unique within the customer.
display_idStringPublic id with the cu_ prefix. Never empty.
nameStringUnit display name. Not unique, so group by id or external_id.
external_typeNullable(String)Your label for the level, for example department or team.
statusStringACTIVE, DELETED, or DRAFT.
is_billableBoolThe unit’s own current billable setting. false also applies to every unit below it. Not history.
created_atDateTime64When the unit was created.
updated_atDateTime64When the unit was last modified.

dim_customer_unit_ancestor

One row per unit and each unit above it, including the unit itself at depth 0. Use it to total a unit together with everything below it: join the unit a fact belongs to on unit_id and group by ancestor_id. A row counts once for every ancestor, so report one level of the tree at a time.

ColumnTypeDescription
customer_idUUIDCustomer that owns both units.
unit_idUUIDThe unit. Join to dim_customer_unit.id.
ancestor_idUUIDThe unit itself or a unit above it. Join to dim_customer_unit.id.
depthUInt8Steps from unit_id up to ancestor_id. 0 is the unit itself.

dim_customer_unit_cap

One row per version of a spend cap on a customer unit, including versions that were replaced or ended. A cap limits how many credits of one credits currency a unit and every unit below it can spend per period. Changing a cap adds a version; nothing is rewritten. For the cap that applies now, use dim_customer_unit_cap_current.

Caps are spend policy: this table and dim_customer_unit_cap_current return rows only to a caller that may read billing data, an API key with read:billing or a dashboard user, and in a custom view only when the view has capsEnabled: true. Anyone else gets no rows, not an error.

The cap in force at a time t is the highest version of the unit and credits currency whose window covers t: effective_from <= t and effective_until is null or after t.

ColumnTypeDescription
idUUIDCap version UUID. Primary key.
customer_idUUIDCustomer that owns the unit.
customer_unit_idUUIDUnit the cap sits on. Join to dim_customer_unit.id.
credits_currency_idUUIDCredits currency the cap limits. Caps on different currencies of one unit are separate limits.
amountDecimal(30, 6)Cap per period, in credits.
frequencyStringPeriod length. Always MONTHLY today.
schedule_typeNullable(String)CALENDAR (periods start on the 1st) or ANCHORED (on anchor_day). null on older versions.
anchor_dayNullable(UInt8)Day an ANCHORED period starts, 1 to 31; in shorter months, the last day.
effective_fromDateTime64When this version starts (UTC).
effective_untilNullable(DateTime64)When this version ends (UTC), exclusive. null while open.
versionInt64Rank. The highest version covering an instant is the one in force.
created_atDateTime64When the version was written.
sourceStringWhere it was written: api, dashboard, or system.

dim_customer_unit_cap_current

The cap in force now on each unit and credits currency, with its current period, resolved the same way as the customer unit cap endpoints. It has every column of dim_customer_unit_cap plus:

ColumnTypeDescription
period_startNullable(DateTime64)Start of the current period, 00:00 UTC on the anchor day, inclusive.
period_endNullable(DateTime64)End of the current period, exclusive. Periods are never cut short by a cap.

Usage counted against a cap is the net SPEND of its credits currency by the cap’s unit and every unit below it, from period_start up to the earlier of period_end and effective_until. See cap usage so far for the query; it gives the same figure as the cap API’s currentPeriod.used. Caps on deleted units are included, because they still apply to the units below until they are ended; join dim_customer_unit and keep status = 'ACTIVE' to list only the caps the API lists.

dim_product

One row per product (also called an agent). Products are AI agents/services or prepaid credit bundles. Join id to any fact’s product_id.

ColumnTypeDescription
idUUIDInternal product UUID. Primary key.
nameStringProduct display name.
descriptionStringProduct description.
external_idStringProduct ID in your external system.
display_idStringHuman-readable short id (e.g. PRD-001).
product_codeStringInternal/external product code or SKU.
typeStringagent (AI agent/service) or prepaidCreditBundle.
activeBoolWhether the product is currently active/sellable.
credits_currency_idNullable(UUID)For prepaidCreditBundle products, the credits currency sold.
metadataStringUser-defined JSON metadata.
archived_atNullable(DateTime64)When archived. NULL if active.
created_atDateTime64When the product was created.
updated_atDateTime64When the product was last modified.

dim_plan

A plan is a pricing configuration within a plan group. Plans form an upgrade/downgrade chain via has_next_plan/has_prev_plan. Join from fact_order.plan_id.

ColumnTypeDescription
idUUIDPlan UUID. Primary key.
nameStringPlan display name (e.g. Free, Standard, Premium).
descriptionStringPlan description.
plan_group_idUUIDGroups related plans (e.g. tiers of a pricing page).
typeStringflat (fixed fee), usage (metered), or credit (prepaid).
billing_frequencyStringHow often billed (e.g. monthly, yearly).
billing_typeStringAdvance (pre-pay) or Arrears (post-pay).
has_next_planUInt81 if a higher-tier plan exists, else 0.
has_prev_planUInt81 if a lower-tier plan exists, else 0.
created_atDateTime64When the plan was created.
updated_atDateTime64When the plan was last modified.

dim_credits_currency

Defines the types of credits your organization uses. Join from fact_credit_transaction.credits_currency_id or dim_product.credits_currency_id.

ColumnTypeDescription
idUUIDCredits currency UUID. Primary key.
nameStringDisplay name (e.g. “AI Credits”).
keyStringUnique programmatic key (e.g. “ai_credits”).
descriptionStringWhat this credits currency represents.
archived_atNullable(DateTime64)When archived. NULL if active.
created_atDateTime64When created.
updated_atDateTime64When last modified.

dim_organization

Your organization. Typically one row.

ColumnTypeDescription
idUUIDOrganization UUID. Primary key.
nameStringOrganization display name.
created_atDateTime64When created.
updated_atDateTime64When last modified.

Usage

fact_signal

One row per signal (event). This is the core usage metric. COUNT over time, group by signal_name, customer_id, or product_id. Join trace_id to fact_cost for cost-per-signal, or signal_id to fact_delivered_value for value delivered.

ColumnTypeDescription
signal_idStringUnique signal id (MongoDB ObjectID, not a UUID). Primary key.
signal_nameStringSignal type name (e.g. api_call, document_processed).
product_idNullable(UUID)Product (agent) that generated the signal.
customer_idNullable(UUID)Customer the signal is attributed to.
trace_idNullable(String)OpenTelemetry trace id. Join to fact_cost.trace_id.
has_delivered_valueUInt81 if the signal has delivered-value calculations.
dataJSONYour free-form JSON payload. Schema varies per signal_name. See querying metadata.
created_atDateTime64When Paid recorded the signal. For backfilled signals this is the send time.
effective_timestampDateTime64When the usage happened: data.historicalTimestamp if sent, else created_at. Use for time-series.
customer_unit_idNullable(UUID)Customer unit the signal was attributed to. null when no unit was named or the named unit did not exist yet.
external_customer_unit_idNullable(String)Unit key sent with the signal. Use it to find the unit only when customer_unit_id is null.

Cost

fact_cost

One row per AI/LLM call. SUM(cost_amount) for total spend; group by vendor, model, customer_id, or product_id. Includes token usage and latency.

cost_amount is exact fractional cents: a single AI call usually costs a fraction of a cent, so values look like 3.71 (= $0.0371). Sums match the Cost Explorer in the Paid UI.

ColumnTypeDescription
cost_idStringUnique cost trace id (MongoDB ObjectID). Primary key.
trace_idStringOpenTelemetry trace id. Join to fact_signal.trace_id.
customer_idNullable(UUID)Customer attributed. NULL if unattributed.
external_customer_idNullable(String)External customer id you provided.
product_idNullable(UUID)Product attributed. NULL if unattributed.
external_agent_idNullable(String)External product/agent id you provided.
vendorStringAI provider (e.g. openai, anthropic, mistral).
modelStringModel identifier (e.g. gpt-4, claude-3-sonnet).
trace_nameStringOperation type (e.g. chat, embeddings).
cost_amountDecimal(28, 8)Exact cost in cents, fractional. SUM and divide by 100 for total spend.
cost_currencyStringCurrency code for cost_amount.
input_tokensInt64Input/prompt tokens consumed. 0 if unavailable.
output_tokensInt64Output/completion tokens generated. 0 if unavailable.
signal_nameNullable(String)Linked signal name, if attributed.
start_timeDateTime64When the call started. Use for time-series.
end_timeDateTime64When the call completed.
duration_msInt64Call duration in milliseconds.
pricing_usedNullable(String)JSON of the pricing config used. NULL on older traces.

Delivered value

fact_delivered_value

The business value delivered per signal, by value type. Join signal_id to fact_signal, or customer_id/product_id to dimensions.

Rows can be denominated in different currencies: organizations using value models can configure non-USD currencies, and delivered_value_cents is always in that row’s delivered_value_currency. Never sum delivered_value_cents across currencies; group by delivered_value_currency (or filter to one currency) first.

ColumnTypeDescription
signal_idStringSource signal id (MongoDB ObjectID).
signal_nameStringSemantic event type name.
organization_idStringOrganization that owns the signal.
product_idNullable(String)Internal product UUID.
customer_idNullable(String)Internal customer UUID.
value_type_idStringValue type identifier (UUID for legacy rows, slug for value-model rows).
value_type_nameStringDisplay name of the value type.
value_type_slugStringStable slug for the value type.
delivered_value_centsDecimal(28, 8)Exact monetary value in cents, in delivered_value_currency. May carry fractional cents; round after aggregating, not per row.
delivered_value_currencyStringCurrency code the cents are denominated in (e.g. USD, EUR). Not always USD.
unit_valueFloat64Raw unit value (e.g. hours saved).
unitStringUnit identifier.
unit_categoryStringUnit category (e.g. duration, count).
effective_timestampDateTime64Historical timestamp, else created_at.
created_atDateTime64When the source signal was created.

Revenue and billing

fact_order

Contracts and subscriptions. One row per order. Join customer_id to dim_customer, plan_id to dim_plan. Compare total_billed_amount to total_amount for billing progress.

ColumnTypeDescription
idUUIDOrder UUID. Primary key.
display_idStringHuman-readable order id.
external_idStringOrder id in your external system.
customer_idUUIDCustomer who owns the contract.
billing_customer_idNullable(UUID)Bill-to customer if different from customer_id.
plan_idNullable(UUID)Pricing plan. NULL if none attached.
nameStringOrder display name.
statusStringdraft or active.
currencyStringISO currency code.
total_amountInt64Total contract value (cents) over the full term.
order_amountInt64Order amount (cents) before billing.
total_billed_amountInt64Cumulative billed so far (cents, incl tax).
billed_amount_no_taxInt64Total billed excluding tax (cents).
billed_taxInt64Total tax billed so far (cents).
pending_billing_amountInt64Amount not yet billed (cents).
payment_termsStringDueOnReceipt, Net15, Net30, …
subscription_termsInt32Term length in billing periods.
start_dateDateTime64Contract start date.
end_dateNullable(DateTime64)Contract end date. NULL if open-ended.
metadataStringUser-defined JSON metadata.
created_atDateTime64When created.
updated_atDateTime64When last modified.

fact_order_line

Product-level order line items link products to revenue. SUM(total_amount) by product_id for revenue-by-product. Filter effective_until IS NULL for current lines only.

ColumnTypeDescription
idUUIDOrder line UUID. Primary key.
display_idStringHuman-readable line id.
order_idUUIDParent order. Join to fact_order.id.
product_idUUIDProduct on this line. Join to dim_product.id.
customer_idUUIDCustomer who owns the order (denormalized).
currencyStringCurrency code (denormalized from order).
nameStringLine item name.
descriptionStringLine item description.
line_typeStringSTANDARD, PRORATION_CREDIT, or PRORATION_CHARGE.
statusStringdraft or active.
total_amountInt64Line total contract value (cents).
total_billed_amountInt64Cumulative billed on this line (cents, incl tax).
billed_amount_no_taxInt64Total billed excluding tax (cents).
billed_taxInt64Tax billed on this line (cents).
effective_untilNullable(DateTime64)When superseded by an amendment. NULL = current.
start_dateDateTime64Line billing start date.
end_dateNullable(DateTime64)Line billing end date. NULL if open-ended.
created_atDateTime64When created.
updated_atDateTime64When last modified.

fact_invoice

One row per invoice. SUM(total_incl_tax) for revenue; filter status = 'posted' for finalized invoices. Use due_date + payment_status for aging analysis.

ColumnTypeDescription
idUUIDInvoice UUID. Primary key.
display_numberStringHuman-readable invoice number (e.g. INV-001).
display_idStringShort id shown in the UI.
customer_idUUIDCustomer billed. Join to dim_customer.id.
order_idNullable(UUID)Order this invoice belongs to. NULL for manual invoices.
statusStringbuilding, draft, pending, posted, voided, canceled, error.
payment_statusStringpending, paid, partiallyPaid, overdue, error.
sourceStringorder_based or manual.
currencyStringISO currency code.
total_excl_taxInt64Total excluding tax (cents).
total_incl_taxInt64Total including tax (cents). Primary revenue metric.
tax_amountInt64Tax amount (cents).
tax_rateFloat64Tax rate as a fraction (0.2 = 20%).
tax_exemptBoolWhether the invoice is tax-exempt.
discount_amountInt64Total discount applied (cents).
amount_paidInt64Amount collected (cents).
amount_dueInt64Outstanding amount owed (cents).
amount_remainingInt64Remaining balance after payments and credit notes (cents).
credit_notes_totalInt64Total credited back via credit notes (cents).
issue_dateDateTime64When issued. Primary date for revenue time-series.
posted_dateNullable(DateTime64)When finalized/posted. Use for revenue recognition.
due_dateNullable(DateTime64)Payment due date.
start_dateDateTime64Billing period start.
end_dateNullable(DateTime64)Billing period end.
metadataStringUser-defined JSON metadata.
created_atDateTime64When created.
updated_atDateTime64When last modified.

fact_invoice_line

One row per line on an invoice. Join order_line_id → fact_order_line.id → dim_product.id to break invoiced revenue down by product.

ColumnTypeDescription
idUUIDInvoice line UUID. Primary key.
display_idStringHuman-readable line id.
invoice_idUUIDParent invoice. Join to fact_invoice.id.
order_idNullable(UUID)Order this line relates to.
order_line_idNullable(UUID)Order line this was generated from.
descriptionStringLine item description.
payment_statusStringpending, paid, partiallyPaid, overdue, error.
currencyStringISO currency code.
quantityInt32Quantity billed (e.g. signals, seats, units).
amount_before_discountInt64Amount before discounts (cents).
discount_amountInt64Discount applied (cents).
total_before_taxInt64Total after discount, before tax (cents).
taxInt64Tax amount (cents).
tax_rateFloat64Tax rate as a fraction.
total_after_taxInt64Total including tax (cents). Primary per-line revenue metric.
balance_amountInt64Unpaid balance remaining (cents).
credited_amountInt64Amount credited back via credit notes (cents).
start_dateDateTime64Billing period start.
end_dateDateTime64Billing period end.
created_atDateTime64When created.
updated_atDateTime64When last modified.
order_line_attribute_idNullable(UUID)Priced attribute this line bills. Carries the pricing config. NULL for manual lines.
charge_typeStringHow the line is charged: oneTime, recurring, seatBased (all fixed) or usage (metered). Empty for manual lines.
billing_typeStringAdvance (pre-pay) or Arrears (post-pay). Empty if unknown.
pricing_modelStringPerUnit, VolumePricing, GraduatedPricing, PrepaidCredits, BracketedPrepaidCredits, PercentOfTotal, or CostPlus. Empty if unknown.

fact_payment

One row per payment received. SUM(amount) for cash collected; filter payment_status = 'posted' for confirmed payments. Join invoice_id to fact_invoice.id for reconciliation.

ColumnTypeDescription
idUUIDPayment UUID. Primary key.
display_idStringHuman-readable payment id.
customer_idUUIDCustomer who paid. Join to dim_customer.id.
invoice_idNullable(UUID)Invoice this payment is applied to.
order_idNullable(UUID)Order this payment is associated with.
payment_typeStringcreditCard, bankTransfer, ach, cash, check.
payment_statusStringdraft, posted, canceled, processing, failed, requiresAction.
amountInt64Payment amount (cents).
currencyStringISO currency code.
allocationsInt64Amount allocated to invoice lines (cents).
balanceInt64Unallocated balance remaining (cents).
payment_dateDateTime64When paid/received. Primary date for cash-flow time-series.
metadataStringUser-defined JSON metadata.
created_atDateTime64When created.
updated_atDateTime64When last modified.

fact_usage_summary

Usage per signal per billing window: one row per priced attribute of an order line per billing window, built from the same billing record as invoicing. Filter status = 'billed' and SUM(subtotal) by signal_name to see which signals drive revenue. Compare signals_quantity to included_quantity to see overage.

ColumnTypeDescription
idUUIDBilling window id, stable and one per attribute and window. The same id the usage cells API returns.
customer_idUUIDCustomer this usage is for.
order_idUUIDOrder this usage is billed under.
order_line_idUUIDOrder line attributed. Join for usage-by-product.
invoice_idNullable(UUID)Invoice the window was billed on. NULL while collecting and for skipped windows.
signal_nameStringSignal name this usage relates to.
statusStringcollecting (open), billed (closed onto an invoice), skipped (closed with nothing to bill), or voided (billed onto an invoice later voided or canceled).
currencyStringCurrency code for subtotal.
signals_quantityInt64Usage quantity. Once closed, the quantity the window was billed on (for meter-backed products, the meter’s result); while collecting, the signals so far.
signal_countInt64Net number of signals in the window: signals counted minus signals moved out, for example by an order amendment.
included_quantityNullable(Int64)Units included free before billing. NULL if none.
min_quantityNullable(Int64)Minimum billable quantity (minimum commit). NULL if none.
subtotalNullable(Int64)Billed amount in cents, before discount and tax: the invoice line’s amount. 0 when skipped. NULL while collecting; SUM skips NULLs.
start_dateDateTime64Billing window start.
end_dateDateTime64Billing window end.
created_atDateTime64When the window’s first usage was recorded.
updated_atDateTime64When usage or the close last changed the window.
order_line_attribute_idUUIDPriced attribute of the order line. With next_billing_date, the window’s key.
invoice_line_idNullable(UUID)Invoice line the window was billed on. Join to fact_invoice_line.id. NULL while collecting and for skipped windows.
next_billing_dateDateTime64Billing date that closes the window.

A few rows from older billing share one invoice line between two windows; the line’s amount is split between them, so SUM(subtotal) still matches the invoice.

Consistency. Billing windows and invoices are copied into the analytics store independently. Just after a window closes, it can briefly read billed with invoice_id, invoice_line_id and subtotal still NULL, until its invoice arrives. A billed window whose invoice line was later deleted keeps invoice_id, invoice_line_id and subtotal NULL.

Credits

fact_credit_transaction

One row per credit grant, spend, or pending grant. Filter type = 'SPEND' for consumption; group by signal_name or product_id for usage breakdowns. Join credits_currency_id to dim_credits_currency.

ColumnTypeDescription
idUUIDCredit transaction UUID. Primary key.
customer_idUUIDCustomer this transaction belongs to.
product_idNullable(UUID)Product associated. NULL for non-product grants.
credits_currency_idUUIDWhich credits currency was used.
order_idNullable(UUID)Order that triggered this transaction.
typeStringGRANT, SPEND, or PENDING_GRANT.
origin_codeStringAlways empty; origin now lives on the grant. Kept for compatibility.
amountDecimal(30, 6)Credit amount, fractional. Positive for grants, negative for spends.
balance_beforeDecimal(30, 6)Balance before this transaction.
balance_afterDecimal(30, 6)Balance after this transaction.
signal_nameStringSignal that triggered the spend. Empty if not signal-triggered.
signal_mongo_idStringId of the triggering signal. Links to fact_signal.signal_id.
signal_created_atNullable(DateTime64)When the triggering signal was created.
spend_group_idNullable(UUID)Groups related spends from the same signal.
created_atDateTime64When the transaction occurred.
external_customer_unit_idNullable(String)Key of the customer unit the credits moved for. null if none.
effective_atNullable(DateTime64)Business-effective time. Report on coalesce(effective_at, created_at).

Customer unit history

fact_customer_unit_event

One row per change to a customer unit: created, renamed, retyped, made billable or non-billable, moved, or deleted. Rows are never changed or removed. A unit’s state at a time t is its last event at or before t; order by version to replay changes in order. Who made a change and unit metadata values are not included.

ColumnTypeDescription
idUUIDEvent UUID. Primary key.
customer_idUUIDCustomer that owns the unit.
customer_unit_idUUIDUnit that changed. Join to dim_customer_unit.id.
external_idStringYour key for the unit.
event_typeStringCREATED, UPDATED, MOVED, or DELETED.
from_parent_idNullable(UUID)Parent before the change. null on CREATED and for a root.
to_parent_idNullable(UUID)Parent after the change, on every event. null for a root.
from_parent_external_idNullable(String)Key of the parent before the change.
to_parent_external_idNullable(String)Key of the parent after the change.
depth_beforeNullable(Int16)Depth before the change; the root is 1. null on CREATED.
depth_afterInt16Depth after the change.
subtree_sizeNullable(Int32)Units carried by a move, the unit included. MOVED only.
name_beforeNullable(String)Name before the change. null on CREATED.
name_afterStringName after the change.
external_type_beforeNullable(String)Level label before the change.
external_type_afterNullable(String)Level label after the change.
status_beforeNullable(String)ACTIVE, DELETED, or DRAFT before the change.
status_afterStringStatus after the change.
is_billable_beforeNullable(Bool)The unit’s own billable setting before the change. null on CREATED and on older events.
is_billable_afterNullable(Bool)The unit’s own billable setting after the change. null on older events.
changed_fieldsArray(String)What changed: name, external_type, status, is_billable, metadata, parent.
actor_typeStringuser, api_key, or system (Paid itself, for example a unit created at ingest).
sourceStringapi, dashboard, or system.
created_atDateTime64When the change was made (UTC).
versionInt64Order of the change. Sort by this, not created_at.

Changelog

October 2026: fact_usage_summary is built from the billing record. It now reads the same record invoicing uses. Before, windows closed after September 17, 2026 stayed collecting with no invoice, so billed revenue was undercounted. What changes:

  • id is the billing window id the usage cells API returns. It is stable, but it is not the id this table returned before.
  • subtotal is Nullable(Int64): NULL while a window is collecting, since the amount is decided when the window closes. Before, it showed a running estimate. SUM(subtotal) skips NULLs; use coalesce(subtotal, 0) where a number is required.
  • status adds skipped, for a window closed with nothing to bill. voided now means the window was billed onto an invoice that was later voided or canceled.
  • There is one row per billing window. Closed windows with no usage now appear, usually as skipped.
  • New columns, appended after the existing ones: order_line_attribute_id, invoice_line_id, and next_billing_date.