> 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

# DeleteArea

# Package: arrivals

# Namespace: AreasService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/delete-area.md

## Permission Scopes:
SCOPE.ARRIVALS.DELETE-AREAS: SCOPE.ARRIVALS.DELETE-AREAS

## Introduction

Deletes an area.

Any area can be deleted, active or archived, including one with recorded arrivals, except the site's last
active area: deleting an `ACTIVE` area when no other area of the site is `ACTIVE` fails with
`LAST_ACTIVE_AREA`, so a site keeps an area to record arrivals at. The rule counts the site's
active areas, not a location's: a location can be left with no active area. Shortly after the area is
deleted, it is removed from every plan benefit that grants entry into it, while Pricing Plans is enabled on the
site. Past arrivals keep the area's ID and name, as recorded on each arrival. The area's ID is never reused. If
the area held its location's default entrance,
the default moves to the first entrance of another active area at that location: that area's `revision`
increments and an Area Updated event fires for it. With no other active area there, the location has no
default until an area is created, unarchived or moved there. A deleted area can't be restored. To take an
area out of use and be able to make it active again later, call
[Archive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/archive-area.md) instead (it leaves its
plans either way). If the
area changes while it is being deleted, the call fails with `ALREADY_EXISTS` and application code
`INVALID_REVISION`; call it again.

---

## REST API

### Schema

```
 Method: deleteArea
 Description: Deletes an area.  Any area can be deleted, active or archived, including one with recorded arrivals, except the site's last active area: deleting an `ACTIVE` area when no other area of the site is `ACTIVE` fails with `LAST_ACTIVE_AREA`, so a site keeps an area to record arrivals at. The rule counts the site's active areas, not a location's: a location can be left with no active area. Shortly after the area is deleted, it is removed from every plan benefit that grants entry into it, while Pricing Plans is enabled on the site. Past arrivals keep the area's GUID and name, as recorded on each arrival. The area's GUID is never reused. If the area held its location's default entrance, the default moves to the first entrance of another active area at that location: that area's `revision` increments and an Area Updated event fires for it. With no other active area there, the location has no default until an area is created, unarchived or moved there. A deleted area can't be restored. To take an area out of use and be able to make it active again later, call [Archive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/archive-area.md) instead (it leaves its plans either way). If the area changes while it is being deleted, the call fails with `ALREADY_EXISTS` and application code `INVALID_REVISION`; call it again.
 URL: https://www.wixapis.com/arrivals/v1/areas/{areaId}
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  areaId
 Method parameters: 
   param name: areaId | type:   none | required: true 
 Return type: DeleteAreaResponse
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: LAST_ACTIVE_AREA | Description: The area is the site's last active area. Create or unarchive another area first.


```

### Examples

### Delete Area
Deletes an area, and removes it from the plan benefits that grant entry into it while Pricing Plans is enabled

```curl
curl -X DELETE \
  'https://www.wixapis.com/arrivals/v1/areas/9d8c7b6a-5f4e-4d3c-b2a1-0f9e8d7c6b5a' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.arrivals.areas.deleteArea(areaId)
 Description: Deletes an area.  Any area can be deleted, active or archived, including one with recorded arrivals, except the site's last active area: deleting an `ACTIVE` area when no other area of the site is `ACTIVE` fails with `LAST_ACTIVE_AREA`, so a site keeps an area to record arrivals at. The rule counts the site's active areas, not a location's: a location can be left with no active area. Shortly after the area is deleted, it is removed from every plan benefit that grants entry into it, while Pricing Plans is enabled on the site. Past arrivals keep the area's GUID and name, as recorded on each arrival. The area's GUID is never reused. If the area held its location's default entrance, the default moves to the first entrance of another active area at that location: that area's `revision` increments and an Area Updated event fires for it. With no other active area there, the location has no default until an area is created, unarchived or moved there. A deleted area can't be restored. To take an area out of use and be able to make it active again later, call [Archive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/archive-area.md) instead (it leaves its plans either way). If the area changes while it is being deleted, the call fails with `ALREADY_EXISTS` and application code `INVALID_REVISION`; call it again.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  areaId
 Method parameters: 
   param name: areaId | type: string | description: GUID of the area to delete. | required: true | validation: format GUID
 Return type: PROMISE<DeleteAreaResponse>
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: LAST_ACTIVE_AREA | Description: The area is the site's last active area. Create or unarchive another area first.


```

### Examples

### Delete an area created by mistake
The site's last active area can't be deleted. To keep the option to bring an area back, archive it instead.

```javascript
import { areas } from "@wix/arrivals";

async function deleteArea() {
  await areas.deleteArea("9d8c7b6a-5f4e-4d3c-b2a1-0f9e8d7c6b5a");
}

```

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

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


async function deleteArea(areaId) {
  const response = await myWixClient.areas.deleteArea(areaId);
};
```

---