> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# SaveProjectDesign

# Package: containersProjects

# Namespace: ContainersProjects

# Method link: https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/save-project-design.md

## Permission Scopes:
Manage AppSmith Projects: SCOPE.CONTAINERS.PROJECTS

## Introduction

Saves a project's design as a new draft release.

Specify the complete design-token document in `tokensJson`, and the release that the user is
currently viewing in `baseReleaseId`. The new draft release branches from `baseReleaseId`, even
if a newer release exists. Saving a design doesn't change the project's live app.

The response includes the ID of the new release and a short-lived token for previewing it. After
the save, the project's `headReleaseId` is set to the new release.

To record the saved version in a conversation, specify the conversation's ID in `conversationId`.
A `CHECKPOINT` message is then added to the conversation. If the checkpoint can't be added, the
design is still saved.

For projects whose `platform` is `HIMALAYA_MOBILE`, call
[Get Himalaya Authorization](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/get-himalaya-authorization.md)
first, and specify the returned `canonicalApp`.

---

## REST API

### Schema

```
 Method: saveProjectDesign
 Description: Saves a project's design as a new draft release.  Specify the complete design-token document in `tokensJson`, and the release that the user is currently viewing in `baseReleaseId`. The new draft release branches from `baseReleaseId`, even if a newer release exists. Saving a design doesn't change the project's live app.  The response includes the GUID of the new release and a short-lived token for previewing it. After the save, the project's `headReleaseId` is set to the new release.  To record the saved version in a conversation, specify the conversation's GUID in `conversationId`. A `CHECKPOINT` message is then added to the conversation. If the checkpoint can't be added, the design is still saved.  For projects whose `platform` is `HIMALAYA_MOBILE`, call [Get Himalaya Authorization](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/get-himalaya-authorization.md) first, and specify the returned `canonicalApp`.
 URL: https://www.wixapis.com/containers/projects/v1/projects/{projectId}/save-design
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  baseReleaseId, tokensJson, himalayaControlToken
 Method parameters: 
   param name: baseReleaseId | type: baseReleaseId | description: GUID of the release that the user is currently viewing.  The new draft release branches from this release, even if a newer release exists. | required: true | validation: maxLength 100
   param name: canonicalApp | type: canonicalApp | description: Canonical slug of the project's app, exactly as returned in `canonicalApp` by [Get Himalaya Authorization](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/get-himalaya-authorization.md). This isn't the app's GUID.  Required when the project's `platform` is `HIMALAYA_MOBILE`. The value is verified on the server.  | validation: maxLength 200
   param name: conversationId | type: conversationId | description: GUID of the [conversation](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-chat/introduction.md) that the design is saved from.  When specified, a `CHECKPOINT` message that marks the saved version is added to the conversation. The conversation must belong to the project.  | validation: maxLength 100
   param name: himalayaControlToken | type: himalayaControlToken | description: Short-lived control credential for the project's app releases.  Used for this call only. It isn't stored or returned. | required: true | validation: maxLength 4096
   param name: tokensJson | type: tokensJson | description: Complete design-token document, as a string that contains a single JSON object.  Specify the whole document, not only the values that changed. Keep any token groups and light or dark mode values that you didn't change. | required: true | validation: maxLength 65536
 Return type: SaveProjectDesignResponse
  - name: himalayaReleaseId | type: string | description: GUID of the saved draft release.  | validation: maxLength 100
  - name: previewToken | type: string | description: Short-lived token for previewing the saved draft release.  | validation: maxLength 4096
  - name: previewTokenExpiresAt | type: string | description: Date and time the preview token expires.  | validation: format date-time


```

### Examples

### Save Project Design
Saves a project's design as a new draft release and adds a checkpoint to the conversation.

