> 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

# GetAppPlanningContext

# Package: containersProjects

# Namespace: ContainersProjects

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

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

## Introduction

Retrieves what an agent needs before writing a mobile app plan for the current site: the plan
schema version, field limits and the Wix integrations the app can use.

Specify the returned `planningContextId` and `catalogVersion` when you call
[Submit App Plan](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/submit-app-plan.md).
The context is bound to the current user and site. It's valid for at least 24 hours, until
`expiresDate`.

---

## REST API

### Schema

```
 Method: getAppPlanningContext
 Description: Retrieves what an agent needs before writing a mobile app plan for the current site: the plan schema version, field limits and the Wix integrations the app can use.  Specify the returned `planningContextId` and `catalogVersion` when you call [Submit App Plan](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/submit-app-plan.md). The context is bound to the current user and site. It's valid for at least 24 hours, until `expiresDate`.
 URL: https://www.wixapis.com/containers/projects/v1/app-planning-context
 Method: GET
 Return type: GetAppPlanningContextResponse
  - name: schemaVersion | type: string | description: Plan schema version to specify in Submit App Plan. Currently `appsmith.mobile-plan.v1`.  | validation: maxLength 100
  - name: planningContextId | type: string | description: Opaque GUID of this planning context, bound to the current user and site.  | validation: maxLength 100
  - name: catalogVersion | type: string | description: Version of the integration catalog in `wixIntegrations`.  | validation: maxLength 100
  - name: expiresDate | type: string | description: Date and time the planning context expires, at least 24 hours after it's issued.  | validation: format date-time
  - name: limits | type: AppPlanLimits | description: Limits a plan must stay within.  
     - name: initialPromptMaxLength | type: integer | description: Maximum length of `initialPrompt`.  
     - name: appNameMaxLength | type: integer | description: Maximum length of `appSpec.appName`.  
     - name: appDescriptionMaxLength | type: integer | description: Maximum length of `appSpec.appDescription`.  
     - name: businessGoalMaxLength | type: integer | description: Maximum length of `appSpec.businessGoal`.  
     - name: audienceMaxLength | type: integer | description: Maximum length of `appSpec.audience`.  
     - name: maxFeatures | type: integer | description: Maximum number of features.  
     - name: featureTitleMaxLength | type: integer | description: Maximum length of a feature title.  
     - name: featureDescriptionMaxLength | type: integer | description: Maximum length of a feature description.  
     - name: maxNavigationScreens | type: integer | description: Maximum number of navigation screens.  
     - name: navigationScreenMaxLength | type: integer | description: Maximum length of a navigation screen name.  
     - name: maxWixIntegrations | type: integer | description: Maximum number of Wix integrations.  
     - name: integrationDescriptionMaxLength | type: integer | description: Maximum length of an integration description.  
     - name: maxIntegrationTags | type: integer | description: Maximum number of tags of an integration.  
     - name: integrationTagMaxLength | type: integer | description: Maximum length of an integration tag.  
  - name: wixIntegrations | type: array<AppPlanCatalogIntegration> | description: Wix integrations a plan can include, with whether the site has each one installed. A plan can include only installed integrations.  | validation: maxItems 100
     - name: id | type: string | description: Integration GUID to specify in `appSpec.wixIntegrations.id`, for example `wix-stores`.  | validation: maxLength 200
     - name: displayName | type: string | description: Display name, for example `Wix Stores`.  | validation: maxLength 200
     - name: installed | type: boolean | description: Whether the site has the integration's Wix app installed. A plan can include only installed integrations.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FEATURE_UNAVAILABLE | Description: App generation isn't available for this site.


```

### Examples

### Get App Planning Context
Retrieves the plan schema version, field limits and Wix integrations for writing a mobile app plan.

