Skip to main content

Expansion Intelligence API

The Expansion Intelligence API manages the product affinity matrix and expansion signals. It includes endpoints for querying and recomputing co-adoption data, generating prioritized expansion signals, and updating signal status as opportunities progress.

GET /api/expansion/affinity

Returns the product affinity matrix showing co-adoption patterns between products. Auth: Requires authenticated session. Scoped to organization.

Query Parameters

ParameterTypeDefaultDescription
segmentstringFilter by segment (all, Enterprise, Mid-Market, SMB)

Response

FieldTypeDescription
matrixarrayAffinity entries enriched with product names and categories
productsarrayFull product catalog for the organization

Response Fields: matrix[]

FieldTypeDescription
product_a_idstringSource product ID
product_b_idstringTarget product ID
product_a_namestringSource product name
product_b_namestringTarget product name
co_adoption_countnumberAccounts owning both products
co_adoption_ratenumberCo-adoption percentage
avg_time_to_cross_sell_daysnumberAverage days between product starts
avg_arr_upliftnumberAverage ARR of target product when co-adopted
segmentstringSegment filter applied
sample_sizenumberAccounts with source product
confidencestringhigh, medium, or low

POST /api/expansion/affinity

Recomputes the affinity matrix from current account product data. Deletes existing entries for the org and inserts fresh computations. Auth: Requires authenticated session. Scoped to organization.

Request Body

No body required.

Response

FieldTypeDescription
successbooleanOperation result
entries_computednumberTotal affinity entries generated
productsnumberProducts analyzed
accountsnumberAccounts analyzed

Computation Flow

  1. Fetch active products, account_products, and accounts
  2. Compute overall affinity matrix (all segments combined)
  3. Compute per-segment affinity (Enterprise, Mid-Market, SMB)
  4. Delete existing matrix entries for the org
  5. Insert all new entries

GET /api/expansion/signals

Returns prioritized expansion signals with account and product enrichment. Auth: Requires authenticated session. Scoped to organization.

Query Parameters

ParameterTypeDefaultDescription
account_idstringFilter by account
statusstringFilter by status (pending, pitched, won, dismissed)
prioritynumberFilter by priority (1-5)
product_idstringFilter by target product

Response

FieldTypeDescription
signalsarrayEnriched expansion signal records
kpiobjectSummary KPIs
productsarrayProduct catalog

Response Fields: kpi

FieldTypeDescription
total_opportunitiesnumberTotal expansion signals
estimated_expansion_arrnumberSum of estimated ARR across all signals
high_priority_countnumberSignals with priority 1 or 2
avg_affinity_scorenumberAverage affinity score

Response Fields: signals[]

FieldTypeDescription
account_idstringAccount ID
account_namestringAccount name
account_segmentstringAccount segment
account_arrnumberCurrent account ARR
target_product_idstringRecommended product ID
target_product_namestringRecommended product name
source_product_idstringStrongest affinity source (nullable)
source_product_namestringSource product name (nullable)
affinity_scorenumberComposite expansion score (0-1)
adoption_readinessnumberAdoption readiness component (0-1)
estimated_arrnumberEstimated expansion ARR
prioritynumber1 (highest) to 5 (lowest)
reasonstringHuman-readable explanation
statusstringSignal status
current_productsarrayAccount’s current active products

POST /api/expansion/signals

Generates expansion signals for all active accounts using affinity data. Auth: Requires authenticated session. Scoped to organization.

Request Body

No body required.

Response

FieldTypeDescription
successbooleanOperation result
signals_generatednumberTotal signals created
accounts_analyzednumberAccounts evaluated
products_evaluatednumberProducts in catalog

Side Effects

  • Deletes existing pending signals for the org (preserves pitched, won, dismissed)
  • Inserts freshly computed signals

PATCH /api/expansion/signals

Updates the status of an expansion signal as it progresses through the sales process. Auth: Requires authenticated session. Scoped to organization.

Request Body

FieldTypeRequiredDescription
signal_idstringYesSignal ID to update
statusstringYesNew status: pending, pitched, won, dismissed

Response

FieldTypeDescription
successbooleanOperation result
signalobjectUpdated signal record
See the Product Affinity data model page for full details on the affinity matrix computation and expansion scoring methodology.