CRM Retention Analytics Skill
Purpose
Generate structured retention analytics reports (QBR packets, risk queues, action boards, receivables reviews, churn validation) from the ApexCloud Retention Operations API.
API Base URL
Read environment_access.md in the current solver directory. Use the GDPEVO_ENV_BASE_URL value as the API base URL. Do not hard-code localhost as the operative base URL.
Core Endpoint Families
Account & Profile
GET /api/accounts/<account_id>— account profile (ARR, segment, tenure, renewal date, health flags)GET /api/accounts/<account_id>/metrics?start=YYYY-MM&end=YYYY-MM— monthly revenue, SLA, usage metricsGET /api/accounts/<account_id>/tickets?start=YYYY-MM-DD&end=YYYY-MM-DD— support ticket counts and SLA breachesGET /api/accounts/<account_id>/nps?start=YYYY-MM-DD&end=YYYY-MM-DD— NPS scores by survey date
Finance & Pipeline
GET /api/finance/ar-aging— A/R aging snapshot; filter byas_ofdate when neededGET /api/opportunities— open/won/lost pipeline; filter by quarter/close-date rangeGET /api/hr/summary— headcount and claims for ops contextGET /api/events/performance— event orders and revenue for ops context
Product Health
GET /api/health/usage— product usage trends (often account-scoped or portfolio-scoped)
Exports
GET /exports/churn/train.csv— churn model training dataGET /exports/churn/validation.csv— churn model validation dataGET /exports/churn/candidates.csv— candidate accounts with predicted churn probabilities
Workflow Rules
- Parse the prompt first: extract account IDs, date ranges, months, as-of dates, quarter, region, and any explicit due dates.
- Read the answer template:
input/payloads/answer_template.jsondefines the exact output schema, required keys, and ordering. - Fetch data in dependency order:
- Account profiles first (to validate IDs and get ARR/segment/tenure).
- Metrics/tickets/NPS in parallel per account.
- Finance/pipeline/HR/event data as a second wave.
- CSV exports last (only for churn-model tasks).
- Cross-reference carefully:
- A/R customers link to CRM accounts by legal name matching;
link_statusis"linked"when a CRMaccount_idis found, else"unlinked". - Use the exact
account_idvalues from the prompt; never invent or normalize them.
- A/R customers link to CRM accounts by legal name matching;
- Compute derived fields before assembling JSON:
average_revenue= mean of monthly revenues.arr_at_risk= sum ofcurrent_arrfor accounts withrisk_levelin (critical,high,medium).net_revenue_exposure=arr_at_risk−open_expansion_pipeline.win_rate_pct=won_count/ (won_count+lost_count) × 100.ticket_trend= compare early-month ticket count to late-month count:improvingif decreasing,worseningif increasing,flatif same.
- Rank deterministically: when the prompt asks for a ranked list, sort by the primary metric (risk score, churn probability, etc.) descending; break ties by
account_idascending. - Populate
policy_codesexactly as required by the answer template. Common codes observed:- Risk model:
RS-6 - ARR source:
REV-4 - Support hygiene:
SUP-8 - Action priority:
ACT-5 - Board sort:
BORD-4 - Exposure formula:
EXP-6 - Calendar policy:
CAL-5 - Receivable trigger:
RCP-7 - CRM match:
CM-5 - Pipeline window:
PW-6 - Follow-up scope:
FS-4 - Model protocol:
MOD-7 - Probability scale:
PRB-4 - Deployment rule:
DEP-5 - Outreach mapping:
OUT-2
- Risk model:
Controlled Labels (Enum Vocabularies)
Use these exact strings; never paraphrase.
Risk Levels
critical,high,medium,low
Primary / Outreach Actions
collections_followup— overdue receivables existtechnical_recovery— SLA degradation, usage decline, or NPS droprenewal_save— renewal window approaching, low tenureexecutive_qbr— strategic account needing executive engagementnurture_monitor— healthy account, no immediate riskno_action— low risk, no follow-up needed
Reason Codes
renewal_window— within renewal periodoverdue_receivable—overdue_balance > 0nps_drop— NPS below threshold or decliningsla_degradation— SLA compliance below 100 % or trending downusage_decline— product usage decreasinglow_tenure_high_churn— short tenure combined with high churn probabilityexpansion_offset— large open expansion pipeline offsets riskclean_billings— no overdue balance, no critical issues
Ticket Trend
improving,worsening,flat
Metric Sources
crm_closed_won,support_export,sla_report,nps_survey,billing_snapshot,ar_aging,pipeline_crm,event_dashboard,hr_report
Review Owner
solutions_engineering,customer_success,finance_ops
Agenda Topics (QBR)
partnership_overview,q2_metrics,performance_highlights,q3_initiatives,technical_recovery,commercial_expansion
Link Status (Receivables)
linked,unlinked
Accuracy Band
90_plus
Model Checks
tenure_risk_direction:negative,positive,not_assesseduses_billing_arr_source: boolean
Output Precision Rules
| Field Type | Precision |
|---|---|
| Currency (revenue, ARR, balance, pipeline) | 2 decimal places |
| Percentages (SLA, win rate, accuracy) | 1 decimal place |
| Counts (tickets, accounts, orders) | Integer |
| Risk scores | Integer |
| Churn probabilities | 3 decimal places |
Business Rules & Pitfalls
- Collections first: if
overdue_balance > 0,primary_actionshould normally becollections_followupunless other signals are overwhelmingly stronger. - Renewal window + low tenure: combine into
renewal_saveaction withrenewal_windowandlow_tenure_high_churnreason codes. - Expansion offset: when an account has a large
open_expansion_pipeline, includeexpansion_offsetinreason_codesand subtract from exposure calculations. - Clean billings: only add
clean_billingsreason code whenoverdue_balance == 0and no critical/high risk factors are present. - Next touch due date: map from the prompt’s action-specific due dates; use
nullforno_actionaccounts. - Segment summary:
strategic_accounts+enterprise_accountsmust equal total accounts reviewed. Count segments from account profile data. - Do not include test answers: the skill must describe how to derive values, not provide pre-computed numbers.
- Do not access files outside the solver attempt directory: all inputs (prompt, answer template, environment) are inside the staged directory.
JSON Assembly Checklist
- Top-level keys match
answer_template.jsonexactly. - Arrays are ordered as specified (by rank, by date, or alphabetically when instructed).
- All enum values are from the controlled vocabularies above.
- Numeric precision matches the table.
policy_codesobject is present when the template requires it.- No extra keys, no missing required keys, no trailing commas.