> 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

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/app-management/apps/sample-flows.md

## Article Content:

# Apps API: Sample Flows

This article presents a possible use case and corresponding sample flow that you can support. It provides a useful starting point as you plan your implementation.

## Create and configure an app

Use this flow when a developer tool creates an app and prepares its identity before adding components, permissions, webhooks, or versions through the related App Management APIs.

To create and configure an app:

1. Call [Create App](https://dev.wix.com/docs/api-reference/app-management/apps/create-app.md) with the display name and installation preferences. Use a name of no more than 30 characters if you intend to publish in the Wix App Market. Omit the namespace and slug. Creating companion apps is restricted to authorized provisioning services. Store returned credentials securely on the backend.
2. Save the returned `app.id` and `app.revision` for subsequent calls. Use the app ID in the related App Management APIs.
3. Call [Set Namespace](https://dev.wix.com/docs/api-reference/app-management/apps/set-namespace.md) with the app ID and `appName`. The namespace can be assigned once. Review the method's normalization and reserved-name rules. A suggestion doesn't reserve the namespace; choose a different app name and retry when assignment conflicts.
4. Call [Generate Slug](https://dev.wix.com/docs/api-reference/app-management/apps/generate-slug.md) to generate the app's App Market slug. An existing slug is returned unchanged. This operation doesn't generate slugs for companion apps.
5. Call [Get App](https://dev.wix.com/docs/api-reference/app-management/apps/get-app.md) to retrieve the latest revision, then [Update App](https://dev.wix.com/docs/api-reference/app-management/apps/update-app.md) with the ID, revision, and fields to change, such as the display name or installation preferences. In REST requests, specify `mask.paths` with only the fields to change, excluding `id` and `revision`. Identity fields, creator information, and secrets aren't updated through this method. The published SDK doesn't expose the mask argument; use the SDK-authenticated REST workaround in the Update App example.

After configuring the app, use the related Components, App Permissions, Webhooks, Dependencies, and App Versions APIs to manage its building blocks. Configuration doesn't publish a version or install the app on a site.

`appUrls.appUri` and `appUrls.redirectUris` configure Advanced OAuth, whose use is highly discouraged. See [Advanced OAuth](https://dev.wix.com/docs/build-apps/develop-your-app/auth/custom-authentication-deprecated.md).

To configure allowed destinations after installation from an external install link, set `appUrls.postInstallationUrls`. Use the nested field mask `appUrls.postInstallationUrls` to replace this list while preserving the other URL settings. The destination 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.