Skip to main content

Self-Healing APIs

apitree monitors all active APIs and automatically detects schema changes, authentication failures, and consecutive outages. The self-healing system attempts auto-remediation and provides actionable steps when manual intervention is needed.

Healing Scenarios

  • SCHEMA_CHANGE — Response structure changed. System extracts old/new schemas, diffs fields, and auto-maps renames using Jaccard similarity (≥50% threshold).
  • FIELD_RENAMED — All removed fields matched to added fields. Auto-mapping applied, snapshot updated.
  • STRUCTURE_CHANGED — Partial field mapping. Manual review flagged with mapping candidates.
  • AUTH_FAILURE — HTTP 401/403 detected. Credential fingerprint logged. Remediation steps generated: expired key rotation, format check, IP allowlist verification.
  • CONSECUTIVE_FAILURE — 3+ consecutive health check failures trigger P1 critical alert.

Blue/Green Deploy Gate

Before auto-deploying a fix, the Self-Healing Grader runs 5 checks: schema_match, key_fields, latency_ok (<1.5x baseline p95), error_rate_ok (<10%), trial_count_ok (≥3 samples). All must pass for auto-deploy.

Auth Failure Remediation

When a 401/403 is detected, the system checks: (1) Are credentials configured? (2) Does the response indicate expiration or invalidation? (3) Has the credential format changed? Remediation steps are returned with each alert.

API Endpoints

  • POST /admin/health-check/run — Run batch health check
  • POST /admin/health-check/heal/:slug — Trigger self-healing for one API
  • POST /admin/health-check/heal-all — Heal all schema-changed APIs
  • POST /admin/health-check/verify-credentials — Bulk credential verification
  • GET /admin/health-check/auth-alerts — Auth failure alerts

MCP + SDK

  • • MCP tool: get_system_health — platform health summary for agents
  • • SDK: apitree.compare(slugs) — includes health/latency metrics
apitree · AI-Native API Marketplace