[REFERENCE]

Documentation

Archway turns natural-language and diagram-as-code descriptions into rendered architecture diagrams. The platform exposes two surfaces: a typed DSL for authoring diagrams, and a versioned REST API for managing them programmatically.

01

REFERENCE

These two pages are the source of truth for the public developer surface. They are generated against the same code that runs in production.

02

DEVELOPER_SURFACE

Most integrations only need three things: an API key, a diagram ID, and the DSL string for that diagram.

  • / Authenticate with a Bearer API key (prefix ak_) issued fromDashboard → API Keys.
  • / Call POST /api/v1/diagrams with either a dslSource string (deterministic) or a prompt string (AI generation).
  • / Read or update the DSL via GET and PATCH /api/v1/diagrams/[id].
  • / Export the raw DSL through GET /api/v1/diagrams/[id]/export.
03

GENERATION_PATHS

Beyond authoring DSL by hand, Archway can derive a diagram from several upstream artifacts. Each path produces the same canonical ArchModel shape for cloud-arch and C4, so a diagram's downstream views and edits work the same regardless of how it was created.

  • / Natural language → AI generates DSL for any of the seven diagram types. POST /api/v1/diagrams with a prompt field.
  • / GitHub repository → scans dependencies, frameworks, and infrastructure files, then generates a cloud architecture or C4 container diagram. Visit /scan with a repo URL.
  • / Database schema file (schema.prisma, Drizzle db/schema.ts, or SQL DDL) → deterministically parsed into an Entity Relationship Diagram in under a second. No AI call. Surfaced on the scan page when the scanner detects one of these files.
  • / Infrastructure-as-code (Terraform, Docker Compose, CloudFormation, Kubernetes manifests) → parsed into the canonical model deterministically and rendered as cloud architecture.
  • / Whiteboard image / screenshot → AI vision produces DSL. POST /api/ai/image with a multipart form.
04

DSL_AT_A_GLANCE

Archway DSL is a brace-delimited text format. A minimal cloud architecture diagram looks like this:

diagram "Hello Archway" {
  zone "Edge" color blue {
    node cdn "CDN" icon aws/cloudfront
  }
  zone "Origin" color teal {
    node api "API" icon aws/lambda
  }
  connect cdn -> api "HTTPS"
}

The full grammar — including all seven diagram types, valid keywords, color palette, and edge styles — lives in the DSL Reference.

05

STABILITY

The /api/v1 namespace follows additive versioning: new optional fields and new endpoints may appear without a version bump; breaking changes ship as /api/v2. The DSL parser is permissive about whitespace and comments but strict about keywords; unknown tokens raise a ParseError with line and column information.

06

SUPPORT

Bug reports and feature requests:contact@archdiagram.dev. Security disclosures follow the policy on theSecurity page.