Product Org Updates

What Product Org Updates Are

Product Org Updates let you send product workspace/tenant data to TrailSpark via a dedicated webhook endpoint. This is designed for PLG companies that want to incorporate account-level product data into lead scoring -- plan tiers, user counts, MRR, trial status, feature adoption, and custom metrics.

Webhook Endpoint

POST https://app.trailspark.ai/api/product-orgs/webhook/{apiKey}

The API key must be created with Product Org Updates endpoint type.

Creating a Product Org API Key

  1. Go to Settings > API Keys > Create API Key
  2. Select Product Org Updates as the endpoint type
  3. Configure the Payload Template to map fields from your payload to TrailSpark fields
  4. Name the key, optionally set expiration and HMAC secret
  5. Click Create API Key
Copy your API key immediately. It is only displayed once.

Payload Template Configuration

The payload template maps incoming webhook fields to TrailSpark's product org fields using dot-notation paths into your payload.

Required Fields

FieldDescriptionExample Path
Product Org IDUnique workspace/tenant identifierworkspace_id, groupId, data.tenant.id

Optional Core Fields

FieldDescriptionExample Path
NameWorkspace display nameworkspace_name, traits.name
Plan IDInternal plan identifierplan_id, traits.plan
Plan NameHuman-readable plan nameplan_name, traits.plan_name
User CountUsers in workspaceuser_count, traits.employees
MRRMonthly recurring revenue (cents)mrr, traits.mrr
Trial StatusTrial state (active, expired, converted)trial_status, traits.trial_status
Last Active AtLast activity timestamplast_active_at, activity.last_seen
Feature FlagsEnabled features (JSON object)feature_flags, data.features

Custom Fields

Add any product-specific metrics as key-value pairs:

Custom Field NamePayload Path
projects_countmetrics.total_projects
api_calls_30dusage.api_calls_last_30_days
storage_gbusage.storage_gigabytes

Payload Examples

Flat Structure

json
1{
2  "workspace_id": "ws_abc123",
3  "workspace_name": "Acme Corp Workspace",
4  "plan_id": "plan_pro_annual",
5  "plan_name": "Pro Annual",
6  "user_count": 47,
7  "mrr": 49900,
8  "trial_status": "converted",
9  "last_active_at": "2024-01-15T10:30:00Z",
10  "feature_flags": {"sso_enabled": true, "api_access": true},
11  "projects_count": 23,
12  "api_calls_30d": 15420
13}

Segment Group Call

javascript
1analytics.group("ws_abc123", {
2  name: "Acme Corp Workspace",
3  plan: "pro",
4  plan_name: "Pro Annual",
5  employees: 47,
6  mrr: 49900,
7  trial_status: "converted"
8});

Segment sends this as:

json
1{
2  "type": "group",
3  "groupId": "ws_abc123",
4  "traits": {
5    "name": "Acme Corp Workspace",
6    "plan": "pro",
7    "plan_name": "Pro Annual",
8    "employees": 47,
9    "mrr": 49900,
10    "trial_status": "converted"
11  }
12}

Template configuration for this payload:

FieldPath
Product Org IDgroupId
Nametraits.name
Plan IDtraits.plan
Plan Nametraits.plan_name
User Counttraits.employees
MRRtraits.mrr
Trial Statustraits.trial_status

Nested Structure

json
1{
2  "data": {
3    "tenant": {"id": "tenant_xyz789", "name": "Enterprise Client"},
4    "subscription": {
5      "plan_id": "enterprise",
6      "plan_name": "Enterprise",
7      "mrr_cents": 299900,
8      "trial": {"status": "not_applicable"}
9    },
10    "usage": {"active_users": 156, "last_activity": "2024-01-15T14:22:00Z"}
11  }
12}

How Product Orgs Connect to Leads

  1. Webhook creates target org: TrailSpark automatically creates a target organization when a Product Org Update is received
  2. Leads link via productOrgId: When lead signals include a matching productOrgId, the lead is linked to the same target organization
  3. Data appears in evaluation: Product org data surfaces as productOrgInfo in the LLM evaluation context, alongside CRM firmographic data
To link leads to product orgs, include a productOrgId field in your lead signals that matches the Product Org ID sent via this webhook.

Evaluation Context

Product org data appears in evaluation as:

json
1{
2  "productOrgInfo": [
3    {
4      "productOrgId": "ws_abc123",
5      "name": "Acme Corp Workspace",
6      "planName": "Pro Annual",
7      "userCount": 47,
8      "mrr": 49900,
9      "trialStatus": "converted",
10      "featureFlags": {"sso_enabled": true, "api_access": true},
11      "customFields": {"projects_count": 23, "api_calls_30d": 15420}
12    }
13  ]
14}

Troubleshooting

Webhook returns 403 -- The API key was not created with Product Org Updates endpoint type. Create a new key with the correct type.

Product org not created -- Verify the payload contains a value at the configured productOrgId path. Check for typos in nested path definitions.

Missing fields in evaluation -- Verify optional field paths match your actual payload structure.

Leads not linking to product org -- Ensure lead signals include productOrgId matching the product org's ID exactly (case-sensitive).

Next Steps