> 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

# StopAppGeneration

# Package: containersProjects

# Namespace: ContainersProjects

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

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

## Introduction

Stops an app generation that is still preparing.

Available only while `stopAvailable` is `true`, including a generation whose build request
failed and is waiting to be resumed. Once the app build has started it can't be stopped, and the
call fails with `STOP_NOT_AVAILABLE`. Stopping a stopped generation returns it. The response holds
the actual outcome: if the build started first, it is not stopped.

---

## REST API

### Schema

```
 Method: stopAppGeneration
 Description: Stops an app generation that is still preparing.  Available only while `stopAvailable` is `true`, including a generation whose build request failed and is waiting to be resumed. Once the app build has started it can't be stopped, and the call fails with `STOP_NOT_AVAILABLE`. Stopping a stopped generation returns it. The response holds the actual outcome: if the build started first, it is not stopped.
 URL: https://www.wixapis.com/containers/projects/v1/app-generations/{generationId}/stop
 Method: POST
 Return type: StopAppGenerationResponse
  - name: generation | type: AppGeneration | description: The app generation after the stop.  
     - name: id | type: string | description: App generation GUID.  | validation: format GUID
     - name: proposalId | type: string | description: GUID of the approved plan.  | validation: format GUID
     - name: proposalRevision | type: string | description: Revision of the approved plan.  
     - name: status | type: AppGenerationStatus | description: Generation status.  
         - enum:
         -     PREPARING: Creating the project, its app, conversation and plan.
         -     QUEUED: The build is waiting to start.
         -     RUNNING: The coding agent is building the app.
         -     FINALIZING: The coding agent finished; the draft is being verified and saved. Not done yet.
         -     SUCCEEDED: The app draft is ready. It is unpublished.
         -     FAILED: The generation failed. See `failure`. Final, except `GENERATION_NOT_STARTED`: if the build starts late, the status follows it.
         -     CANCELLED: The generation was stopped.
     - name: failure | type: AppGenerationFailure | description: Why the generation failed. Returned when `status` is `FAILED`.  
        - name: code | type: AppGenerationFailureCode | description: Failure code.  
             - enum:
             -     NOT_AUTHORIZED: The current user isn't allowed to create a mobile app on this site.
             -     PREPARATION_FAILED: The project, app, conversation or plan couldn't be prepared.
             -     PLAN_SCOPE_MISMATCH: The stored plan differs from the approved plan, so the build wasn't started.
             -     GENERATION_NOT_STARTED: The build didn't start within 15 minutes, for example because the account has no AI credits left. If it starts later, the generation's status follows the build. Check again before starting over, so the app isn't created twice.
             -     GENERATION_FAILED: The build failed.
        - name: description | type: string | description: Safe description for the user.  | validation: maxLength 500
     - name: projectId | type: string | description: GUID of the app's project. Returned once the project exists.  | validation: format GUID
     - name: stopAvailable | type: boolean | description: Whether Stop App Generation can stop the generation now.  
     - name: resumeRequired | type: boolean | description: Whether preparation stopped before the build started. Call Approve App Generation again with the same plan to continue; this starts the build. To abandon it instead, call Stop App Generation.  
     - name: result | type: AppGenerationResult | description: The app draft. Returned when `status` is `SUCCEEDED`.  
        - name: projectId | type: string | description: GUID of the app's project.  | validation: format GUID
        - name: appUrl | type: string | description: Link to open the app draft in the dashboard. Not returned when the link isn't configured.  | validation: format WEB_URL
     - name: createdDate | type: string | description: Date and time the generation was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the generation was last updated.  | read-only: true | validation: format date-time

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: APP_GENERATION_NOT_FOUND | Description: Couldn't find the app generation for the current user and site.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: STOP_NOT_AVAILABLE | Description: The build already started, finished or failed.


```

### Examples

### Stop App Generation
Stops an app generation while it is still preparing, before its build starts.

