> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# PrepareReleasePublication

# Package: containersProjects

# Namespace: ContainersProjects

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

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

## Introduction

Prepares to publish a version of a project's mobile app, so it becomes the live version every
user of the app gets.

Changes nothing. Returns the publication to show the user: the version, the version that is live
now and the effect. Once the user approves it, call
[Execute Release Publication](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/execute-release-publication.md)
with its `id` and `digest` before `expiresDate`. A publication expires 1 hour after it's
prepared.

Available only to the site owner, who also approves and executes the publication. A
collaborator gets `SITE_OWNER_REQUIRED`.

---

## REST API

### Schema

```
 Method: prepareReleasePublication
 Description: Prepares to publish a version of a project's mobile app, so it becomes the live version every user of the app gets.  Changes nothing. Returns the publication to show the user: the version, the version that is live now and the effect. Once the user approves it, call [Execute Release Publication](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/execute-release-publication.md) with its `id` and `digest` before `expiresDate`. A publication expires 1 hour after it's prepared.  Available only to the site owner, who also approves and executes the publication. A collaborator gets `SITE_OWNER_REQUIRED`.
 URL: https://www.wixapis.com/containers/projects/v1/projects/{projectId}/release-publications/prepare
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  releaseId
 Method parameters: 
   param name: releaseId | type: releaseId | description: GUID of the release to publish. For example, `rel-4f9c2a1b7d3e`. | required: true | validation: maxLength 200
 Return type: PrepareReleasePublicationResponse
  - name: publication | type: ReleasePublication | description: The prepared publication. Show it to the user before executing it.  
     - name: id | type: string | description: Publication GUID.  | validation: format GUID
     - name: projectId | type: string | description: GUID of the project.  | validation: format GUID
     - name: releaseId | type: string | description: GUID of the release to publish.  | validation: maxLength 200
     - name: releaseLabel | type: string | description: Label of the release to publish, when it has one.  | validation: maxLength 500
     - name: currentLiveReleaseId | type: string | description: GUID of the release that was live when the publication was prepared. Not returned when the app had no live version.  | validation: maxLength 200
     - name: effect | type: ReleasePublicationEffect | description: What publishing changes.  
         - enum:
         -     MAKE_LIVE: The release becomes the live version, which every user of the app gets.
         -     ALREADY_LIVE: The release is already the live version. Publishing changes nothing.
     - name: digest | type: string | description: Digest of the publication. Specify it when you call [Execute Release Publication](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/execute-release-publication.md).  | validation: maxLength 64
     - name: expiresDate | type: string | description: Date and time the publication expires if it isn't executed, 1 hour after it's prepared.  | read-only: true | validation: format date-time
     - name: status | type: ReleasePublicationStatus | description: Publication status.  
         - enum:
         -     PREPARED: Prepared and waiting for the user's approval. Nothing changed yet.
         -     PUBLISHED: The release is the live version.
         -     PUBLISHING: The release is being published. Call Execute Release Publication again to get the outcome.
     - name: liveReleaseId | type: string | description: GUID of the live release after the publication. Returned when `status` is `PUBLISHED`.  | validation: maxLength 200
     - name: createdDate | type: string | description: Date and time the publication was prepared.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the publication was last updated.  | read-only: true | validation: format date-time

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: SITE_OWNER_REQUIRED | Description: The current user isn't the site owner. Only the site owner can publish a version.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: RELEASE_NOT_FOUND | Description: Couldn't find the release in the project's app.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FEATURE_UNAVAILABLE | Description: Publishing isn't available for this site.


```

### Examples

### Prepare Release Publication
Prepares to publish a version of a project's mobile app, for the site owner to approve.

