> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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

# GetNamespaceSuggestion

# Package: apps

# Namespace: AppsService

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

## Introduction

Suggests a namespace using the app's stored name and its owning account's slug or company name.
Falls back to the account slug when no company name is available.
Non-Wix app names must not contain `wix` (case-insensitive).
The exact names `google`, `facebook`, and `amazon` require privileged authorization (case-insensitive).
If the base namespace is already used, suggests an alternative with a numeric suffix. Suggestions do not reserve a namespace.
Set Namespace derives its own namespace from `appName` without automatically adding a collision suffix. Choose a different `appName` and retry if it conflicts.

---

## REST API

### Schema

```
 Method: getNamespaceSuggestion
 Description: Suggests a namespace using the app's stored name and its owning account's slug or company name. Falls back to the account slug when no company name is available. Non-Wix app names must not contain `wix` (case-insensitive). The exact names `google`, `facebook`, and `amazon` require privileged authorization (case-insensitive). If the base namespace is already used, suggests an alternative with a numeric suffix. Suggestions do not reserve a namespace. Set Namespace derives its own namespace from `appName` without automatically adding a collision suffix. Choose a different `appName` and retry if it conflicts.
 URL: https://www.wixapis.com/apps/v1/apps/{appId}/suggest-namespace
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId
 Method parameters: 
   param name: appId | type:   none | required: true 
   param name: type | type: NamespaceType    
      - enum:
           ACCOUNT - Uses the account slug.
           COMPANY - Uses the company name, falling back to the account slug when unavailable.
 Return type: GetNamespaceSuggestionResponse
  - name: namespace | type: string | description: Suggested namespace.  


```

### Examples

### Suggest a namespace for an app
Request a company-based namespace suggestion. A suggestion does not reserve the namespace. The request was validated against the test account. The response is representative and contains fictional data.

```curl
curl -X GET \
'https://www.wixapis.com/apps/v1/apps/da630f88-1b48-473e-a6a1-d71960c413fb/suggest-namespace?type=COMPANY' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.appManagement.apps.getNamespaceSuggestion(appId, options)
 Description: Suggests a namespace using the app's stored name and its owning account's slug or company name. Falls back to the account slug when no company name is available. Non-Wix app names must not contain `wix` (case-insensitive). The exact names `google`, `facebook`, and `amazon` require privileged authorization (case-insensitive). If the base namespace is already used, suggests an alternative with a numeric suffix. Suggestions do not reserve a namespace. Set Namespace derives its own namespace from `appName` without automatically adding a collision suffix. Choose a different `appName` and retry if it conflicts.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId
 Method parameters: 
   param name: appId | type: string | description: App GUID. | required: true | validation: format GUID
   param name: options | type: GetNamespaceSuggestionOptions  none  
        - name: type | type: NamespaceType | description: Whether to derive the namespace from the owning account or company. Default: `ACCOUNT`.  
             - enum:
             -     ACCOUNT: Uses the account slug.
             -     COMPANY: Uses the company name, falling back to the account slug when unavailable.
 Return type: PROMISE<GetNamespaceSuggestionResponse>
  - name: namespace | type: string | description: Suggested namespace.  


```

### Examples

### Suggest a namespace for an existing app
```javascript
import { apps } from "@wix/app-management";

async function getNamespaceSuggestion() {
  const response = await apps.getNamespaceSuggestion(
    "da630f88-1b48-473e-a6a1-d71960c413fb",
    { type: "COMPANY" },
  );
  return response;
}

/* Promise resolves to (representative, fictional values):
 * { "namespace": "@example-company/bookings-helper" }
 */

```

### getNamespaceSuggestion (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 getNamespaceSuggestion(appId,options) {
  const response = await myWixClient.apps.getNamespaceSuggestion(appId,options);
};
```

---