> 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

# ArchiveArea

# Package: arrivals

# Namespace: AreasService

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

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

## Introduction

Archives an area.

An archived area no longer appears in setup or on the scanner, can't be picked in the plan editor, and can't
record new arrivals, but past arrivals that reference it keep resolving. Shortly after the area is archived, it
is removed from every plan benefit that grants entry into it, while Pricing Plans is enabled on the site; a plan
that still holds it shows it in the plan editor by its name followed by "(archived)" in the caller's language, as
in "Pool (archived)" in English, so it can be removed. Unarchiving with
[Unarchive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/unarchive-area.md)
does not put it back, so connect it to the
plans' benefits again, with the area's `id` as the Benefit Programs item.
Archiving and unarchiving are the only ways to change an area's `status`. Delete Area removes the area itself;
past arrivals keep its ID and name either way.
If the area holds 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.
Archiving an area that is already archived fails with `AREA_ALREADY_ARCHIVED`. Archiving the site's last
active area fails with `LAST_ACTIVE_AREA`: create or unarchive another area first. The rule counts the
site's active areas, not a location's: a location can be left with no active area. If the area changes while
it is being archived, the call fails with `ALREADY_EXISTS` and application code `INVALID_REVISION`; call it
again.

---

## REST API

### Schema

```
 Method: archiveArea
 Description: Archives an area.  An archived area no longer appears in setup or on the scanner, can't be picked in the plan editor, and can't record new arrivals, but past arrivals that reference it keep resolving. Shortly after the area is archived, it is removed from every plan benefit that grants entry into it, while Pricing Plans is enabled on the site; a plan that still holds it shows it in the plan editor by its name followed by "(archived)" in the caller's language, as in "Pool (archived)" in English, so it can be removed. Unarchiving with [Unarchive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/unarchive-area.md) does not put it back, so connect it to the plans' benefits again, with the area's `id` as the Benefit Programs item. Archiving and unarchiving are the only ways to change an area's `status`. Delete Area removes the area itself; past arrivals keep its GUID and name either way. If the area holds 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. Archiving an area that is already archived fails with `AREA_ALREADY_ARCHIVED`. Archiving the site's last active area fails with `LAST_ACTIVE_AREA`: create or unarchive another area first. The rule counts the site's active areas, not a location's: a location can be left with no active area. If the area changes while it is being archived, the call fails with `ALREADY_EXISTS` and application code `INVALID_REVISION`; call it again.
 URL: https://www.wixapis.com/arrivals/v1/areas/{areaId}/archive
 Method: POST
 Return type: ArchiveAreaResponse
  - name: area | type: Area | description: Archived area.  
     - name: id | type: string | description: Area GUID. Stable for the lifetime of the site and never reused, neither after the area is archived nor after it is deleted. It is also the GUID of the Benefit Programs item that stands for the area on a plan's benefit.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the area is updated. To prevent conflicting changes, the current revision must be passed when updating the area.  Ignored when creating an area.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the area was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the area was updated.  | read-only: true | validation: format date-time
     - name: name | type: string | description: Area name, in the business owner's own words. For example, `Main area` or `Pool`. Site collaborators see it on every scan, and it is the name of the area's Benefit Programs item on a plan.  | validation: minLength 1, maxLength 100
     - name: locationId | type: string | description: GUID of the business location this area belongs to, from the Locations API. Every area belongs to one. It must be a location of the site: an unknown GUID fails with `LOCATION_NOT_FOUND`. To move an area to another location, change it with [Update Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/update-area.md).  | validation: format GUID
     - name: status | type: Status | description: Whether the area is active or archived. Changes only through [Archive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/archive-area.md) and [Unarchive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/unarchive-area.md).  | read-only: true 
         - enum:
         -     ACTIVE: The area is in use: site collaborators can select its entrances and arrivals can be recorded at them.
         -     ARCHIVED: The area was archived. It no longer appears in setup or on the scanner, but past arrivals still resolve to it.
     - name: entrances | type: array<Entrance> | description: The entrances clients get into the area through: a door, a turnstile, a gate or a front desk. An area has at least one. Site collaborators pick the entrance they are standing at once per scanning position, and every arrival records it. One or more devices can be paired to an entrance; each scan names the entrance, not the device. Managed through Update Area: send the whole list, which replaces the current one. An entrance keeps its `id` for as long as it is in the list; a removed entrance disappears from the scanner, and past arrivals keep its GUID and name.  | validation: minItems 1, maxItems 20
        - name: id | type: string | description: Entrance GUID. Assigned by the server when the entrance is first sent on Create Area or Update Area, and kept while the entrance stays in the list. Send it back on Update Area to keep an existing entrance; an entrance sent without an GUID is new, and an GUID that is not one of the area's current entrances, or appears more than once, fails with `ENTRANCE_NOT_FOUND`. Ignored on Create Area. Arrivals record the entrance they were written at by this GUID.  | read-only: true | validation: format GUID
        - name: name | type: string | description: Entrance name, in the business owner's own words. For example, `Main entrance` or `Pool gate`. Site collaborators see it when they pick where they stand.  | validation: minLength 1, maxLength 100
        - name: defaultEntrance | type: boolean | description: Whether this entrance is the default entrance of its area's location, the one a scanner at that location preselects. A location has at most one across its areas, and can have none. Rarely, when two changes at one location happen at once, two entrances there can both be marked until a default is next marked; a client should then preselect the first one it finds. Mark it on Create Area or Update Area; the server sets and clears it as areas are created, updated, archived, unarchived and deleted, as each method describes and the introduction's Default entrances section sums up. Marking more than one in a request fails with `MULTIPLE_DEFAULT_ENTRANCES`. An archived area's entrances are never the default. It only tells a client app which entrance to preselect; every arrival names its entrance.  Default: `false`  
     - name: policy | type: EntryPolicy | description: What the owner requires of a client to enter this area: whether a booked scheduled event admits them, with its entry window, and the intake forms a client must have on file. Always set on a returned area. An area created without a policy gets one where scheduled events do not admit and no form is required.  
        - name: scheduledEventsPolicy | type: ScheduledEventsPolicy | description: Which scheduled events the client is booked into admit them, and when. Off by default: an area created without it, or before it existed, decides entry on pricing plans and intake forms only, and turning it on is an explicit change by the owner.  
           - name: entryGrantingAppIds | type: array<string> | description: App GUIDs of the apps whose scheduled events grant entry to a client booked into them at the area's location. For example, Wix Bookings' app GUID for its classes and appointments. A booked event of a listed app admits the client inside `entryWindow`, and nothing is redeemed for it; an event of an app not listed is not read. Empty, the default: scheduled events are not read at all, and the client is evaluated on their pricing plans and intake forms only. A non-empty list requires `entryWindow`. App GUIDs are not checked against the apps installed on the site; an GUID of an app that isn't installed is stored and grants nothing until the app is installed.  | validation: maxItems 10, format GUID
           - name: entryWindow | type: EntryWindow | description: When a client booked on a scheduled event may enter on it: how long before the event's start entry opens, and how long after the start it closes. A scheduled event outside its window does not admit; the client is then evaluated on their plans. The window is measured from the event's start, never its end. Required when `entryGrantingAppIds` is not empty, with both of its values; setting `entryGrantingAppIds` without it fails with `ENTRY_WINDOW_REQUIRED`, and a window with both values `0` fails with `EMPTY_ENTRY_WINDOW`. Ignored while `entryGrantingAppIds` is empty. There is no default on the server: a client that offers one pre-fills it, for example from the site's Self Check-in window.  
              - name: opensBeforeStartInMinutes | type: integer | description: How many minutes before the event's start entry opens.  | validation: minimum 0, maximum 1440, format int32
              - name: closesAfterStartInMinutes | type: integer | description: How many minutes after the event's start entry closes.  | validation: minimum 0, maximum 1440, format int32
        - name: intakeForms | type: array<IntakeForm> | description: The intake forms a client must have a valid submission for to enter the area. They're the same forms, and the same submissions, a Bookings booking policy requires: one signature counts for both. Each form is required independently, and each says what happens when it is missing: a pool can block entry on an unsigned swim waiver while only warning about an unsigned consent form. When several are missing, one that blocks entry decides. Each form GUID appears at most once; a repeat fails with `DUPLICATE_INTAKE_FORM`. Empty: no intake form is required.  Intake forms are validated and stored, but they aren't checked at entry yet: a client without a submission is evaluated on their plans and scheduled events as if no form were listed.  | validation: maxItems 20
           - name: formId | type: string | description: GUID of the intake form, from the Intake Forms API. It's the same GUID a booking policy's intake form policy holds. Whether a submission is still valid, and how often it must be renewed, is defined on the form. It must be an intake form of the site that is not archived, and the Intake Forms app must be installed: otherwise Create Area and Update Area fail with `INTAKE_FORM_NOT_FOUND` (`INVALID_ARGUMENT`), or with `INTAKE_FORM_ARCHIVED` or `INTAKE_FORM_APP_NOT_INSTALLED` (`FAILED_PRECONDITION`).  | validation: format GUID
           - name: blocksEntry | type: boolean | description: Whether the area refuses entry while the client has no valid submission for the form. `false`, the default and the recommended setting: the client is let in and site collaborators are told about the missing form. `true`: entry is blocked until the form is submitted; site collaborators can still override at the desk.  Stored, but not checked at entry yet.  Default: `false`  

 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.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: AREA_ALREADY_ARCHIVED | Description: Area was already archived.


```

