Skip to main content
POST
/
v1
/
graphs
/
domain
cURL
curl -X POST 'https://api.supermodeltools.com/v1/graphs/domain' \
  -H 'Idempotency-Key: <idempotency-key>' \
  -H 'X-Api-Key: <api-key>' \
  -F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'
{
  "status": "completed",
  "jobId": "abc-123-def",
  "result": {
    "runId": "smart-sampling-a1b2c3d4",
    "domains": [
      {
        "name": "BillingAccount",
        "descriptionSummary": "Handles billing and account management",
        "keyFiles": [
          "src/domain/billing.ts",
          "src/services/billing.service.ts"
        ],
        "responsibilities": [
          "Account creation",
          "Payment processing"
        ],
        "subdomains": [
          {
            "name": "PaymentProcessing",
            "descriptionSummary": "Processes payment transactions"
          }
        ]
      },
      {
        "name": "UsageSummary",
        "descriptionSummary": "Tracks and summarizes usage metrics",
        "keyFiles": [
          "src/domain/usage.ts"
        ],
        "responsibilities": [
          "Usage tracking",
          "Metrics aggregation"
        ],
        "subdomains": []
      }
    ],
    "relationships": [
      {
        "from": "BillingAccount",
        "to": "UsageSummary",
        "type": "aggregates",
        "strength": 0.8,
        "reason": "BillingAccount aggregates usage data for billing purposes"
      }
    ],
    "fileAssignments": [
      {
        "filePath": "src/domain/billing.ts",
        "domainName": "BillingAccount"
      },
      {
        "filePath": "src/domain/usage.ts",
        "domainName": "UsageSummary"
      }
    ],
    "functionAssignments": [
      {
        "functionId": "func-123",
        "subdomainName": "PaymentProcessing",
        "parentDomain": "BillingAccount"
      }
    ],
    "unassignedFunctions": [
      {
        "functionId": "func-456",
        "reason": "Utility function with unclear domain association"
      }
    ],
    "classAssignments": [
      {
        "classId": "class-789",
        "domainName": "BillingAccount"
      }
    ],
    "functionDescriptions": [
      {
        "functionId": "func-123",
        "descriptionSummary": "Processes incoming payment transactions",
        "domainName": "BillingAccount"
      },
      {
        "functionId": "func-456",
        "descriptionSummary": "Aggregates usage metrics for billing period"
      }
    ],
    "stats": {
      "domainCount": 2,
      "relationshipCount": 1,
      "fileAssignments": 2,
      "functionAssignments": 1,
      "unassignedFunctions": 1,
      "classAssignments": 1
    }
  }
}

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.

Body

multipart/form-data
file
file
required

Zipped repository archive containing the code to analyze.

Response

Domain graph (job completed)

Async response envelope for domain classification 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).