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).
Request
- Base URLhttps://api.drawsql.app/v1
- AuthHTTP bearer
Path parameters
The diagram's UUID.
Query parameters
json (default) or ai for the AI Schema Format Markdown.
Detail level for the Markdown representation. Ignored for JSON.
Headers
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.