Diagrams

Get a diagram's schema

A diagram's schema in the curated, "schema-pure" profile: driver, schema_version, tables (each carrying its columns and indexes nested inline, in schema order), and relationships. Layout, groups, and sticky notes are omitted. For the verbatim, re-importable document use /schema-full (this response is a strict subset of it: same nesting, same field names).

Two representations. application/json is the default. Send Accept: text/markdown (or ?format=ai) for the AI Schema Format — a compact Markdown rendering built for pasting into an LLM, with ?level=simple for column names only and ?level=detailed (the default) for types and constraints.

Supports ETag conditional requests. The ETag is a hash of this payload, so a canvas-only edit (moving a table, recoloring) still returns 304 Not Modified; each representation carries its own ETag. Rate limit: 30 requests/minute per token (serialization is heavier here).

get/diagrams/{uuid}/schema

Request

  • Base URL
    https://api.drawsql.app/v1
  • Auth
    HTTP bearer

Path parameters

uuidstring uuid required
Example:123e4567-e89b-12d3-a456-426614174000

The diagram's UUID.

Query parameters

format'json' | 'ai'

json (default) or ai for the AI Schema Format Markdown.

level'simple' | 'detailed'

Detail level for the Markdown representation. Ignored for JSON.

Headers

If-None-Matchstring

An ETag from a previous response. Returns 304 if unchanged.

Response

The schema.

Example response

{
  "data": {
    "driver": "mysql",
    "tables": [
      {
        "indexes": [
          {
            "type": "index"
          }
        ]
      }
    ],
    "relationships": [
      {
        "type": "one-to-one"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.