> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diagramkit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Change a diagram

`POST /api/v1/diagrams/:id/revisions`. The change keeps everything you did not mention and becomes the next version; downloads give it from then on. One change at a time: a second one while the first runs gets `409 conflict`.

![Diagram of a diagram's versions: POST /api/v1/diagrams makes version 1 (the AI draws it, 5 credits a page); POST /revisions makes version 2 (the AI keeps everything not mentioned, 2 credits a changed page); POST /edits retyping Cache to Redis cache makes version 3 (exact edit, no AI, 0 credits); POST /animate makes version 4, the same drawing with motion (8 credits a page). Downloads are always the latest version, and a second change while one is running gets 409 conflict.](https://mintcdn.com/diagramkit/sWlxT_qLaDK7vTGW/images/versions.png?fit=max\&auto=format\&n=sWlxT_qLaDK7vTGW\&q=85\&s=1322e332b9062c1c03d7037e7bfaada0)

Every change, edit or animation adds a version, and downloads always give the latest.

```bash theme={null}
curl https://app.diagramkit.ai/api/v1/diagrams/DIAGRAM_ID/revisions \
  -H "Authorization: Bearer $DIAGRAMKIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Label the arrows with the time each step takes", "wait": 180}'
```

| Parameter | In | Values | Default | What it does |
| - | - | - | - | - |
| `prompt` | revisions body | text, 1 to 4,000 characters | required | What to change: "label the arrows with the time each step takes", "use metric units", "make it fit a narrow column". |
| `images` | revisions body | as for making one | `[]` | Pictures to work from for the change. |
| `preset` | revisions body | a [preset](/presets.md), or null for none | the diagram's own | Make this change, and later ones, for another destination. |
| `prompt` | animate body | text, up to 1,000 characters | none | How it should move, if you have a preference. |
| `wait` | both bodies | whole seconds, 0 to 300 | `0` | Hold the request open until the new version is done. |
| `Idempotency-Key` | header | any text, up to 200 characters | none | As for making one: a key used before returns that job. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.