```curl
curl -X GET \
'https://www.wixapis.com/containers/projects/v1/app-planning-context' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.containers.projects.getAppPlanningContext()
 Description: Retrieves what an agent needs before writing a mobile app plan for the current site: the plan schema version, field limits and the Wix integrations the app can use.  Specify the returned `planningContextId` and `catalogVersion` when you call [Submit App Plan](https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-projects/project-v1/submit-app-plan.md). The context is bound to the current user and site. It's valid for at least 24 hours, until `expiresDate`.
 Return type: PROMISE<GetAppPlanningContextResponse>
  - name: schemaVersion | type: string | description: Plan schema version to specify in Submit App Plan. Currently `appsmith.mobile-plan.v1`.  | validation: maxLength 100
  - name: planningContextId | type: string | description: Opaque GUID of this planning context, bound to the current user and site.  | validation: maxLength 100
  - name: catalogVersion | type: string | description: Version of the integration catalog in `wixIntegrations`.  | validation: maxLength 100
  - name: expiresDate | type: Date | description: Date and time the planning context expires, at least 24 hours after it's issued.  
  - name: limits | type: AppPlanLimits | description: Limits a plan must stay within.  
     - name: initialPromptMaxLength | type: integer | description: Maximum length of `initialPrompt`.  
     - name: appNameMaxLength | type: integer | description: Maximum length of `appSpec.appName`.  
     - name: appDescriptionMaxLength | type: integer | description: Maximum length of `appSpec.appDescription`.  
     - name: businessGoalMaxLength | type: integer | description: Maximum length of `appSpec.businessGoal`.  
     - name: audienceMaxLength | type: integer | description: Maximum length of `appSpec.audience`.  
     - name: maxFeatures | type: integer | description: Maximum number of features.  
     - name: featureTitleMaxLength | type: integer | description: Maximum length of a feature title.  
     - name: featureDescriptionMaxLength | type: integer | description: Maximum length of a feature description.  
     - name: maxNavigationScreens | type: integer | description: Maximum number of navigation screens.  
     - name: navigationScreenMaxLength | type: integer | description: Maximum length of a navigation screen name.  
     - name: maxWixIntegrations | type: integer | description: Maximum number of Wix integrations.  
     - name: integrationDescriptionMaxLength | type: integer | description: Maximum length of an integration description.  
     - name: maxIntegrationTags | type: integer | description: Maximum number of tags of an integration.  
     - name: integrationTagMaxLength | type: integer | description: Maximum length of an integration tag.  
  - name: wixIntegrations | type: array<AppPlanCatalogIntegration> | description: Wix integrations a plan can include, with whether the site has each one installed. A plan can include only installed integrations.  | validation: maxItems 100
     - name: _id | type: string | description: Integration GUID to specify in `appSpec.wixIntegrations.id`, for example `wix-stores`.  | validation: maxLength 200
     - name: displayName | type: string | description: Display name, for example `Wix Stores`.  | validation: maxLength 200
     - name: installed | type: boolean | description: Whether the site has the integration's Wix app installed. A plan can include only installed integrations.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FEATURE_UNAVAILABLE | Description: App generation isn't available for this site.


```

### Examples

### Get the context for writing an app plan
Retrieves the plan schema version, field limits and Wix integrations for the current site.

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

async function getAppPlanningContext() {
  const response = await projects.getAppPlanningContext();
}

/* Promise resolves to:
 * {
 *   "schemaVersion": "appsmith.mobile-plan.v1",
 *   "planningContextId": "5f1c9e2a-7b3d-3c41-9a8e-2d6f4b0c7e15",
 *   "catalogVersion": "c1-8e4f2a91b07c",
 *   "expiresDate": "2026-11-10T23:59:59.000Z",
 *   "limits": {
 *     "initialPromptMaxLength": 10000,
 *     "appNameMaxLength": 200,
 *     "appDescriptionMaxLength": 5000,
 *     "businessGoalMaxLength": 2000,
 *     "audienceMaxLength": 2000,
 *     "maxFeatures": 30,
 *     "featureTitleMaxLength": 200,
 *     "featureDescriptionMaxLength": 2000,
 *     "maxNavigationScreens": 20,
 *     "navigationScreenMaxLength": 200,
 *     "maxWixIntegrations": 10,
 *     "integrationDescriptionMaxLength": 2000,
 *     "maxIntegrationTags": 20,
 *     "integrationTagMaxLength": 100
 *   },
 *   "wixIntegrations": [
 *     {
 *       "_id": "wix-stores",
 *       "displayName": "Wix Stores",
 *       "installed": true
 *     },
 *     {
 *       "_id": "wix-bookings",
 *       "displayName": "Wix Bookings",
 *       "installed": false
 *     }
 *   ]
 * }
 */

```

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

---