### Examples

### Archive Area
Archives an area that is no longer in use, and removes it from the plan benefits that grant entry into it while Pricing Plans is enabled

```curl
curl -X POST \
  'https://www.wixapis.com/arrivals/v1/areas/5c2e7a90-3d4f-4b1a-8e6c-7f8a9b0c1d2e/archive' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.arrivals.areas.archiveArea(areaId)
 Description: Archives an area.  An archived area no longer appears in setup or on the scanner, can't be picked in the plan editor, and can't record new arrivals, but past arrivals that reference it keep resolving. Shortly after the area is archived, it is removed from every plan benefit that grants entry into it, while Pricing Plans is enabled on the site; a plan that still holds it shows it in the plan editor by its name followed by "(archived)" in the caller's language, as in "Pool (archived)" in English, so it can be removed. Unarchiving with [Unarchive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/unarchive-area.md) does not put it back, so connect it to the plans' benefits again, with the area's `id` as the Benefit Programs item. Archiving and unarchiving are the only ways to change an area's `status`. Delete Area removes the area itself; past arrivals keep its GUID and name either way. If the area holds 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. Archiving an area that is already archived fails with `AREA_ALREADY_ARCHIVED`. Archiving the site's last active area fails with `LAST_ACTIVE_AREA`: create or unarchive another area first. The rule counts the site's active areas, not a location's: a location can be left with no active area. If the area changes while it is being archived, 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 archive. | required: true | validation: format GUID
 Return type: PROMISE<ArchiveAreaResponse>
  - name: area | type: Area | description: Archived area.  
     - name: _id | type: string | description: Area GUID. Stable for the lifetime of the site and never reused, neither after the area is archived nor after it is deleted. It is also the GUID of the Benefit Programs item that stands for the area on a plan's benefit.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the area is updated. To prevent conflicting changes, the current revision must be passed when updating the area.  Ignored when creating an area.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the area was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the area was updated.  | read-only: true 
     - name: name | type: string | description: Area name, in the business owner's own words. For example, `Main area` or `Pool`. Site collaborators see it on every scan, and it is the name of the area's Benefit Programs item on a plan.  | validation: minLength 1, maxLength 100
     - name: locationId | type: string | description: GUID of the business location this area belongs to, from the Locations API. Every area belongs to one. It must be a location of the site: an unknown GUID fails with `LOCATION_NOT_FOUND`. To move an area to another location, change it with [Update Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/update-area.md).  | validation: format GUID
     - name: status | type: Status | description: Whether the area is active or archived. Changes only through [Archive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/archive-area.md) and [Unarchive Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/unarchive-area.md).  | read-only: true 
         - enum:
         -     ACTIVE: The area is in use: site collaborators can select its entrances and arrivals can be recorded at them.
         -     ARCHIVED: The area was archived. It no longer appears in setup or on the scanner, but past arrivals still resolve to it.
     - name: entrances | type: array<Entrance> | description: The entrances clients get into the area through: a door, a turnstile, a gate or a front desk. An area has at least one. Site collaborators pick the entrance they are standing at once per scanning position, and every arrival records it. One or more devices can be paired to an entrance; each scan names the entrance, not the device. Managed through Update Area: send the whole list, which replaces the current one. An entrance keeps its `id` for as long as it is in the list; a removed entrance disappears from the scanner, and past arrivals keep its GUID and name.  | validation: minItems 1, maxItems 20
        - name: _id | type: string | description: Entrance GUID. Assigned by the server when the entrance is first sent on Create Area or Update Area, and kept while the entrance stays in the list. Send it back on Update Area to keep an existing entrance; an entrance sent without an GUID is new, and an GUID that is not one of the area's current entrances, or appears more than once, fails with `ENTRANCE_NOT_FOUND`. Ignored on Create Area. Arrivals record the entrance they were written at by this GUID.  | read-only: true | validation: format GUID
        - name: name | type: string | description: Entrance name, in the business owner's own words. For example, `Main entrance` or `Pool gate`. Site collaborators see it when they pick where they stand.  | validation: minLength 1, maxLength 100
        - name: defaultEntrance | type: boolean | description: Whether this entrance is the default entrance of its area's location, the one a scanner at that location preselects. A location has at most one across its areas, and can have none. Rarely, when two changes at one location happen at once, two entrances there can both be marked until a default is next marked; a client should then preselect the first one it finds. Mark it on Create Area or Update Area; the server sets and clears it as areas are created, updated, archived, unarchived and deleted, as each method describes and the introduction's Default entrances section sums up. Marking more than one in a request fails with `MULTIPLE_DEFAULT_ENTRANCES`. An archived area's entrances are never the default. It only tells a client app which entrance to preselect; every arrival names its entrance.  Default: `false`  
     - name: policy | type: EntryPolicy | description: What the owner requires of a client to enter this area: whether a booked scheduled event admits them, with its entry window, and the intake forms a client must have on file. Always set on a returned area. An area created without a policy gets one where scheduled events do not admit and no form is required.  
        - name: scheduledEventsPolicy | type: ScheduledEventsPolicy | description: Which scheduled events the client is booked into admit them, and when. Off by default: an area created without it, or before it existed, decides entry on pricing plans and intake forms only, and turning it on is an explicit change by the owner.  
           - name: entryGrantingAppIds | type: array<string> | description: App GUIDs of the apps whose scheduled events grant entry to a client booked into them at the area's location. For example, Wix Bookings' app GUID for its classes and appointments. A booked event of a listed app admits the client inside `entryWindow`, and nothing is redeemed for it; an event of an app not listed is not read. Empty, the default: scheduled events are not read at all, and the client is evaluated on their pricing plans and intake forms only. A non-empty list requires `entryWindow`. App GUIDs are not checked against the apps installed on the site; an GUID of an app that isn't installed is stored and grants nothing until the app is installed.  | validation: maxItems 10, format GUID
           - name: entryWindow | type: EntryWindow | description: When a client booked on a scheduled event may enter on it: how long before the event's start entry opens, and how long after the start it closes. A scheduled event outside its window does not admit; the client is then evaluated on their plans. The window is measured from the event's start, never its end. Required when `entryGrantingAppIds` is not empty, with both of its values; setting `entryGrantingAppIds` without it fails with `ENTRY_WINDOW_REQUIRED`, and a window with both values `0` fails with `EMPTY_ENTRY_WINDOW`. Ignored while `entryGrantingAppIds` is empty. There is no default on the server: a client that offers one pre-fills it, for example from the site's Self Check-in window.  
              - name: opensBeforeStartInMinutes | type: integer | description: How many minutes before the event's start entry opens.  | validation: minimum 0, maximum 1440, format int32
              - name: closesAfterStartInMinutes | type: integer | description: How many minutes after the event's start entry closes.  | validation: minimum 0, maximum 1440, format int32
        - name: intakeForms | type: array<IntakeForm> | description: The intake forms a client must have a valid submission for to enter the area. They're the same forms, and the same submissions, a Bookings booking policy requires: one signature counts for both. Each form is required independently, and each says what happens when it is missing: a pool can block entry on an unsigned swim waiver while only warning about an unsigned consent form. When several are missing, one that blocks entry decides. Each form GUID appears at most once; a repeat fails with `DUPLICATE_INTAKE_FORM`. Empty: no intake form is required.  Intake forms are validated and stored, but they aren't checked at entry yet: a client without a submission is evaluated on their plans and scheduled events as if no form were listed.  | validation: maxItems 20
           - name: formId | type: string | description: GUID of the intake form, from the Intake Forms API. It's the same GUID a booking policy's intake form policy holds. Whether a submission is still valid, and how often it must be renewed, is defined on the form. It must be an intake form of the site that is not archived, and the Intake Forms app must be installed: otherwise Create Area and Update Area fail with `INTAKE_FORM_NOT_FOUND` (`INVALID_ARGUMENT`), or with `INTAKE_FORM_ARCHIVED` or `INTAKE_FORM_APP_NOT_INSTALLED` (`FAILED_PRECONDITION`).  | validation: format GUID
           - name: blocksEntry | type: boolean | description: Whether the area refuses entry while the client has no valid submission for the form. `false`, the default and the recommended setting: the client is let in and site collaborators are told about the missing form. `true`: entry is blocked until the form is submitted; site collaborators can still override at the desk.  Stored, but not checked at entry yet.  Default: `false`  

 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.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: AREA_ALREADY_ARCHIVED | Description: Area was already archived.


```

### Examples

### Archive an area that is no longer in use
The area keeps resolving in past arrivals. While Pricing Plans is enabled on the site, it's removed from the plan benefits that grant entry into it.

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

async function archiveArea() {
  const response = await areas.archiveArea(
    "5c2e7a90-3d4f-4b1a-8e6c-7f8a9b0c1d2e",
  );

  return response;
}

/* Promise resolves to:
 * {
 *   "area": {
 *     "_id": "5c2e7a90-3d4f-4b1a-8e6c-7f8a9b0c1d2e",
 *     "revision": "4",
 *     "_createdDate": "2026-10-04T09:20:00.000Z",
 *     "_updatedDate": "2026-10-04T11:30:00.000Z",
 *     "name": "Pool",
 *     "locationId": "0b3fa0a1-6f0a-4a5e-9e64-2b7a4a6f0c11",
 *     "status": "ARCHIVED",
 *     "entrances": [
 *       {
 *         "_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
 *         "name": "Pool gate",
 *         "defaultEntrance": false
 *       }
 *     ]
 *   }
 * }
 */

```

### archiveArea (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 archiveArea(areaId) {
  const response = await myWixClient.areas.archiveArea(areaId);
};
```

---