```curl
curl -X POST \
'https://www.wixapis.com/containers/projects/v1/projects/6b2e9d4a-1c7f-4a35-8e0b-5d3f7a9c2e18/release-publications/prepare' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "releaseId": "rel-7a2d9e4c1b6f"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.containers.projects.prepareReleasePublication(projectId, releaseId)
 Description: Prepares to publish a version of a project's mobile app, so it becomes the live version every user of the app gets.  Changes nothing. Returns the publication to show the user: the version, the version that is live now and the effect. Once the user approves it, call [Execute Release Publication](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/execute-release-publication.md) with its `id` and `digest` before `expiresDate`. A publication expires 1 hour after it's prepared.  Available only to the site owner, who also approves and executes the publication. A collaborator gets `SITE_OWNER_REQUIRED`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  projectId, releaseId
 Method parameters: 
   param name: projectId | type: string | description: GUID of the project to publish a version of. | required: true | validation: format GUID
   param name: releaseId | type: string | description: GUID of the release to publish. For example, `rel-4f9c2a1b7d3e`. | required: true | validation: maxLength 200
 Return type: PROMISE<PrepareReleasePublicationResponse>
  - name: publication | type: ReleasePublication | description: The prepared publication. Show it to the user before executing it.  
     - name: _id | type: string | description: Publication GUID.  | validation: format GUID
     - name: projectId | type: string | description: GUID of the project.  | validation: format GUID
     - name: releaseId | type: string | description: GUID of the release to publish.  | validation: maxLength 200
     - name: releaseLabel | type: string | description: Label of the release to publish, when it has one.  | validation: maxLength 500
     - name: currentLiveReleaseId | type: string | description: GUID of the release that was live when the publication was prepared. Not returned when the app had no live version.  | validation: maxLength 200
     - name: effect | type: ReleasePublicationEffect | description: What publishing changes.  
         - enum:
         -     MAKE_LIVE: The release becomes the live version, which every user of the app gets.
         -     ALREADY_LIVE: The release is already the live version. Publishing changes nothing.
     - name: digest | type: string | description: Digest of the publication. Specify it when you call [Execute Release Publication](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/execute-release-publication.md).  | validation: maxLength 64
     - name: expiresDate | type: Date | description: Date and time the publication expires if it isn't executed, 1 hour after it's prepared.  | read-only: true 
     - name: status | type: ReleasePublicationStatus | description: Publication status.  
         - enum:
         -     PREPARED: Prepared and waiting for the user's approval. Nothing changed yet.
         -     PUBLISHED: The release is the live version.
         -     PUBLISHING: The release is being published. Call Execute Release Publication again to get the outcome.
     - name: liveReleaseId | type: string | description: GUID of the live release after the publication. Returned when `status` is `PUBLISHED`.  | validation: maxLength 200
     - name: _createdDate | type: Date | description: Date and time the publication was prepared.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the publication was last updated.  | read-only: true 

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: SITE_OWNER_REQUIRED | Description: The current user isn't the site owner. Only the site owner can publish a version.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: RELEASE_NOT_FOUND | Description: Couldn't find the release in the project's app.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FEATURE_UNAVAILABLE | Description: Publishing isn't available for this site.


```

### Examples

### Prepare to publish a version of an app
Returns the publication for the site owner to approve. Nothing changes yet.

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

async function prepareReleasePublication() {
  const response = await projects.prepareReleasePublication(
    "6b2e9d4a-1c7f-4a35-8e0b-5d3f7a9c2e18",
    "rel-7a2d9e4c1b6f",
  );
}

/* Promise resolves to:
 * {
 *   "publication": {
 *     "_id": "d4f8a2c6-3e9b-4a17-b5c0-8e1d6f4a9b23",
 *     "projectId": "6b2e9d4a-1c7f-4a35-8e0b-5d3f7a9c2e18",
 *     "releaseId": "rel-7a2d9e4c1b6f",
 *     "releaseLabel": "New menu colors",
 *     "currentLiveReleaseId": "rel-3c8f1a6e9d2b",
 *     "effect": "MAKE_LIVE",
 *     "digest": "a7c3e9f1b5d2084e6c1a9f3b7d5e2c8a4f0b6d9e3c7a1f5b8d2e4c6a0f9b3d7e",
 *     "expiresDate": "2026-11-09T12:25:00.000Z",
 *     "status": "PREPARED",
 *     "_createdDate": "2026-11-09T11:25:00.000Z",
 *     "_updatedDate": "2026-11-09T11:25:00.000Z"
 *   }
 * }
 */

```

### prepareReleasePublication (self-managed)
Self-managed 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 prepareReleasePublication(projectId,releaseId) {
  const response = await myWixClient.projects.prepareReleasePublication(projectId,releaseId);
};
```

---