Skip to main content

API Reference

The ArchGraph REST API is available at api.archgraph.dev.

Authentication

All API requests require authentication via one of:

  • API Key: Authorization: Bearer ag_... header
  • Clerk JWT: For web dashboard sessions

Plan Gating

Endpoints are tagged with the minimum plan tier required:

  • Free — included with the free plan
  • Pro — requires the Pro plan or higher
  • Enterprise — requires the self-hosted Enterprise deployment

Endpoints

Tools — Free (8)

MethodEndpointDescription
POST/api/tools/searchSearch code nodes by name, type, or rich query syntax
POST/api/tools/statsGraph statistics (node counts by type)
POST/api/tools/impactBlast radius analysis (upstream/downstream callers)
POST/api/tools/contextNode neighborhood: callers, callees, file, security flags
POST/api/tools/sourceSource code body for a symbol
POST/api/tools/search_callsSearch caller/callee relationships (CALLS edges)
POST/api/tools/detect_changesRecent file changes with downstream impact
POST/api/tools/import_treeImport/dependency graph between modules; circular import detection

Tools — Pro (12)

MethodEndpointDescription
POST/api/tools/queryRead-only Cypher queries against the code graph
POST/api/tools/find_vulnerabilitiesCVE/GHSA matches on dependencies
POST/api/tools/taint_pathsTaint propagation source→sink chains
POST/api/tools/data_flowData flow tracking through assignments and calls
POST/api/tools/clustersFunctional clusters (community detection) with cohesion scores
POST/api/tools/churnFile modification hotspots from git history
POST/api/tools/cfgControl flow graph (basic blocks + branches) for a function
POST/api/tools/processesExecution flow traces from entry points
POST/api/tools/diff_summaryCompare current repo state against stored graph
POST/api/tools/cross_repo_impactCross-repo blast radius — accepts workspace_id
POST/api/tools/cross_repo_taintCross-repo taint flow — accepts workspace_id
POST/api/tools/dependency_graphRepo-level dependency graph for a workspace

Workspaces — Pro

Workspaces group repositories for cross-repo analysis. The workspace_id returned here is passed to the cross_repo_* and dependency_graph tools.

MethodEndpointDescription
POST/api/workspacesCreate a workspace
GET/api/workspacesList workspaces
GET/api/workspaces/:idWorkspace detail with member repos
PUT/api/workspaces/:idUpdate name/description
DELETE/api/workspaces/:idDelete a workspace
POST/api/workspaces/:id/reposAdd a repo to the workspace
DELETE/api/workspaces/:id/repos/:repo_idRemove a repo from the workspace
POST/api/workspaces/:id/analyzeTrigger fresh extraction across all member repos
GET/api/workspaces/:id/dependenciesCross-repo dependency graph

Repositories

MethodEndpointDescription
GET/api/reposList connected repos
POST/api/reposConnect a repo
DELETE/api/repos/:idRemove a repo
POST/api/repos/:id/extractTrigger extraction (see below)
POST/api/repos/:id/webhookRetry webhook registration
GET/api/repos/:id/statusExtraction status
GET/api/repos/publicBrowse public catalog

POST /api/repos/:id/extract

Enqueues a fresh extraction. Returns 202 Accepted with a job id; poll GET /api/repos/:id/status (or GET /api/repos) until status="ready".

Request body (all fields optional — sane defaults if omitted or body absent):

FieldTypeDefaultNotes
include_bodybooltruePersist function/class source bodies on graph nodes
include_gitbooltrueRun git-history pipeline (churn, blame)
include_scipbool | nulltrueSCIP precise call resolution. On for every plan — turning this off cripples cross-file call accuracy
include_cvebool | nulltrue on Pro/Enterprise, ignored on FreeCVE/GHSA dependency matching. Free callers cannot force-enable
enable_joern_taintbool | nullfalseJoern-backed inter-procedural taint. Pro/Enterprise only — silently zeroed for Free regardless of value. JVM cost ~1–3 min/run, so opt-in even on paid tiers
force_fullbool | nullfalseWipe the stored manifest before enqueueing → forces a full (non-incremental) rebuild. Use after a core-logic change so clustering / process tracing / symbol index see the entire call graph instead of the modified-file delta

Plan rules:

  • Free — Tree-sitter parse + SCIP + git history. CVE and Joern taint are unavailable.
  • Pro / Enterprise — adds CVE matching by default and exposes Joern taint as an opt-in.

Response (202)ExtractionTriggerResult:

{
"job_id": "uuid",
"status": "pending",
"coalesced": false,
"queued_retrigger": false,
"triggered_by": "manual"
}

coalesced / queued_retrigger are surfaced for symmetry with the webhook fan-out path; manual triggers always carry triggered_by="manual" and coalesced=false because the route's 409 short-circuit (below) pre-empts the coalesce branch.

409 Conflict — when an extraction is already pending or extracting for this repo:

{
"detail": {
"error": "extraction_in_progress",
"message": "An extraction is already running for this repo.",
"job_id": "uuid"
}
}

The web dashboard treats this as a non-error: it surfaces the existing job_id so the user can keep watching the in-flight run. Webhook-driven triggers do not hit this path — they coalesce silently, queue a follow-up via pending_re_extract, and return coalesced=true.

Code Hosts

OAuth-backed integrations for GitHub, GitLab, Bitbucket, and Azure DevOps. Used to discover and connect repositories from third-party hosts.

MethodEndpointDescription
GET/api/code-hostsList configured code hosts
POST/api/code-hostsAdd a code host connection
DELETE/api/code-hosts/:idRemove a code host connection
GET/api/code-hosts/providersList supported providers

Webhooks

Inbound receivers for repository events from external code hosts. These endpoints are called by GitHub/GitLab/Bitbucket/Azure — not invoked directly by clients.

MethodEndpointDescription
POST/api/webhooks/githubGitHub webhook receiver
POST/api/webhooks/gitlabGitLab webhook receiver
POST/api/webhooks/bitbucketBitbucket webhook receiver
POST/api/webhooks/azureAzure DevOps webhook receiver

Audit Log — Enterprise

MethodEndpointDescription
GET/api/auditQuery the tenant audit log (filterable by action, date range)

API Keys

MethodEndpointDescription
GET/api/keysList API keys
POST/api/keysCreate API key
POST/api/keys/:id/rotateRotate an API key (old key valid for 24h grace period)
DELETE/api/keys/:idRevoke API key

Account

MethodEndpointDescription
GET/api/auth/meCurrent user profile + plan + tenant
DELETE/api/auth/meDelete account (GDPR — removes Postgres, Neo4j, Zoekt data)

Health

MethodEndpointDescription
GET/healthService health check