{"openapi":"3.1.0","info":{"title":"diagramkit API","version":"1","description":"Make, change, animate and download diagrams. Full reference: /docs/api.md on diagramkit’s site."},"servers":[{"url":"https://app.diagramkit.ai/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key (aid_…) from Settings › API."}},"schemas":{"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"title":{"type":["string","null"]},"description":{"type":["string","null"],"description":"What the diagram shows and any assumptions it made."},"version":{"type":"integer","description":"How many versions it has; 0 until the first is made."},"animated":{"type":"boolean"},"preset":{"type":["string","null"],"description":"Where the diagram will be used, as it was made or last revised for; null without one."},"progress":{"type":["string","null"]},"image_url":{"type":["string","null"],"format":"uri"},"downloads":{"type":["object","null"],"additionalProperties":{"type":"string","format":"uri"},"description":"png, jpg, svg, pdf, and mp4 and gif when animated."},"recommended_download":{"type":"object","description":"With a preset, once there is a version: the download it offers first, as format, url and the query options in that url.","properties":{"format":{"type":"string"},"url":{"type":"string","format":"uri"},"options":{"type":"object","additionalProperties":{"type":"string"}}}},"error":{"type":["object","null"],"description":"Why a failed job failed. type no_credits (the balance cannot pay for the planned pages) and too_many_pages (a set longer than max_pages or 100 pages) are refused before anything is drawn or charged; otherwise generation_failed.","properties":{"type":{"type":"string","enum":["generation_failed","no_credits","too_many_pages"]},"message":{"type":"string"}}},"created_at":{"type":"string","format":"date-time"},"applied":{"type":"array","items":{"type":"object"},"description":"Edits only: the wording changes made."},"moved":{"type":"array","items":{"type":"object","properties":{"part":{"type":"string"},"wide":{"type":"array","items":{"type":"number"}},"compact":{"type":"array","items":{"type":"number"}}}},"description":"Edits only: each part an edit moved, with its new box [left, top, width, height] per layout."},"skipped":{"type":"array","items":{"type":"object"},"description":"Edits only: the wording changes not made, with a reason."}},"required":["id","status","version","animated","created_at"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"string"}}},"required":["type","message"]}}},"Image":{"type":"object","properties":{"name":{"type":"string"},"mime":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif"]},"data_base64":{"type":"string","description":"Standard base64 without a data: prefix; up to 6 MB."}},"required":["name","mime","data_base64"]},"Part":{"type":"object","required":["id","kind","summary","wide"],"properties":{"id":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"kind":{"type":"string","enum":["node","cell","note","link","mark","text","line","shape","box"]},"summary":{"type":"string","description":"One line: what it is, its words, what it links to, whether it moves."},"text":{"type":"string","description":"Its words, up to 40 characters."},"inner":{"type":"integer","description":"How many parts sit inside it, listed with detail=true."},"tag":{"type":"string","description":"With detail=true."},"path":{"type":"string","description":"With detail=true: its position, which it also answers to."},"link":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"description":"For a link: the parts it joins."},"movable":{"type":"boolean"},"moves_with":{"type":"string","description":"The movable part it sits in."},"hidden":{"type":"boolean"},"wide":{"type":"array","items":{"type":"number"},"minItems":4,"maxItems":4,"description":"[left, top, width, height] in px."},"compact":{"type":"array","items":{"type":"number"},"minItems":4,"maxItems":4,"description":"[left, top, width, height] in px."},"offset":{"type":"object","description":"Its offset from where diagramkit placed it, per layout, when moved."}}}}},"paths":{"/diagrams":{"post":{"summary":"Make a diagram","operationId":"createDiagram","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"A key used before on this account returns that job instead of making another."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"images":{"type":"array","maxItems":4,"items":{"$ref":"#/components/schemas/Image"}},"animate":{"type":"boolean","description":"Make it animated. Left out, false unless the preset is ad or explainer_video."},"preset":{"type":["string","null"],"enum":["docs","blog","social","carousel","ad","data_story","explainer_video",null],"description":"Where the diagram will be used: docs, blog, social, carousel (a cover, numbered pages and an end card, 4:5), ad, data_story or explainer_video. It shapes the composition, text, pages and the downloads offered first; ad and explainer_video animate by default. The prompt's own words override it. Left out or null, a general diagram."},"max_pages":{"type":"integer","minimum":1,"maximum":100,"default":30,"description":"The most pages a set may draw. The API never asks first: a set with more fails with error type too_many_pages before anything is drawn or charged, its message naming the page count and cost."},"wait":{"type":"integer","minimum":0,"maximum":300,"default":0,"description":"Hold the request open until done or this many seconds pass."}}}}}},"responses":{"200":{"description":"The finished job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Accepted and still being made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"description":"no_credits: the balance cannot pay for this request (per page: 5 credits a new diagram, 2 a change, 8 an animation). Nothing is charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List recent diagrams","operationId":"listDiagrams","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"How many."}],"responses":{"200":{"description":"Newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"diagrams":{"type":"array","items":{"type":"object"}}}}}}}}}},"/diagrams/{id}":{"get":{"summary":"Get a job","operationId":"getDiagram","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wait","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":300,"default":0,"description":"Hold the request open until done or this many seconds pass."},"description":"Answer when the job finishes or after this long."}],"responses":{"200":{"description":"The finished job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Accepted and still being made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"description":"no_credits: the balance cannot pay for this request (per page: 5 credits a new diagram, 2 a change, 8 an animation). Nothing is charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a diagram and every version","operationId":"deleteDiagram","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}}}}},"/diagrams/{id}/revisions":{"post":{"summary":"Ask for a change","operationId":"reviseDiagram","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"A key used before on this account returns that job instead of making another."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"images":{"type":"array","maxItems":4,"items":{"$ref":"#/components/schemas/Image"}},"preset":{"type":["string","null"],"enum":["docs","blog","social","carousel","ad","data_story","explainer_video",null],"description":"A new destination for the diagram (null for none). Left out, it keeps its own."},"max_pages":{"type":"integer","minimum":1,"maximum":100,"default":30,"description":"The most pages a set may draw. The API never asks first: a set with more fails with error type too_many_pages before anything is drawn or charged, its message naming the page count and cost."},"wait":{"type":"integer","minimum":0,"maximum":300,"default":0,"description":"Hold the request open until done or this many seconds pass."}}}}}},"responses":{"200":{"description":"The finished job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Accepted and still being made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"description":"no_credits: the balance cannot pay for this request (per page: 5 credits a new diagram, 2 a change, 8 an animation). Nothing is charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/animate":{"post":{"summary":"Animate a diagram","operationId":"animateDiagram","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"A key used before on this account returns that job instead of making another."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":1000},"max_pages":{"type":"integer","minimum":1,"maximum":100,"default":30,"description":"The most pages a set may draw. The API never asks first: a set with more fails with error type too_many_pages before anything is drawn or charged, its message naming the page count and cost."},"wait":{"type":"integer","minimum":0,"maximum":300,"default":0,"description":"Hold the request open until done or this many seconds pass."}}}}}},"responses":{"200":{"description":"The finished job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Accepted and still being made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"description":"no_credits: the balance cannot pay for this request (per page: 5 credits a new diagram, 2 a change, 8 an animation). Nothing is charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/parts":{"get":{"summary":"List the editable parts of the latest version","operationId":"listDiagramParts","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":1},"description":"Which page of a multi-page diagram."},{"name":"detail","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Also list what sits inside each part: a node's words, an icon's shapes, a link's line and arrowheads."}],"responses":{"200":{"description":"What a person points at (nodes, links, notes, cells, chart marks, titles and labels), each with the id edits name it by, a summary, and its box [left, top, width, height] in px in the wide (900 px) and compact (390 px) layouts.","content":{"application/json":{"schema":{"type":"object","properties":{"diagram_id":{"type":"string"},"version":{"type":"integer"},"page":{"type":"integer"},"truncated":{"type":"boolean"},"inner":{"type":"integer","description":"Parts inside the listed ones, not listed without detail."},"layouts":{"type":"object","properties":{"wide":{"type":"integer"},"compact":{"type":"integer"}}},"parts":{"type":"array","items":{"$ref":"#/components/schemas/Part"}}}}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/edits":{"post":{"summary":"Edit without the AI: wording, and by part: restyle, hide, show, nudge, place, swap, move, align, distribute","operationId":"editDiagram","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"At least one edit. Parts are named by their ids from GET /diagrams/{id}/parts.","properties":{"page":{"type":"integer","minimum":1,"maximum":100,"default":1,"description":"Which page of a multi-page diagram."},"text":{"type":"array","maxItems":30,"description":"Wording. Also accepted as edits.","items":{"type":"object","required":["before","after"],"properties":{"before":{"type":"string","maxLength":600},"after":{"type":"string","maxLength":600}}}},"restyle":{"type":"array","maxItems":100,"items":{"type":"object","required":["part","style"],"properties":{"part":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"style":{"type":"object","additionalProperties":false,"properties":{"stroke":{"type":"string","maxLength":200},"fill":{"type":"string","maxLength":200},"background-color":{"type":"string","maxLength":200},"color":{"type":"string","maxLength":200},"font-family":{"type":"string","maxLength":200},"font-size":{"type":"string","maxLength":200},"font-weight":{"type":"string","maxLength":200},"visibility":{"type":"string","maxLength":200}},"description":"fill colours a shape or box, color its text; an empty value takes back an earlier change."}}}},"hide":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."}},"show":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"description":"Parts hidden earlier with hide."},"nudge":{"type":"array","maxItems":100,"items":{"type":"object","required":["part","dx","dy"],"properties":{"part":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"layout":{"type":"string","enum":["wide","compact","both"],"default":"wide","description":"wide: the desktop layout (900 px); compact: the phone layout (390 px); both: each layout the part has."},"dx":{"type":"number","minimum":-4000,"maximum":4000},"dy":{"type":"number","minimum":-4000,"maximum":4000}}},"description":"Shift a movable part dx, dy px from where it is now."},"place":{"type":"array","maxItems":100,"items":{"type":"object","required":["part","relative_to","side"],"properties":{"part":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"relative_to":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"side":{"type":"string","enum":["left","right","above","below"]},"gap":{"type":"number","minimum":0,"maximum":1000,"default":40},"layout":{"type":"string","enum":["wide","compact","both"],"default":"wide","description":"wide: the desktop layout (900 px); compact: the phone layout (390 px); both: each layout the part has."}}},"description":"Put a movable part beside another, centred on it across that side."},"swap":{"type":"array","maxItems":50,"items":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"b":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"layout":{"type":"string","enum":["wide","compact","both"],"default":"wide","description":"wide: the desktop layout (900 px); compact: the phone layout (390 px); both: each layout the part has."}}},"description":"Exchange two movable parts' positions, centre for centre."},"move":{"type":"array","maxItems":100,"items":{"type":"object","required":["part","dx","dy"],"properties":{"part":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."},"layout":{"type":"string","enum":["wide","compact","both"],"default":"wide","description":"wide: the desktop layout (900 px); compact: the phone layout (390 px); both: each layout the part has."},"dx":{"type":"number","minimum":-4000,"maximum":4000},"dy":{"type":"number","minimum":-4000,"maximum":4000}}},"description":"Offset in px from where diagramkit placed the part (0, 0 puts it back)."},"align":{"type":"object","required":["parts","to"],"properties":{"parts":{"type":"array","minItems":2,"maxItems":100,"items":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."}},"to":{"type":"string","enum":["left","center","right","top","middle","bottom"]},"layout":{"type":"string","enum":["wide","compact","both"],"default":"wide","description":"wide: the desktop layout (900 px); compact: the phone layout (390 px); both: each layout the part has."}}},"distribute":{"type":"object","required":["parts","axis"],"properties":{"parts":{"type":"array","minItems":3,"maxItems":100,"items":{"type":"string","maxLength":250,"description":"A part id from the parts list: a name from what the part is, such as \"node:api\", \"link:api->db\", \"text:monthly-revenue\", \"cell:0/2\" or \"mark:revenue/2024\", which stays the same through edits; or its position, such as \"0/2/1\"."}},"axis":{"type":"string","enum":["horizontal","vertical"]},"layout":{"type":"string","enum":["wide","compact","both"],"default":"wide","description":"wide: the desktop layout (900 px); compact: the phone layout (390 px); both: each layout the part has."}}},"styles":{"type":"array","maxItems":100,"description":"The canvas editor's own form, by element position.","items":{"type":"object","required":["path","style"],"properties":{"path":{"type":"string"},"label":{"type":"string","maxLength":80},"tag":{"type":"string"},"style":{"type":"object","additionalProperties":{"type":"string"}}}}},"moves":{"type":"array","maxItems":100,"description":"The canvas editor's own form, by move key.","items":{"type":"object","required":["key","layout","dx","dy"],"properties":{"key":{"type":"string"},"layout":{"type":"string","enum":["wide","compact"]},"dx":{"type":"number"},"dy":{"type":"number"}}}}}}}}},"responses":{"200":{"description":"The finished job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Accepted and still being made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"description":"no_credits: the balance cannot pay for this request (per page: 5 credits a new diagram, 2 a change, 8 an animation). Nothing is charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/image.png":{"get":{"summary":"PNG","operationId":"downloadPng","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"device","in":"query","required":false,"schema":{"type":"string","enum":["desktop","phone"],"default":"desktop"},"description":"Which layout: 900 px or 390 px wide."},{"name":"quality","in":"query","required":false,"schema":{"type":"string","enum":["web","high","print"],"default":"web"},"description":"web 1×, high 2×, print 300 dpi at width_in."},{"name":"width_in","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":20,"default":6.5},"description":"Printed width in inches, with quality=print."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":1},"description":"Which page of a multi-page diagram."}],"responses":{"200":{"description":"The file.","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/image.jpg":{"get":{"summary":"JPEG","operationId":"downloadJpeg","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"device","in":"query","required":false,"schema":{"type":"string","enum":["desktop","phone"],"default":"desktop"},"description":"Which layout: 900 px or 390 px wide."},{"name":"quality","in":"query","required":false,"schema":{"type":"string","enum":["web","high","print"],"default":"web"},"description":"web 1×, high 2×, print 300 dpi at width_in."},{"name":"width_in","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":20,"default":6.5},"description":"Printed width in inches, with quality=print."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":1},"description":"Which page of a multi-page diagram."}],"responses":{"200":{"description":"The file.","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/image.svg":{"get":{"summary":"SVG (paid plans)","operationId":"downloadSvg","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"device","in":"query","required":false,"schema":{"type":"string","enum":["desktop","phone"],"default":"desktop"},"description":"Which layout: 900 px or 390 px wide."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":1},"description":"Which page of a multi-page diagram."}],"responses":{"200":{"description":"The file.","content":{"image/svg+xml":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"plan_required: the account's plan does not include this download (SVG and PDF are on paid plans). Do not retry; PNG and JPEG work on every plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/image.pdf":{"get":{"summary":"PDF (paid plans)","operationId":"downloadPdf","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"device","in":"query","required":false,"schema":{"type":"string","enum":["desktop","phone"],"default":"desktop"},"description":"Which layout: 900 px or 390 px wide."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":1},"description":"Which page of a multi-page diagram."},{"name":"pages","in":"query","required":false,"schema":{"type":"string","enum":["all"]},"description":"Every page as one PDF, a page each."}],"responses":{"200":{"description":"The file.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"plan_required: the account's plan does not include this download (SVG and PDF are on paid plans). Do not retry; PNG and JPEG work on every plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/animation.mp4":{"get":{"summary":"MP4 of an animated diagram","operationId":"downloadMp4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"quality","in":"query","required":false,"schema":{"type":"string","enum":["low","medium","high"],"default":"medium"},"description":"Resolution and frame rate."},{"name":"size","in":"query","required":false,"schema":{"type":"string","enum":["chat","square","portrait","story","landscape"]},"description":"The frame the animation is fitted into. Left out, the frame of the diagram's preset (ad square, social portrait, blog, data_story and explainer_video landscape), or chat."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"One page of a multi-page diagram. Left out, every page plays in order in one video; a long set's still pages hold for less so it fits (at least 1.5 seconds), and one too long even so is refused with 422 too_long, saying how many pages fit."}],"responses":{"200":{"description":"The file.","content":{"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/diagrams/{id}/animation.gif":{"get":{"summary":"GIF of an animated diagram","operationId":"downloadGif","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"quality","in":"query","required":false,"schema":{"type":"string","enum":["low","medium","high"],"default":"medium"},"description":"Resolution and frame rate."},{"name":"size","in":"query","required":false,"schema":{"type":"string","enum":["chat","square","portrait","story","landscape"]},"description":"The frame the animation is fitted into. Left out, the frame of the diagram's preset (ad square, social portrait, blog, data_story and explainer_video landscape), or chat."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"One page of a multi-page diagram. Left out, every page plays in order in one video; a long set's still pages hold for less so it fits (at least 1.5 seconds), and one too long even so is refused with 422 too_long, saying how many pages fit."}],"responses":{"200":{"description":"The file.","content":{"image/gif":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}