Skip to main content
POST
/
v1
/
analysis
/
impact
git diff origin/main...HEAD > changes.diff
git archive --format=zip HEAD -o repo.zip
curl -X POST 'https://api.supermodeltools.com/v1/analysis/impact' \
  -H 'Idempotency-Key: <idempotency-key>' \
  -H 'X-Api-Key: <api-key>' \
  -F '[email protected];type=application/zip' \
  -F '[email protected];type=text/plain'
{
  "status": "completed",
  "jobId": "abc-123-def",
  "result": {
    "metadata": {
      "totalFiles": 142,
      "totalFunctions": 891,
      "targetsAnalyzed": 1,
      "analysisMethod": "reverse_reachability_call_graph",
      "analysisStartTime": "2026-02-09T12:00:00Z",
      "analysisEndTime": "2026-02-09T12:00:45Z"
    },
    "impacts": [
      {
        "target": {
          "file": "src/services/billing.ts",
          "name": "calculateTotal",
          "line": 45,
          "type": "function"
        },
        "blastRadius": {
          "directDependents": 8,
          "transitiveDependents": 31,
          "affectedFiles": 12,
          "affectedDomains": [
            "Billing",
            "Checkout",
            "Notifications"
          ],
          "riskScore": "high",
          "riskFactors": [
            "High fan-in (8 direct callers)",
            "Deep dependency chain (5 levels)",
            "Crosses 3 domain boundaries"
          ]
        },
        "affectedFunctions": [
          {
            "file": "src/handlers/checkout.ts",
            "name": "processCheckout",
            "line": 12,
            "type": "function",
            "distance": 1,
            "relationship": "direct_caller"
          }
        ],
        "affectedFiles": [
          {
            "file": "src/handlers/checkout.ts",
            "directDependencies": 3,
            "transitiveDependencies": 7
          }
        ],
        "entryPointsAffected": [
          {
            "file": "src/routes/checkout.ts",
            "name": "POST /checkout",
            "type": "route_handler"
          }
        ]
      }
    ],
    "globalMetrics": {
      "mostCriticalFiles": [
        {
          "file": "src/services/billing.ts",
          "dependentCount": 31,
          "riskScore": "high"
        }
      ],
      "crossDomainDependencies": [
        {
          "from": "Billing",
          "to": "Checkout",
          "edgeCount": 5
        },
        {
          "from": "Billing",
          "to": "Notifications",
          "edgeCount": 2
        }
      ]
    }
  }
}

Authorizations

X-Api-Key
string
header
required

API key issued by the control plane for accessing data plane resources.

Headers

Idempotency-Key
string
required

Unique identifier for this request for idempotency and tracing.

Query Parameters

targets
string

Comma-separated list of file paths or file:functionName pairs to analyze. If omitted, analyzes all files and returns a global coupling/risk map. Examples: 'src/services/billing.ts', 'src/services/billing.ts:calculateTotal,src/auth/login.ts'.

Body

multipart/form-data
file
file
required

Zipped repository archive containing the code to analyze.

diff
file

Optional unified diff (output of git diff). When provided, changed files are automatically extracted and used as analysis targets. This is the recommended input for CI/CD pipelines. If both diff and targets are provided, the targets from both are merged.

Response

Impact analysis (job completed)

Async response envelope for impact analysis operations.

status
enum<string>
required

Current status of the job.

Available options:
pending,
processing,
completed,
failed
jobId
string
required

Unique identifier for the job.

retryAfter
integer<int32>

Recommended seconds to wait before polling again.

error
string

Error message (present when status is failed).

result
object

The result (present when status is completed).