Analytics schema reference

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

Conventions:

  • Monetary columns are integer cents unless noted — divide by 100 for display.
  • UInt64/Int64 values are returned as JSON strings (precision-safe); parse client-side.
  • Nullable(...) columns can be null.
  • Facts join to dimensions on the *_id columns called out below.

How the tables join

dim_customer ──< fact_signal >── dim_product
│ │ │ (trace_id)
│ │ └──────────────< fact_cost >── dim_product
│ │
│ └──< fact_delivered_value (signal_id ↔ fact_signal.signal_id)
├──< fact_order >── dim_plan
│ └──< fact_order_line >── dim_product
├──< fact_invoice >──< fact_invoice_line (order_line_id ↔ fact_order_line.id)
├──< fact_payment (invoice_id ↔ fact_invoice.id)
├──< fact_usage_summary (order_line_id ↔ fact_order_line.id)
└──< fact_credit_transaction >── dim_credits_currency

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

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_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) — 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 the signal was recorded. Use for time-series.

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.

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_amountInt64Cost in cents. SUM 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.

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_idStringUUID of the value type.
value_type_nameStringDisplay name of the value type.
value_type_slugStringStable slug for the value type.
delivered_value_centsInt64Monetary value in cents.
delivered_value_currencyStringCurrency code.
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 & 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 — links 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_idfact_order_line.iddim_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.

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

Billed usage per signal per billing period — links usage to revenue. SUM(subtotal) by signal_name to see which signals drive revenue. Compare signal_count to included_quantity to see overage.

ColumnTypeDescription
idUUIDUsage summary UUID. Primary key.
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 this usage was billed on. NULL if not yet invoiced.
signal_nameStringSignal name this usage relates to.
statusStringcollecting, billed, or voided.
currencyStringCurrency code for subtotal.
signals_quantityInt64Raw number of signals recorded in the period.
signal_countInt64Billable signal count after dedup/filtering.
included_quantityNullable(Int64)Signals included free before billing.
min_quantityNullable(Int64)Minimum billable quantity (minimum commit).
subtotalInt64Billed amount for this usage (cents).
start_dateDateTime64Billing period start.
end_dateDateTime64Billing period end.
created_atDateTime64When created.
updated_atDateTime64When last modified.

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_codeStringSource of the movement (e.g. purchased).
amountInt64Credit amount. Positive for grants, negative for spends.
balance_beforeInt64Balance before this transaction.
balance_afterInt64Balance 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.