> 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

# CreateApp

# Package: apps

# Namespace: AppsService

# Method link: https://dev.wix.com/docs/api-reference/app-management/apps/create-app.md

## Introduction

Creates an app.

Don't include `namespace` in the request; use Set Namespace after creating the app.
Setting `companionApp` to `true` is restricted to authorized companion-app provisioning services.
A supplied `slug` is ignored except for authorized companion-app provisioning callers; use Generate Slug after creation.
A supplied `codeIdentifier` must not contain `wix` (case-insensitive).

---

## REST API

### Schema

```
 Method: createApp
 Description: Creates an app.  Don't include `namespace` in the request; use Set Namespace after creating the app. Setting `companionApp` to `true` is restricted to authorized companion-app provisioning services. A supplied `slug` is ignored except for authorized companion-app provisioning callers; use Generate Slug after creation. A supplied `codeIdentifier` must not contain `wix` (case-insensitive).
 URL: https://www.wixapis.com/apps/v1/apps
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  app
 Method parameters: 
   param name: app | type: App | description: An app defines the identity and configuration of an extension built for Wix. It contains ownership information, identifiers, authentication settings, and installation preferences. Components, permissions, webhooks, dependencies, and versions are managed through related APIs. | required: true 
        - name: id | type: string | description: App GUID.  | validation: format GUID
        - name: name | type: string | description: The display name shown to users and in App Market after publication, separate from the namespace, slug, and code identifier. Apps intended for publication in the Wix App Market should have a name of no more than 30 characters. On creation and update, `<`, `>`, double quotes, and apostrophes are escaped as `&lt;`, `&gt;`, `&quot;`, and `&apos;`. Responses contain the escaped value, which can be longer than the submitted name.  | validation: maxLength 50
        - name: appSecrets | type: AppSecrets | description: Secrets for authentication and webhooks. Omitted from Get App responses by default. To retrieve them, include `APP_SECRETS` in Get App's `additionalFields`. Requires authorization to access the app's secrets.  
        - name: namespace | type: string | description: App namespace, combining an account or company identifier with an app-name component. For example, `@example-company/bookings-helper`. Assign it once through Set Namespace after creating the app. Don't supply it to Create App or Update App. Set Namespace fails if the app already has a namespace.  | validation: minLength 1, maxLength 150
        - name: codeIdentifier | type: string | description: An identifier for referencing the app in code, separate from its display name, namespace, and slug. Must start with a letter, underscore, or dollar sign; remaining characters can also include digits. JavaScript reserved words aren't rejected. Choose a non-reserved identifier if using this value as a JavaScript variable name. Unique for non-companion apps. Companion apps return the shared value `companionApp`; use `id` to uniquely identify an app. For example, the namespace `@app-builder/my-cool-app` can be represented by the code identifier `AppBuilderMyCoolApp`.  | validation: minLength 3, maxLength 150
        - name: status | type: Status | description: The state of the application.  
             - enum: ACTIVE, ARCHIVED
        - name: revision | type: string | description: Revision number, which increments by 1 each time the app is updated. To prevent conflicting changes, supply the current revision when calling Update App. Retrieve the latest revision through Get App before updating. Ignored when creating an app.  | validation: format int64
        - name: slug | type: string | description: A human-readable, URL-friendly identifier for the app.  | validation: minLength 1, maxLength 50
        - name: appUrls | type: AppUrls | description: URL settings for Advanced OAuth and post-installation navigation. Using Advanced OAuth through `appUri` and `redirectUris` is highly discouraged. See [Advanced OAuth](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/use-advanced-oauth.md).  
           - name: appUri | type: string | description: App URL used to initiate Advanced OAuth, whose use is highly discouraged.  | validation: format WEB_URL
           - name: redirectUris | type: array<string> | description: Allowed redirect URLs for Advanced OAuth, whose use is highly discouraged.  | validation: maxItems 100, format WEB_URL
           - name: postInstallationUrls | type: array<string> | description: Allowed post-installation URLs, where Wix redirects the user after installing the app from an external install link. The `postInstallationUrl` must match an entry, unless it is a Wix-managed destination allowed separately. URLs are compared after normalizing whitespace and ignoring query strings and fragments. To replace this list without changing other URL settings, use Update App with `appUrls.postInstallationUrls` in the field mask.  | validation: maxItems 100, format WEB_URL
        - name: createdBy | type: CreatedBy | description: Identity and creation channel of the user or app that created the app, including its source template when applicable. Create App derives `id` and `type` from the caller's identity, replacing any supplied values. You can supply `sourceTemplateId` during creation. Creator information can't be changed through Update App.  | validation: immutable
           - name: id | type: string | description: Creator GUID derived from the caller's identity; a supplied value is replaced during creation. Identifies a user for `USER`, `CODE_GEN`, and `APP_BUILDER_SELF_HOSTED`, or an app for `APP`.  | validation: format GUID
           - name: type | type: CreatedByType | description: Creator identity or creation channel, derived from the caller's identity rather than a supplied value.  
                 - enum:
                 -     USER: Created by a user; `id` is the user's ID.
                 -     APP: Created by an app; `id` is the app's ID.
                 -     CODE_GEN: Created through code generation; `id` is the initiating user's ID.
                 -     APP_BUILDER_SELF_HOSTED: Created through the self-hosted app builder; `id` is the initiating user's ID.
           - name: sourceTemplateId | type: string | description: GUID of the source template, when applicable. Can be supplied to Create App.  | validation: format GUID
        - name: installationPreferences | type: InstallationPreferences | description: Settings for post-installation navigation, opening the app, and uninstalling it.  
           - ONE-OF: 
              - name: openComponentIdOptions | type: OpenComponentId | description: Component to open. Supply `componentId` when `openButtonAction` is `OPEN_COMPONENT_ID`.  
                 - name: componentId | type: string | description: GUID of the component opened when the user selects the app's Open button.  | validation: format GUID
           - name: overridePostInstallationRedirect | type: RedirectTarget | description: Preferred destination after installing an app with both editor and dashboard components. A recognized dashboard page in `postInstallationComponentId` takes precedence over this preference. Otherwise, `DASHBOARD` selects the dashboard and `EDITOR` selects the editor. On sites without an editor, `EDITOR` falls back to the dashboard. `UNKNOWN_REDIRECT_TARGET` leaves the default installation navigation unchanged.  
                 - enum:
                 -     UNKNOWN_REDIRECT_TARGET: Use the default installation navigation.
                 -     DASHBOARD: Prefer the site dashboard for an app with editor and dashboard components.
                 -     EDITOR: Prefer the editor; use the dashboard on sites without an editor.
           - name: postInstallationComponentId | type: string | description: Optional GUID of the app's dashboard page to open after installation. A recognized dashboard page takes precedence over `overridePostInstallationRedirect`. If omitted or not recognized as a dashboard page, navigation uses the redirect preference or the default installation flow. This field doesn't select an editor component.  | validation: format GUID
           - name: openButtonAction | type: OpenButtonAction | description: Action performed when the user selects the app's Open button after installation. For `OPEN_COMPONENT_ID`, supply `openComponentIdOptions.componentId`. `UNKNOWN_ACTION` means no explicit component-opening action is selected.  
                 - enum:
                 -     UNKNOWN_ACTION: No explicit component-opening action is selected.
                 -     OPEN_COMPONENT_ID: Open the component specified by `openComponentIdOptions.componentId`.
           - name: uninstallAction | type: UninstallActions | description: Custom warning shown when a user tries to uninstall the app. Select `NO_ACTION` for no custom warning; `NONE_ACTION` represents an unspecified preference. The product and shipping values select warning text, rather than performing cleanup.  
                 - enum:
                 -     NONE_ACTION: Unspecified warning preference. Use `NO_ACTION` to explicitly select no custom warning.
                 -     NO_ACTION: Show the standard uninstall message without a custom warning. Default when no preference is stored.
                 -     REMOVE_ALL_PRODUCT: Warn users to remove all products associated with the app from their store.
                 -     SHIPPING_RATES_REGION: Warn users that shipping to regions served only by the app will be removed from checkout.
        - name: unreleasedChanges | type: UnreleasedChanges | description: Automatically calculated, event-based tracking of unreleased changes, grouped by type. Updates asynchronously; see each flag for its tracking scope.  
           - name: componentsChanges | type: boolean | description: Whether components have unreleased creation, update, or deletion changes.  
           - name: appTranslationsChanges | type: boolean | description: Whether app translations have unreleased creation or update changes.  
           - name: componentsTranslationChanges | type: boolean | description: Whether component translations have unreleased update changes. Component-translation creation events currently aren't reflected in this flag.  
           - name: appPermissionsChanges | type: boolean | description: Whether app permissions have unreleased creation or update changes. Permission-deletion events currently aren't reflected in this flag.  
           - name: appEntityChanges | type: boolean | description: Whether app identity fields have unreleased changes, such as `name`, `slug`, `namespace`, and `codeIdentifier`. Doesn't track changes to `appUrls` or `installationPreferences`. Updates asynchronously after the app's update event; the update response may not yet reflect this flag.  
        - name: companionApp | type: boolean | description: Indicates whether this app is a companion app assigned to a specific site or account.  
 Return type: CreateAppResponse
  - name: app | type: App | description: Created app.  
     - name: id | type: string | description: App GUID.  | validation: format GUID
     - name: name | type: string | description: The display name shown to users and in App Market after publication, separate from the namespace, slug, and code identifier. Apps intended for publication in the Wix App Market should have a name of no more than 30 characters. On creation and update, `<`, `>`, double quotes, and apostrophes are escaped as `&lt;`, `&gt;`, `&quot;`, and `&apos;`. Responses contain the escaped value, which can be longer than the submitted name.  | validation: maxLength 50
     - name: accountId | type: string | description: GUID of the account that owns the app.  | read-only: true | validation: format GUID
     - name: appSecrets | type: AppSecrets | description: Secrets for authentication and webhooks. Omitted from Get App responses by default. To retrieve them, include `APP_SECRETS` in Get App's `additionalFields`. Requires authorization to access the app's secrets.  
        - name: appSecret | type: string | description: App authentication secret. Keep this value in a secure backend secret store. During rotation, this field contains the previous secret while both secrets exist. After the previous secret is retired, this field contains the replacement secret.  | read-only: true | validation: format GUID
        - name: webhookPublicKey | type: string | description: PEM-encoded RSA public key used to verify webhook event payloads.  | read-only: true | validation: maxLength 2048
        - name: appSecondarySecret | type: string | description: Replacement authentication secret used during rotation. Present while the app has two secrets. After the previous secret is retired, this value moves to `appSecret` and this field is cleared.  | read-only: true | validation: format GUID
        - name: secondarySecretActive | type: boolean | description: Whether the secondary secret is used for token signing. This doesn't indicate whether it is accepted for authentication.  | read-only: true 
     - name: namespace | type: string | description: App namespace, combining an account or company identifier with an app-name component. For example, `@example-company/bookings-helper`. Assign it once through Set Namespace after creating the app. Don't supply it to Create App or Update App. Set Namespace fails if the app already has a namespace.  | validation: minLength 1, maxLength 150
     - name: codeIdentifier | type: string | description: An identifier for referencing the app in code, separate from its display name, namespace, and slug. Must start with a letter, underscore, or dollar sign; remaining characters can also include digits. JavaScript reserved words aren't rejected. Choose a non-reserved identifier if using this value as a JavaScript variable name. Unique for non-companion apps. Companion apps return the shared value `companionApp`; use `id` to uniquely identify an app. For example, the namespace `@app-builder/my-cool-app` can be represented by the code identifier `AppBuilderMyCoolApp`.  | validation: minLength 3, maxLength 150
     - name: status | type: Status | description: The state of the application.  
         - enum: ACTIVE, ARCHIVED
     - name: revision | type: string | description: Revision number, which increments by 1 each time the app is updated. To prevent conflicting changes, supply the current revision when calling Update App. Retrieve the latest revision through Get App before updating. Ignored when creating an app.  | validation: format int64
     - name: slug | type: string | description: A human-readable, URL-friendly identifier for the app.  | validation: minLength 1, maxLength 50
     - name: appUrls | type: AppUrls | description: URL settings for Advanced OAuth and post-installation navigation. Using Advanced OAuth through `appUri` and `redirectUris` is highly discouraged. See [Advanced OAuth](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/use-advanced-oauth.md).  
        - name: appUri | type: string | description: App URL used to initiate Advanced OAuth, whose use is highly discouraged.  | validation: format WEB_URL
        - name: redirectUris | type: array<string> | description: Allowed redirect URLs for Advanced OAuth, whose use is highly discouraged.  | validation: maxItems 100, format WEB_URL
        - name: postInstallationUrls | type: array<string> | description: Allowed post-installation URLs, where Wix redirects the user after installing the app from an external install link. The `postInstallationUrl` must match an entry, unless it is a Wix-managed destination allowed separately. URLs are compared after normalizing whitespace and ignoring query strings and fragments. To replace this list without changing other URL settings, use Update App with `appUrls.postInstallationUrls` in the field mask.  | validation: maxItems 100, format WEB_URL
     - name: createdBy | type: CreatedBy | description: Identity and creation channel of the user or app that created the app, including its source template when applicable. Create App derives `id` and `type` from the caller's identity, replacing any supplied values. You can supply `sourceTemplateId` during creation. Creator information can't be changed through Update App.  | validation: immutable
        - name: id | type: string | description: Creator GUID derived from the caller's identity; a supplied value is replaced during creation. Identifies a user for `USER`, `CODE_GEN`, and `APP_BUILDER_SELF_HOSTED`, or an app for `APP`.  | validation: format GUID
        - name: type | type: CreatedByType | description: Creator identity or creation channel, derived from the caller's identity rather than a supplied value.  
             - enum:
             -     USER: Created by a user; `id` is the user's ID.
             -     APP: Created by an app; `id` is the app's ID.
             -     CODE_GEN: Created through code generation; `id` is the initiating user's ID.
             -     APP_BUILDER_SELF_HOSTED: Created through the self-hosted app builder; `id` is the initiating user's ID.
        - name: sourceTemplateId | type: string | description: GUID of the source template, when applicable. Can be supplied to Create App.  | validation: format GUID
     - name: installationPreferences | type: InstallationPreferences | description: Settings for post-installation navigation, opening the app, and uninstalling it.  
        - ONE-OF: 
           - name: openComponentIdOptions | type: OpenComponentId | description: Component to open. Supply `componentId` when `openButtonAction` is `OPEN_COMPONENT_ID`.  
              - name: componentId | type: string | description: GUID of the component opened when the user selects the app's Open button.  | validation: format GUID
        - name: overridePostInstallationRedirect | type: RedirectTarget | description: Preferred destination after installing an app with both editor and dashboard components. A recognized dashboard page in `postInstallationComponentId` takes precedence over this preference. Otherwise, `DASHBOARD` selects the dashboard and `EDITOR` selects the editor. On sites without an editor, `EDITOR` falls back to the dashboard. `UNKNOWN_REDIRECT_TARGET` leaves the default installation navigation unchanged.  
             - enum:
             -     UNKNOWN_REDIRECT_TARGET: Use the default installation navigation.
             -     DASHBOARD: Prefer the site dashboard for an app with editor and dashboard components.
             -     EDITOR: Prefer the editor; use the dashboard on sites without an editor.
        - name: postInstallationComponentId | type: string | description: Optional GUID of the app's dashboard page to open after installation. A recognized dashboard page takes precedence over `overridePostInstallationRedirect`. If omitted or not recognized as a dashboard page, navigation uses the redirect preference or the default installation flow. This field doesn't select an editor component.  | validation: format GUID
        - name: openButtonAction | type: OpenButtonAction | description: Action performed when the user selects the app's Open button after installation. For `OPEN_COMPONENT_ID`, supply `openComponentIdOptions.componentId`. `UNKNOWN_ACTION` means no explicit component-opening action is selected.  
             - enum:
             -     UNKNOWN_ACTION: No explicit component-opening action is selected.
             -     OPEN_COMPONENT_ID: Open the component specified by `openComponentIdOptions.componentId`.
        - name: uninstallAction | type: UninstallActions | description: Custom warning shown when a user tries to uninstall the app. Select `NO_ACTION` for no custom warning; `NONE_ACTION` represents an unspecified preference. The product and shipping values select warning text, rather than performing cleanup.  
             - enum:
             -     NONE_ACTION: Unspecified warning preference. Use `NO_ACTION` to explicitly select no custom warning.
             -     NO_ACTION: Show the standard uninstall message without a custom warning. Default when no preference is stored.
             -     REMOVE_ALL_PRODUCT: Warn users to remove all products associated with the app from their store.
             -     SHIPPING_RATES_REGION: Warn users that shipping to regions served only by the app will be removed from checkout.
     - name: createdDate | type: string | description: Date and time the app was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the app was last updated.  | read-only: true | validation: format date-time
     - name: unreleasedChanges | type: UnreleasedChanges | description: Automatically calculated, event-based tracking of unreleased changes, grouped by type. Updates asynchronously; see each flag for its tracking scope.  
        - name: componentsChanges | type: boolean | description: Whether components have unreleased creation, update, or deletion changes.  
        - name: appTranslationsChanges | type: boolean | description: Whether app translations have unreleased creation or update changes.  
        - name: componentsTranslationChanges | type: boolean | description: Whether component translations have unreleased update changes. Component-translation creation events currently aren't reflected in this flag.  
        - name: appPermissionsChanges | type: boolean | description: Whether app permissions have unreleased creation or update changes. Permission-deletion events currently aren't reflected in this flag.  
        - name: appEntityChanges | type: boolean | description: Whether app identity fields have unreleased changes, such as `name`, `slug`, `namespace`, and `codeIdentifier`. Doesn't track changes to `appUrls` or `installationPreferences`. Updates asynchronously after the app's update event; the update response may not yet reflect this flag.  
     - name: companionApp | type: boolean | description: Indicates whether this app is a companion app assigned to a specific site or account.  


```

