Activation API
The activation router manages score-driven activation targets. Push scores and tier changes to Salesforce fields, trigger Customer.io segments, and send Slack alerts when accounts cross tier thresholds.
Router namespace: activation
Source: src/server/trpc/routers/activation.ts
Procedures
| Procedure | Type | Access | Description |
|---|---|---|---|
getConfig | query | tenant | Current activation target configuration |
updateConfig | mutation | admin | Update activation targets |
getRecentRuns | query | admin | Recent activation run history |
triggerActivation | mutation | admin | Manually trigger activation to selected targets |
getConfig
Returns the current activation configuration including Salesforce push settings, Customer.io segment mappings, and Slack alert configuration.
activation.getConfig.queryOptions()
Input
None.
Response
{
"salesforce": {
"enabled": true,
"pushScores": true,
"pushTiers": true,
"fieldMappings": {
"fitScore": "Fit_Score__c",
"engagementScore": "Engagement_Score__c",
"tier": "Score_Tier__c"
}
},
"customerio": {
"enabled": true,
"segmentByTier": true,
"tierSegmentPrefix": "score_tier_"
},
"slack": {
"enabled": false,
"webhookConfigured": false,
"alertOnTierChange": true,
"alertTiers": ["hot"]
}
}
updateConfig
Updates activation target configuration. Partial updates are supported -- only include the targets you want to change.
activation.updateConfig.mutationOptions(options)
Access: Admin only
Input
| Field | Type | Required | Description |
|---|---|---|---|
salesforce | object | No | Salesforce push configuration |
salesforce.enabled | boolean | No | Enable/disable Salesforce push |
salesforce.pushScores | boolean | No | Push numeric scores to CRM fields |
salesforce.pushTiers | boolean | No | Push tier labels to CRM fields |
customerio | object | No | Customer.io segment configuration |
customerio.enabled | boolean | No | Enable/disable Customer.io segments |
customerio.segmentByTier | boolean | No | Auto-segment contacts by tier |
slack | object | No | Slack alert configuration |
slack.enabled | boolean | No | Enable/disable Slack alerts |
slack.alertOnTierChange | boolean | No | Alert when entities change tier |
slack.alertTiers | string[] | No | Which tiers trigger alerts |
Response
{ "success": true }
Example
const trpc = useTRPC();
const mutation = useMutation(
trpc.activation.updateConfig.mutationOptions({
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: trpc.activation.getConfig.queryKey(),
});
},
})
);
mutation.mutate({
slack: { enabled: true, alertTiers: ["hot", "warm"] },
});
getRecentRuns
Returns recent activation run history with status and target details.
activation.getRecentRuns.queryOptions(input)
Access: Admin only
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
limit | number (1-100) | No | 20 | Maximum runs to return |
Response
[
{
"id": "run_abc123",
"startedAt": "2026-03-05T10:30:00.000Z",
"completedAt": "2026-03-05T10:30:45.000Z",
"status": "completed",
"targets": ["salesforce", "customerio"],
"entityCount": 340,
"errors": []
}
]
| Status | Description |
|---|---|
completed | All targets activated successfully |
partial | Some targets failed (check errors array) |
failed | Activation failed entirely |
triggerActivation
Manually triggers activation to one or more targets. Normally activation runs automatically after scoring, but this allows ad-hoc pushes.
activation.triggerActivation.mutationOptions(options)
Access: Admin only
Input
| Field | Type | Required | Description |
|---|---|---|---|
targets | ("salesforce" | "customerio" | "slack")[] | Yes | Targets to activate |
Response
{
"runId": "run_def456",
"status": "completed",
"results": {
"salesforce": { "success": true, "entitiesPushed": 340 },
"customerio": { "success": true, "segmentsUpdated": 4 }
}
}
Trigger activation after manual scoring runs or configuration changes to push updated scores immediately rather than waiting for the next scheduled run.
Related Pages
- Scoring API -- Scoring execution that feeds activation
- Writeback API -- Salesforce field writeback details
- Connector API -- Connector setup for activation targets