Create a diagram
Create a diagram in the token's team from SQL DDL or a schema patch. Requires a token with the write ability.
Send exactly one of ddl or schema. A schema patch is applied inline, so the response is 201 with the finished diagram. SQL DDL is parsed by a background import: the response is 201 when that import finishes within the request (status is ready, or failed if the SQL could not be used), and 202 with status: importing when it does not. In the 202 case, poll GET /diagrams/{uuid} every poll_after_seconds until status is ready or failed; the schema endpoints return 409 until then.
Retrying the same request (same token, name, driver, and payload) returns the diagram the first attempt made, with replayed: true, rather than creating a second one: 200 once it is ready, 202 while its import is still running. The window is the running import, plus two minutes after it finishes. A failed create is never returned, so a retry makes a fresh attempt.
Canvas positions and sizes (left, top, width, height) are not accepted here — the layout is computed. Rate limit: 10 requests/minute per token.
Request
- Base URLhttps://api.drawsql.app/v1
- AuthHTTP bearer
Request body
Response
A retry of a request that already created a diagram, which is now ready. The body is the existing diagram, with replayed: true.
Example response
{
"data": {
"error": {
"code": "parse_failed"
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.