SKILL.md
AppFolio Upgrade & Migration
Overview
AppFolio property management integrations depend on versioned REST API endpoints that evolve with the platform. Upgrades can rename fields on property and tenant objects, change pagination models, deprecate work-order endpoints, and alter the basic-auth flow. This skill detects your current API version, maps deprecated response shapes to replacements, and rolls back automatically if the new version fails.
Prerequisites
- Current API version prefix documented (e.g.,
/api/v1/) - Access to the AppFolio API changelog and release notes
- Staging environment with test property and tenant data
- Client ID and secret stored in environment variables
- Existing integration test suite that covers core endpoints
Instructions
- Run version detection to compare your active API version against the latest.
- Review the AppFolio changelog for breaking changes between the two versions.
- Apply schema migration transforms to property and tenant response objects.
- Update endpoint URLs from the old version prefix to the new one.
- Switch pagination from offset to cursor-based if required by the new version.
- Run the smoke test suite against staging to verify all endpoints respond.
- Deploy to production with the rollback strategy enabled.
- Monitor error logs for 410/401 responses indicating missed migration steps.
Output
After a successful migration the skill produces:
- A
VersionInfoobject confirming current, latest, and deprecated versions - Transformed property and tenant objects matching the new schema
- Smoke test results for properties, tenants, work orders, and accounting endpoints
- Rollback log entries if any endpoint fell back to the previous version
Version Detection
interface VersionInfo { current: string; latest: string; deprecated: string[]; }
async function detectApiVersion(baseUrl: string, headers: Record<string, string>): Promise<VersionInfo> {
const res = await fetch(`${baseUrl}/api/status`, { headers });
const body = await res.json();
const current = res.headers.get("X-AppFolio-Api-Version") ?? body.api_version;
const deprecated: string[] = body.deprecated_versions ?? [];
if (deprecated.includes(current)) {
console.warn(`Version ${current} is deprecated. Migrate to ${body.latest_version}.`);
}
return { current, latest: body.latest_version, deprecated };
}
