> 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

# DeleteAppPermission

# Package: appPermissions

# Namespace: AppPermissionsService

# Method link: https://dev.wix.com/docs/api-reference/app-management/app-permissions/delete-app-permission.md

## Permission Scopes:
Write Dev Center App Permissions: SCOPE.DEV_CENTER.WRITE_PERMISSIONS

## Introduction

Deletes a permission from the specified app.

After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.

> **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys.md).

---

## REST API

### Schema

```
 Method: deleteAppPermission
 Description: Deletes a permission from the specified app.  After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.  > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys.md).
 URL: https://www.wixapis.com/apps/v1/app-permissions/v1/app-permissions
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId, permissionId
 Method parameters: 
   query param name: appId | type: appId | description: App GUID.  You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. | required: true | validation: format GUID
   query param name: permissionId | type: permissionId | description: Permission GUID.  To find the permission GUID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app.md#step-1--identify-required-permissions). | required: true | validation: minLength 1, maxLength 164
 Return type: DeleteAppPermissionResponse
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: APP_PERMISSION_NOT_FOUND | Description: App permission doesn't exist for the given app and permission.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: APP_PERMISSION_REQUIRED_BY_SPI_OVERRIDE | Description: Permission can't be deleted because SPI component overrides of the app require it.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: APP_PERMISSION_REQUIRED_BY_SPI_COMPONENT | Description: Permission can't be deleted because SPI components of the app require it.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: APP_PERMISSION_REQUIRED_BY_WEBHOOK | Description: Permission can't be deleted because webhooks configured on the app require it.


```

### Examples

### Add a permission to an app
```curl
curl -X DELETE \
  'https://www.wixapis.com/apps/v1/app-permissions/v1/app-permissions?appId=73b98f4e-a8f3-4b7c-9d87-23fc55a793ec&permissionId=SCOPE.DC-EVENTS.MANAGE-EVENTS' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <APIKEY>' \
  -H 'wix-account-id: <ACCOUNTID>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.appManagement.appPermissions.deleteAppPermission(appId, permissionId)
 Description: Deletes a permission from the specified app.  After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.  > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId, permissionId
 Method parameters: 
   param name: appId | type: string | description: App GUID.  You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. | required: true | validation: format GUID
   param name: permissionId | type: string | description: Permission GUID.  To find the permission GUID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app.md#step-1--identify-required-permissions). | required: true | validation: minLength 1, maxLength 164
 Return type: PROMISE<DeleteAppPermissionResponse>
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: APP_PERMISSION_NOT_FOUND | Description: App permission doesn't exist for the given app and permission.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: APP_PERMISSION_REQUIRED_BY_SPI_OVERRIDE | Description: Permission can't be deleted because SPI component overrides of the app require it.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: APP_PERMISSION_REQUIRED_BY_SPI_COMPONENT | Description: Permission can't be deleted because SPI components of the app require it.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: APP_PERMISSION_REQUIRED_BY_WEBHOOK | Description: Permission can't be deleted because webhooks configured on the app require it.


```

### Examples

### deleteAppPermission
```javascript
import { appPermissions } from '@wix/app-management';

async function deleteAppPermission(appId,permissionId) {
  const response = await appPermissions.deleteAppPermission(appId,permissionId);
};
```

### deleteAppPermission (with elevated permissions)
```javascript
import { appPermissions } from '@wix/app-management';
import { auth } from '@wix/essentials';

async function myDeleteAppPermissionMethod(appId,permissionId) {
  const elevatedDeleteAppPermission = auth.elevate(appPermissions.deleteAppPermission);
  const response = await elevatedDeleteAppPermission(appId,permissionId);
}
```

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

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


async function deleteAppPermission(appId,permissionId) {
  const response = await myWixClient.appPermissions.deleteAppPermission(appId,permissionId);
};
```

---