```curl
curl -X POST \
'https://www.wixapis.com/containers/projects/v1/app-generations/1d7e3b9a-5c2f-4a86-b0e4-9f3c6a2d8e51/stop' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.containers.projects.stopAppGeneration(generationId)
 Description: Stops an app generation that is still preparing.  Available only while `stopAvailable` is `true`, including a generation whose build request failed and is waiting to be resumed. Once the app build has started it can't be stopped, and the call fails with `STOP_NOT_AVAILABLE`. Stopping a stopped generation returns it. The response holds the actual outcome: if the build started first, it is not stopped.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  generationId
 Method parameters: 
   param name: generationId | type: string | description: GUID of the app generation to stop. | required: true | validation: format GUID
 Return type: PROMISE<StopAppGenerationResponse>
  - name: generation | type: AppGeneration | description: The app generation after the stop.  
     - name: _id | type: string | description: App generation GUID.  | validation: format GUID
     - name: proposalId | type: string | description: GUID of the approved plan.  | validation: format GUID
     - name: proposalRevision | type: string | description: Revision of the approved plan.  
     - name: status | type: AppGenerationStatus | description: Generation status.  
         - enum:
         -     PREPARING: Creating the project, its app, conversation and plan.
         -     QUEUED: The build is waiting to start.
         -     RUNNING: The coding agent is building the app.
         -     FINALIZING: The coding agent finished; the draft is being verified and saved. Not done yet.
         -     SUCCEEDED: The app draft is ready. It is unpublished.
         -     FAILED: The generation failed. See `failure`. Final, except `GENERATION_NOT_STARTED`: if the build starts late, the status follows it.
         -     CANCELLED: The generation was stopped.
     - name: failure | type: AppGenerationFailure | description: Why the generation failed. Returned when `status` is `FAILED`.  
        - name: code | type: AppGenerationFailureCode | description: Failure code.  
             - enum:
             -     NOT_AUTHORIZED: The current user isn't allowed to create a mobile app on this site.
             -     PREPARATION_FAILED: The project, app, conversation or plan couldn't be prepared.
             -     PLAN_SCOPE_MISMATCH: The stored plan differs from the approved plan, so the build wasn't started.
             -     GENERATION_NOT_STARTED: The build didn't start within 15 minutes, for example because the account has no AI credits left. If it starts later, the generation's status follows the build. Check again before starting over, so the app isn't created twice.
             -     GENERATION_FAILED: The build failed.
        - name: description | type: string | description: Safe description for the user.  | validation: maxLength 500
     - name: projectId | type: string | description: GUID of the app's project. Returned once the project exists.  | validation: format GUID
     - name: stopAvailable | type: boolean | description: Whether Stop App Generation can stop the generation now.  
     - name: resumeRequired | type: boolean | description: Whether preparation stopped before the build started. Call Approve App Generation again with the same plan to continue; this starts the build. To abandon it instead, call Stop App Generation.  
     - name: result | type: AppGenerationResult | description: The app draft. Returned when `status` is `SUCCEEDED`.  
        - name: projectId | type: string | description: GUID of the app's project.  | validation: format GUID
        - name: appUrl | type: string | description: Link to open the app draft in the dashboard. Not returned when the link isn't configured.  | validation: format WEB_URL
     - name: _createdDate | type: Date | description: Date and time the generation was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the generation was last updated.  | read-only: true 

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: APP_GENERATION_NOT_FOUND | Description: Couldn't find the app generation for the current user and site.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: STOP_NOT_AVAILABLE | Description: The build already started, finished or failed.


```

### Examples

### Stop an app generation
Stops an app generation while it is still preparing, before its build starts.

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

async function stopAppGeneration() {
  const response = await projects.stopAppGeneration("1d7e3b9a-5c2f-4a86-b0e4-9f3c6a2d8e51");
}

/* Promise resolves to:
 * {
 *   "generation": {
 *     "_id": "1d7e3b9a-5c2f-4a86-b0e4-9f3c6a2d8e51",
 *     "proposalId": "8a5c2e7f-4d1b-4f93-a6c8-2e9b7d3f5a14",
 *     "proposalRevision": "1",
 *     "status": "CANCELLED",
 *     "stopAvailable": false,
 *     "resumeRequired": false,
 *     "_createdDate": "2026-11-09T10:05:42.000Z",
 *     "_updatedDate": "2026-11-09T10:05:51.000Z"
 *   }
 * }
 */

```

### stopAppGeneration (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 stopAppGeneration(generationId) {
  const response = await myWixClient.projects.stopAppGeneration(generationId);
};
```

---