| name | clari-upgrade-migration |
| description | Handle Clari API version changes and export schema migrations.
Use when Clari updates their API, export format changes,
or migrating from v3 to v4 API.
Trigger with phrases like "upgrade clari", "clari api migration",
"clari schema change", "clari v4 migration".
|
| allowed-tools | Read, Write, Edit, Bash(curl:*), Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","revenue-intelligence","forecasting","clari"] |
| compatibility | Designed for Claude Code |
Clari Upgrade & Migration
Overview
Handle Clari API changes: version migrations, export schema updates, and Copilot API adoption.
Instructions
Step 1: Check Current API Version
curl -s -H "apikey: ${CLARI_API_KEY}" \
https://api.clari.com/v4/export/forecast/list | jq .
Step 2: Schema Change Detection
def detect_schema_changes(
current_export: dict, expected_fields: set[str]
) -> dict:
if not current_export.get("entries"):
return {"status": "empty", "changes": []}
actual_fields = set(current_export["entries"][0].keys())
new_fields = actual_fields - expected_fields
removed_fields = expected_fields - actual_fields
return {
"status": "changed" if new_fields or removed_fields else "compatible",
"new_fields": list(new_fields),
"removed_fields": list(removed_fields),
}
EXPECTED_FIELDS = {
"ownerName", "ownerEmail", "forecastAmount", "quotaAmount",
"crmTotal", "crmClosed", "adjustmentAmount",
}