### Examples

### Create an app
Create an app before assigning its namespace. The response is representative and contains fictional data.

```curl
curl -X POST \
'https://www.wixapis.com/apps/v1/apps' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "app": {
    "name": "Bookings Helper"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.appManagement.apps.createApp(app)
 Description: Creates an app.  Don't include `namespace` in the request; use Set Namespace after creating the app. Setting `companionApp` to `true` is restricted to authorized companion-app provisioning services. A supplied `slug` is ignored except for authorized companion-app provisioning callers; use Generate Slug after creation. A supplied `codeIdentifier` must not contain `wix` (case-insensitive).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  app
 Method parameters: 
   param name: app | type: App | description: An app defines the identity and configuration of an extension built for Wix. It contains ownership information, identifiers, authentication settings, and installation preferences. Components, permissions, webhooks, dependencies, and versions are managed through related APIs. | required: true 
        - name: _id | type: string | description: App GUID.  | validation: format GUID
        - name: name | type: string | description: The display name shown to users and in App Market after publication, separate from the namespace, slug, and code identifier. Apps intended for publication in the Wix App Market should have a name of no more than 30 characters. On creation and update, `<`, `>`, double quotes, and apostrophes are escaped as `&lt;`, `&gt;`, `&quot;`, and `&apos;`. Responses contain the escaped value, which can be longer than the submitted name.  | validation: maxLength 50
        - name: appSecrets | type: AppSecrets | description: Secrets for authentication and webhooks. Omitted from Get App responses by default. To retrieve them, include `APP_SECRETS` in Get App's `additionalFields`. Requires authorization to access the app's secrets.  
        - name: namespace | type: string | description: App namespace, combining an account or company identifier with an app-name component. For example, `@example-company/bookings-helper`. Assign it once through Set Namespace after creating the app. Don't supply it to Create App or Update App. Set Namespace fails if the app already has a namespace.  | validation: minLength 1, maxLength 150
        - name: codeIdentifier | type: string | description: An identifier for referencing the app in code, separate from its display name, namespace, and slug. Must start with a letter, underscore, or dollar sign; remaining characters can also include digits. JavaScript reserved words aren't rejected. Choose a non-reserved identifier if using this value as a JavaScript variable name. Unique for non-companion apps. Companion apps return the shared value `companionApp`; use `id` to uniquely identify an app. For example, the namespace `@app-builder/my-cool-app` can be represented by the code identifier `AppBuilderMyCoolApp`.  | validation: minLength 3, maxLength 150
        - name: status | type: Status | description: The state of the application.  
             - enum: ACTIVE, ARCHIVED
        - name: revision | type: string | description: Revision number, which increments by 1 each time the app is updated. To prevent conflicting changes, supply the current revision when calling Update App. Retrieve the latest revision through Get App before updating. Ignored when creating an app.  | validation: format int64
        - name: slug | type: string | description: A human-readable, URL-friendly identifier for the app.  | validation: minLength 1, maxLength 50
        - name: appUrls | type: AppUrls | description: URL settings for Advanced OAuth and post-installation navigation. Using Advanced OAuth through `appUri` and `redirectUris` is highly discouraged. See [Advanced OAuth](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/use-advanced-oauth.md).  
           - name: appUri | type: string | description: App URL used to initiate Advanced OAuth, whose use is highly discouraged.  | validation: format WEB_URL
           - name: redirectUris | type: array<string> | description: Allowed redirect URLs for Advanced OAuth, whose use is highly discouraged.  | validation: maxItems 100, format WEB_URL
           - name: postInstallationUrls | type: array<string> | description: Allowed post-installation URLs, where Wix redirects the user after installing the app from an external install link. The `postInstallationUrl` must match an entry, unless it is a Wix-managed destination allowed separately. URLs are compared after normalizing whitespace and ignoring query strings and fragments. To replace this list without changing other URL settings, use Update App with `appUrls.postInstallationUrls` in the field mask.  | validation: maxItems 100, format WEB_URL
        - name: createdBy | type: CreatedBy | description: Identity and creation channel of the user or app that created the app, including its source template when applicable. Create App derives `id` and `type` from the caller's identity, replacing any supplied values. You can supply `sourceTemplateId` during creation. Creator information can't be changed through Update App.  | validation: immutable
           - name: _id | type: string | description: Creator GUID derived from the caller's identity; a supplied value is replaced during creation. Identifies a user for `USER`, `CODE_GEN`, and `APP_BUILDER_SELF_HOSTED`, or an app for `APP`.  | validation: format GUID
           - name: type | type: CreatedByType | description: Creator identity or creation channel, derived from the caller's identity rather than a supplied value.  
                 - enum:
                 -     USER: Created by a user; `id` is the user's ID.
                 -     APP: Created by an app; `id` is the app's ID.
                 -     CODE_GEN: Created through code generation; `id` is the initiating user's ID.
                 -     APP_BUILDER_SELF_HOSTED: Created through the self-hosted app builder; `id` is the initiating user's ID.
           - name: sourceTemplateId | type: string | description: GUID of the source template, when applicable. Can be supplied to Create App.  | validation: format GUID
        - name: installationPreferences | type: InstallationPreferences | description: Settings for post-installation navigation, opening the app, and uninstalling it.  
           - ONE-OF: 
              - name: openComponentIdOptions | type: OpenComponentId | description: Component to open. Supply `componentId` when `openButtonAction` is `OPEN_COMPONENT_ID`.  
                 - name: componentId | type: string | description: GUID of the component opened when the user selects the app's Open button.  | validation: format GUID
           - name: overridePostInstallationRedirect | type: RedirectTarget | description: Preferred destination after installing an app with both editor and dashboard components. A recognized dashboard page in `postInstallationComponentId` takes precedence over this preference. Otherwise, `DASHBOARD` selects the dashboard and `EDITOR` selects the editor. On sites without an editor, `EDITOR` falls back to the dashboard. `UNKNOWN_REDIRECT_TARGET` leaves the default installation navigation unchanged.  
                 - enum:
                 -     UNKNOWN_REDIRECT_TARGET: Use the default installation navigation.
                 -     DASHBOARD: Prefer the site dashboard for an app with editor and dashboard components.
                 -     EDITOR: Prefer the editor; use the dashboard on sites without an editor.
           - name: postInstallationComponentId | type: string | description: Optional GUID of the app's dashboard page to open after installation. A recognized dashboard page takes precedence over `overridePostInstallationRedirect`. If omitted or not recognized as a dashboard page, navigation uses the redirect preference or the default installation flow. This field doesn't select an editor component.  | validation: format GUID
           - name: openButtonAction | type: OpenButtonAction | description: Action performed when the user selects the app's Open button after installation. For `OPEN_COMPONENT_ID`, supply `openComponentIdOptions.componentId`. `UNKNOWN_ACTION` means no explicit component-opening action is selected.  
                 - enum:
                 -     UNKNOWN_ACTION: No explicit component-opening action is selected.
                 -     OPEN_COMPONENT_ID: Open the component specified by `openComponentIdOptions.componentId`.
           - name: uninstallAction | type: UninstallActions | description: Custom warning shown when a user tries to uninstall the app. Select `NO_ACTION` for no custom warning; `NONE_ACTION` represents an unspecified preference. The product and shipping values select warning text, rather than performing cleanup.  
                 - enum:
                 -     NONE_ACTION: Unspecified warning preference. Use `NO_ACTION` to explicitly select no custom warning.
                 -     NO_ACTION: Show the standard uninstall message without a custom warning. Default when no preference is stored.
                 -     REMOVE_ALL_PRODUCT: Warn users to remove all products associated with the app from their store.
                 -     SHIPPING_RATES_REGION: Warn users that shipping to regions served only by the app will be removed from checkout.
        - name: unreleasedChanges | type: UnreleasedChanges | description: Automatically calculated, event-based tracking of unreleased changes, grouped by type. Updates asynchronously; see each flag for its tracking scope.  
           - name: componentsChanges | type: boolean | description: Whether components have unreleased creation, update, or deletion changes.  
           - name: appTranslationsChanges | type: boolean | description: Whether app translations have unreleased creation or update changes.  
           - name: componentsTranslationChanges | type: boolean | description: Whether component translations have unreleased update changes. Component-translation creation events currently aren't reflected in this flag.  
           - name: appPermissionsChanges | type: boolean | description: Whether app permissions have unreleased creation or update changes. Permission-deletion events currently aren't reflected in this flag.  
           - name: appEntityChanges | type: boolean | description: Whether app identity fields have unreleased changes, such as `name`, `slug`, `namespace`, and `codeIdentifier`. Doesn't track changes to `appUrls` or `installationPreferences`. Updates asynchronously after the app's update event; the update response may not yet reflect this flag.  
        - name: companionApp | type: boolean | description: Indicates whether this app is a companion app assigned to a specific site or account.  
 Return type: PROMISE<App>
  - name: _id | type: string | description: App GUID.  | validation: format GUID
  - name: name | type: string | description: The display name shown to users and in App Market after publication, separate from the namespace, slug, and code identifier. Apps intended for publication in the Wix App Market should have a name of no more than 30 characters. On creation and update, `<`, `>`, double quotes, and apostrophes are escaped as `&lt;`, `&gt;`, `&quot;`, and `&apos;`. Responses contain the escaped value, which can be longer than the submitted name.  | validation: maxLength 50
  - name: accountId | type: string | description: GUID of the account that owns the app.  | read-only: true | validation: format GUID
  - name: appSecrets | type: AppSecrets | description: Secrets for authentication and webhooks. Omitted from Get App responses by default. To retrieve them, include `APP_SECRETS` in Get App's `additionalFields`. Requires authorization to access the app's secrets.  
     - name: appSecret | type: string | description: App authentication secret. Keep this value in a secure backend secret store. During rotation, this field contains the previous secret while both secrets exist. After the previous secret is retired, this field contains the replacement secret.  | read-only: true | validation: format GUID
     - name: webhookPublicKey | type: string | description: PEM-encoded RSA public key used to verify webhook event payloads.  | read-only: true | validation: maxLength 2048
     - name: appSecondarySecret | type: string | description: Replacement authentication secret used during rotation. Present while the app has two secrets. After the previous secret is retired, this value moves to `appSecret` and this field is cleared.  | read-only: true | validation: format GUID
     - name: secondarySecretActive | type: boolean | description: Whether the secondary secret is used for token signing. This doesn't indicate whether it is accepted for authentication.  | read-only: true 
  - name: namespace | type: string | description: App namespace, combining an account or company identifier with an app-name component. For example, `@example-company/bookings-helper`. Assign it once through Set Namespace after creating the app. Don't supply it to Create App or Update App. Set Namespace fails if the app already has a namespace.  | validation: minLength 1, maxLength 150
  - name: codeIdentifier | type: string | description: An identifier for referencing the app in code, separate from its display name, namespace, and slug. Must start with a letter, underscore, or dollar sign; remaining characters can also include digits. JavaScript reserved words aren't rejected. Choose a non-reserved identifier if using this value as a JavaScript variable name. Unique for non-companion apps. Companion apps return the shared value `companionApp`; use `id` to uniquely identify an app. For example, the namespace `@app-builder/my-cool-app` can be represented by the code identifier `AppBuilderMyCoolApp`.  | validation: minLength 3, maxLength 150
  - name: status | type: Status | description: The state of the application.  
     - enum: ACTIVE, ARCHIVED
  - name: revision | type: string | description: Revision number, which increments by 1 each time the app is updated. To prevent conflicting changes, supply the current revision when calling Update App. Retrieve the latest revision through Get App before updating. Ignored when creating an app.  | validation: format int64
  - name: slug | type: string | description: A human-readable, URL-friendly identifier for the app.  | validation: minLength 1, maxLength 50
  - name: appUrls | type: AppUrls | description: URL settings for Advanced OAuth and post-installation navigation. Using Advanced OAuth through `appUri` and `redirectUris` is highly discouraged. See [Advanced OAuth](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/use-advanced-oauth.md).  
     - name: appUri | type: string | description: App URL used to initiate Advanced OAuth, whose use is highly discouraged.  | validation: format WEB_URL
     - name: redirectUris | type: array<string> | description: Allowed redirect URLs for Advanced OAuth, whose use is highly discouraged.  | validation: maxItems 100, format WEB_URL
     - name: postInstallationUrls | type: array<string> | description: Allowed post-installation URLs, where Wix redirects the user after installing the app from an external install link. The `postInstallationUrl` must match an entry, unless it is a Wix-managed destination allowed separately. URLs are compared after normalizing whitespace and ignoring query strings and fragments. To replace this list without changing other URL settings, use Update App with `appUrls.postInstallationUrls` in the field mask.  | validation: maxItems 100, format WEB_URL
  - name: createdBy | type: CreatedBy | description: Identity and creation channel of the user or app that created the app, including its source template when applicable. Create App derives `id` and `type` from the caller's identity, replacing any supplied values. You can supply `sourceTemplateId` during creation. Creator information can't be changed through Update App.  | validation: immutable
     - name: _id | type: string | description: Creator GUID derived from the caller's identity; a supplied value is replaced during creation. Identifies a user for `USER`, `CODE_GEN`, and `APP_BUILDER_SELF_HOSTED`, or an app for `APP`.  | validation: format GUID
     - name: type | type: CreatedByType | description: Creator identity or creation channel, derived from the caller's identity rather than a supplied value.  
         - enum:
         -     USER: Created by a user; `id` is the user's ID.
         -     APP: Created by an app; `id` is the app's ID.
         -     CODE_GEN: Created through code generation; `id` is the initiating user's ID.
         -     APP_BUILDER_SELF_HOSTED: Created through the self-hosted app builder; `id` is the initiating user's ID.
     - name: sourceTemplateId | type: string | description: GUID of the source template, when applicable. Can be supplied to Create App.  | validation: format GUID
  - name: installationPreferences | type: InstallationPreferences | description: Settings for post-installation navigation, opening the app, and uninstalling it.  
     - ONE-OF: 
        - name: openComponentIdOptions | type: OpenComponentId | description: Component to open. Supply `componentId` when `openButtonAction` is `OPEN_COMPONENT_ID`.  
           - name: componentId | type: string | description: GUID of the component opened when the user selects the app's Open button.  | validation: format GUID
     - name: overridePostInstallationRedirect | type: RedirectTarget | description: Preferred destination after installing an app with both editor and dashboard components. A recognized dashboard page in `postInstallationComponentId` takes precedence over this preference. Otherwise, `DASHBOARD` selects the dashboard and `EDITOR` selects the editor. On sites without an editor, `EDITOR` falls back to the dashboard. `UNKNOWN_REDIRECT_TARGET` leaves the default installation navigation unchanged.  
         - enum:
         -     UNKNOWN_REDIRECT_TARGET: Use the default installation navigation.
         -     DASHBOARD: Prefer the site dashboard for an app with editor and dashboard components.
         -     EDITOR: Prefer the editor; use the dashboard on sites without an editor.
     - name: postInstallationComponentId | type: string | description: Optional GUID of the app's dashboard page to open after installation. A recognized dashboard page takes precedence over `overridePostInstallationRedirect`. If omitted or not recognized as a dashboard page, navigation uses the redirect preference or the default installation flow. This field doesn't select an editor component.  | validation: format GUID
     - name: openButtonAction | type: OpenButtonAction | description: Action performed when the user selects the app's Open button after installation. For `OPEN_COMPONENT_ID`, supply `openComponentIdOptions.componentId`. `UNKNOWN_ACTION` means no explicit component-opening action is selected.  
         - enum:
         -     UNKNOWN_ACTION: No explicit component-opening action is selected.
         -     OPEN_COMPONENT_ID: Open the component specified by `openComponentIdOptions.componentId`.
     - name: uninstallAction | type: UninstallActions | description: Custom warning shown when a user tries to uninstall the app. Select `NO_ACTION` for no custom warning; `NONE_ACTION` represents an unspecified preference. The product and shipping values select warning text, rather than performing cleanup.  
         - enum:
         -     NONE_ACTION: Unspecified warning preference. Use `NO_ACTION` to explicitly select no custom warning.
         -     NO_ACTION: Show the standard uninstall message without a custom warning. Default when no preference is stored.
         -     REMOVE_ALL_PRODUCT: Warn users to remove all products associated with the app from their store.
         -     SHIPPING_RATES_REGION: Warn users that shipping to regions served only by the app will be removed from checkout.
  - name: _createdDate | type: Date | description: Date and time the app was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the app was last updated.  | read-only: true 
  - name: unreleasedChanges | type: UnreleasedChanges | description: Automatically calculated, event-based tracking of unreleased changes, grouped by type. Updates asynchronously; see each flag for its tracking scope.  
     - name: componentsChanges | type: boolean | description: Whether components have unreleased creation, update, or deletion changes.  
     - name: appTranslationsChanges | type: boolean | description: Whether app translations have unreleased creation or update changes.  
     - name: componentsTranslationChanges | type: boolean | description: Whether component translations have unreleased update changes. Component-translation creation events currently aren't reflected in this flag.  
     - name: appPermissionsChanges | type: boolean | description: Whether app permissions have unreleased creation or update changes. Permission-deletion events currently aren't reflected in this flag.  
     - name: appEntityChanges | type: boolean | description: Whether app identity fields have unreleased changes, such as `name`, `slug`, `namespace`, and `codeIdentifier`. Doesn't track changes to `appUrls` or `installationPreferences`. Updates asynchronously after the app's update event; the update response may not yet reflect this flag.  
  - name: companionApp | type: boolean | description: Indicates whether this app is a companion app assigned to a specific site or account.  


```

### Examples

### Create an app
```javascript
import { apps } from "@wix/app-management";

async function createApp() {
  const response = await apps.createApp({
    name: "Bookings Helper",
  });
  return response;
}

```

### createApp (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 { apps } from '@wix/app-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function createApp(app) {
  const response = await myWixClient.apps.createApp(app);
};
```

---