Skip to main content
POST
/
v1
/
graphs
/
domain
Domain graph
curl --request POST \
  --url https://api.supermodeltools.com/v1/graphs/domain \
  --header 'Content-Type: multipart/form-data' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-Api-Key: <api-key>' \
  --form file='@example-file'
{
  "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

runId
string
required

Unique identifier for this classification run

domains
object[]
required

Array of primary domain entities

relationships
object[]
required

High-level relationships between domains/subdomains

fileAssignments
object[]
required

Mapping of files to domains

functionAssignments
object[]
required

Mapping of functions to subdomains

unassignedFunctions
object[]
required

Functions that could not be assigned to a domain/subdomain

classAssignments
object[]
required

Mapping of classes to domains

stats
object
required
functionDescriptions
object[]

Optional enriched descriptions per function