> ## Documentation Index > Fetch the complete documentation index at: https://www.canva.dev/docs/button/llms.txt > Use this file to discover all available pages before exploring further. # Editing designs Edit an existing design with the JavaScript API. After a user [creates a design](https://www.canva.dev/docs/button/html/creating-designs/), they may want to edit that design at a later point in time. To enable this, Canva provides your website with the ID of the user's design. You can use this ID to re-open a design in the Canva editor. This part of the tutorial series explains how to open an existing design in the Canva editor. ## Step 1: Get the ID of the user's design To get the ID of the user's design, register callbacks with the [`onDesignOpen`](https://www.canva.dev/docs/button/javascript/api-reference/on-design-open/) and [`onDesignPublish`](https://www.canva.dev/docs/button/javascript/api-reference/on-design-publish/) methods: ```javascript api.createDesign({ design: { type: "Poster", }, onDesignOpen: (opts) => { console.log(opts.designId); }, onDesignPublish: (opts) => { console.log(opts.designId); }, }); ``` The `onDesignOpen` callback runs when the user opens a design via the Canva Button. The `onDesignPublish` callback runs when the user publishes a design via the Canva editor. Both of these callbacks receive an `opts.designId` argument that contains the ID of the user's design. When your website receives the ID of a user's design, it can save the ID for later use, but it doesn't particularly matter *how* the website saves the ID. Some common patterns are persisting the ID to a database or storing it locally via [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). ## Step 2: Open an existing design in the Canva editor To open an existing design in the Canva editor, call the [`editDesign`](https://www.canva.dev/docs/button/javascript/api-reference/edit-design/) method: ```javascript api.editDesign({ design: { id: "DESIGN ID GOES HERE", }, }); ``` At a minimum, the `editDesign` method expects an `opts.design.id` argument. This argument must contain the ID of a design that Canva can open in the editor. The `editDesign` method accepts many of the same arguments as the [`createDesign`](https://www.canva.dev/docs/button/javascript/api-reference/create-design/) method, but the arguments are not identical. The main difference is that the `editDesign` method doesn't accept the `opts.design.type` argument. This is because the [design type](https://www.canva.dev/docs/button/reference/design-types/) of an existing design can't be changed. **Tip:** You can pass the `onDesignOpen` and `onDesignPublish` methods into the `createDesign` *and* `editDesign` methods. ## Example ```markup