```curl
curl -X POST \
'https://www.wixapis.com/containers/projects/v1/projects/8046df3c-7575-4098-a5ab-c91ad8f33c47/save-design' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "baseReleaseId": "rel-4f9c2a1b7d3e",
  "tokensJson": "{\"colors\":{\"primary\":\"#6F4E37\",\"background\":\"#FFF8F0\"},\"fonts\":{\"heading\":\"Playfair Display\"}}",
  "himalayaControlToken": "<CONTROL_TOKEN>",
  "canonicalApp": "coffee-corner-8046df3c",
  "conversationId": "1f5b2c8e-9a3d-4c21-8b77-2d2f6e0a9c10"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.containers.projects.saveProjectDesign(projectId, baseReleaseId, options)
 Description: Saves a project's design as a new draft release.  Specify the complete design-token document in `tokensJson`, and the release that the user is currently viewing in `baseReleaseId`. The new draft release branches from `baseReleaseId`, even if a newer release exists. Saving a design doesn't change the project's live app.  The response includes the GUID of the new release and a short-lived token for previewing it. After the save, the project's `headReleaseId` is set to the new release.  To record the saved version in a conversation, specify the conversation's GUID in `conversationId`. A `CHECKPOINT` message is then added to the conversation. If the checkpoint can't be added, the design is still saved.  For projects whose `platform` is `HIMALAYA_MOBILE`, call [Get Himalaya Authorization](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/get-himalaya-authorization.md) first, and specify the returned `canonicalApp`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  projectId, baseReleaseId, options.tokensJson, options.himalayaControlToken, options
 Method parameters: 
   param name: baseReleaseId | type: string | description: GUID of the release that the user is currently viewing.  The new draft release branches from this release, even if a newer release exists. | required: true | validation: maxLength 100
   param name: options | type: SaveProjectDesignOptions  none | required: true 
        - name: tokensJson | type: string | description: Complete design-token document, as a string that contains a single JSON object.  Specify the whole document, not only the values that changed. Keep any token groups and light or dark mode values that you didn't change. | required: true | validation: maxLength 65536
        - name: himalayaControlToken | type: string | description: Short-lived control credential for the project's app releases.  Used for this call only. It isn't stored or returned. | required: true | validation: maxLength 4096
        - name: canonicalApp | type: string | description: Canonical slug of the project's app, exactly as returned in `canonicalApp` by [Get Himalaya Authorization](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/get-himalaya-authorization.md). This isn't the app's GUID.  Required when the project's `platform` is `HIMALAYA_MOBILE`. The value is verified on the server.  | validation: maxLength 200
        - name: conversationId | type: string | description: GUID of the [conversation](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-chat/introduction.md) that the design is saved from.  When specified, a `CHECKPOINT` message that marks the saved version is added to the conversation. The conversation must belong to the project.  | validation: maxLength 100
   param name: projectId | type: string | description: GUID of the project whose design to save. | required: true | validation: format GUID
 Return type: PROMISE<SaveProjectDesignResponse>
  - name: himalayaReleaseId | type: string | description: GUID of the saved draft release.  | validation: maxLength 100
  - name: previewToken | type: string | description: Short-lived token for previewing the saved draft release.  | validation: maxLength 4096
  - name: previewTokenExpiresAt | type: Date | description: Date and time the preview token expires.  


```

### Examples

### Save a design change as a new draft release
Saves the complete design-token document and adds a checkpoint for the saved version to the conversation.

```javascript
import { projects } from "@wix/containers";

async function saveProjectDesign() {
  const response = await projects.saveProjectDesign(
    "8046df3c-7575-4098-a5ab-c91ad8f33c47",
    "rel-4f9c2a1b7d3e",
    {
      tokensJson: "{\"colors\":{\"primary\":\"#6F4E37\",\"background\":\"#FFF8F0\"},\"fonts\":{\"heading\":\"Playfair Display\"}}",
      himalayaControlToken: "<CONTROL_TOKEN>",
      canonicalApp: "coffee-corner-8046df3c",
      conversationId: "1f5b2c8e-9a3d-4c21-8b77-2d2f6e0a9c10",
    },
  );
}

/* Promise resolves to:
 * {
 *   "himalayaReleaseId": "rel-8b2e6d0c9a41",
 *   "previewToken": "<PREVIEW_TOKEN>",
 *   "previewTokenExpiresAt": "2026-07-29T10:45:00.000Z"
 * }
 */

```

### saveProjectDesign (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { projects } from '@wix/containers';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { projects },
  // Include the auth strategy and host as relevant
});


async function saveProjectDesign(projectId,baseReleaseId,options) {
  const response = await myWixClient.projects.saveProjectDesign(projectId,baseReleaseId,options);
};
```

---