> 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

# UpdateArea

# Package: arrivals

# Namespace: AreasService

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

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

## Introduction

Updates an area.

Each time the area is updated, `revision` increments by 1. The current `revision` must be passed when
updating the area. This ensures you're working with the latest area and prevents unintended overwrites.

Use it to rename the area, change its location, change its entrances, or change its policy. Plan benefits
show the area's current name after a rename: Pricing Plans reads it from Arrivals by the area's ID.
Changing `locationId` moves the area with its entrances; entrance IDs don't change, so a device paired to an
entrance now admits people at the new location. Past arrivals keep the location they were recorded at, and Query
Areas filtered by the old `locationId` no longer returns the area.

When the area held its old location's default entrance, changing `locationId` removes it, and the old location
is left without a default until one is marked or a later write there sets one. At the new location the area
keeps or gets the default only when that location has none, unless the request marks one of its entrances.

`entrances` is replaced as a whole: send every entrance to keep, with its `id`, and any new one without an ID;
an entrance left out is removed: it disappears from the scanner, and past arrivals keep its ID and name. An
`id` that is not one of the area's current entrances, or appears more than once, fails with `ENTRANCE_NOT_FOUND`:
for an unknown ID, call [Get Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/get-area.md) again and rebuild `entrances` from its current entrances; for a
repeated ID, send each entrance once. The list must keep at least
one entrance. Marking an entrance `defaultEntrance` makes it the default entrance of the area's location and
clears the entrance that was; when that entrance is in another area, that area's `revision` increments and an Area Updated event fires for it. Marking
more than one fails with `MULTIPLE_DEFAULT_ENTRANCES`. If the area held its location's default and the list
sent marks none, its first entrance becomes the default. `policy.intakeForms` is replaced as a whole too, so an empty list clears every
requirement. `policy.scheduledEventsPolicy.entryWindow` is changed with both of its values; an update that leaves
`policy.scheduledEventsPolicy.entryGrantingAppIds` not empty with no window on the area fails with `ENTRY_WINDOW_REQUIRED`.
An update that writes the window or the apps and leaves apps listed with both window values `0` fails with
`EMPTY_ENTRY_WINDOW`; an area already stored that way can still be updated in its other fields.

The location is checked against the Locations API when `locationId` changes. When `policy.intakeForms`
changes, every listed form is checked against the Intake Forms API, including forms already on the area.

`status` can't be updated here: sending `status` fails with `INVALID_ARGUMENT`. Use
[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).
An archived area can't be updated and fails with `AREA_ARCHIVED`; unarchive it first.

---

## REST API

### Schema

```
 Method: updateArea
 Description: Updates an area.  Each time the area is updated, `revision` increments by 1. The current `revision` must be passed when updating the area. This ensures you're working with the latest area and prevents unintended overwrites.  Use it to rename the area, change its location, change its entrances, or change its policy. Plan benefits show the area's current name after a rename: Pricing Plans reads it from Arrivals by the area's GUID. Changing `locationId` moves the area with its entrances; entrance GUIDs don't change, so a device paired to an entrance now admits people at the new location. Past arrivals keep the location they were recorded at, and Query Areas filtered by the old `locationId` no longer returns the area.  When the area held its old location's default entrance, changing `locationId` removes it, and the old location is left without a default until one is marked or a later write there sets one. At the new location the area keeps or gets the default only when that location has none, unless the request marks one of its entrances.  `entrances` is replaced as a whole: send every entrance to keep, with its `id`, and any new one without an GUID; an entrance left out is removed: it disappears from the scanner, and past arrivals keep its GUID and name. An `id` that is not one of the area's current entrances, or appears more than once, fails with `ENTRANCE_NOT_FOUND`: for an unknown GUID, call [Get Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/get-area.md) again and rebuild `entrances` from its current entrances; for a repeated GUID, send each entrance once. The list must keep at least one entrance. Marking an entrance `defaultEntrance` makes it the default entrance of the area's location and clears the entrance that was; when that entrance is in another area, that area's `revision` increments and an Area Updated event fires for it. Marking more than one fails with `MULTIPLE_DEFAULT_ENTRANCES`. If the area held its location's default and the list sent marks none, its first entrance becomes the default. `policy.intakeForms` is replaced as a whole too, so an empty list clears every requirement. `policy.scheduledEventsPolicy.entryWindow` is changed with both of its values; an update that leaves `policy.scheduledEventsPolicy.entryGrantingAppIds` not empty with no window on the area fails with `ENTRY_WINDOW_REQUIRED`. An update that writes the window or the apps and leaves apps listed with both window values `0` fails with `EMPTY_ENTRY_WINDOW`; an area already stored that way can still be updated in its other fields.  The location is checked against the Locations API when `locationId` changes. When `policy.intakeForms` changes, every listed form is checked against the Intake Forms API, including forms already on the area.  `status` can't be updated here: sending `status` fails with `INVALID_ARGUMENT`. Use [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). An archived area can't be updated and fails with `AREA_ARCHIVED`; unarchive it first.
 URL: https://www.wixapis.com/arrivals/v1/areas/{area.id}
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  area, area.id, area.revision, area.entrances.name, area.policy.intakeForms.formId, area.policy.scheduledEventsPolicy.entryWindow.opensBeforeStartInMinutes, area.policy.scheduledEventsPolicy.entryWindow.closesAfterStartInMinutes
 Method parameters: 
   param name: area | type: Area | description: An area is a part of a business that pricing plans grant entry into (the main floor, the pool, a cycle studio), with the entrances clients pass through to get in. Plans are connected to areas: an area is the Benefit Programs item a pricing plan's benefit names, so which plans are allowed into an area is defined on the plans' benefits, not on the area. Every entry is recorded against an area and one of its entrances. An area belongs to a business location. When Arrivals is installed on a site, an area with one entrance (the default entrance of that location) is created at the site's default location, each with a default name in the site's language: "Main area" and "Main entrance" in English. The owner can rename them. A site can be installed before it has a default location, which the Locations API creates once the business info has an address; it then gets no area at install, and the dashboard's setup asks for a location and creates the first area. Other areas are created with Create Area.  An area's `policy` holds what the owner configures about entering it (whether a booked scheduled event admits a client, with its entry window, and the intake forms a client must have on file) and nothing about a single entry: whether a human is present to decide is a property of the scan, not of the area.  An area is archived to close it, or deleted. Either way, while Pricing Plans is enabled on the site, it is removed from its plans, and unarchiving does not put it back. Past arrivals keep the area's GUID and name either way. | required: true 
        - 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. | required: true | 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. | required: true | read-only: true | validation: format int64
        - 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: 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: 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. | required: true | validation: minimum 0, maximum 1440, format int32
                 - name: closesAfterStartInMinutes | type: integer | description: How many minutes after the event's start entry closes. | required: true | 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`  
 Return type: UpdateAreaResponse
  - name: area | type: Area | description: Updated 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: 400 | Status Code: INVALID_ARGUMENT | Application Code: ENTRANCE_NOT_FOUND | Description: Couldn't find the entrance. An entrance `id` isn't one of the area's current entrances, or appears more than once. For an unknown GUID, retrieve the area again and rebuild `entrances` from its current entrances. For a repeated GUID, send each entrance once.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INTAKE_FORM_NOT_FOUND | Description: Couldn't find the intake form. A `policy.intakeForms` `formId` isn't an intake form of the site.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: LOCATION_NOT_FOUND | Description: Couldn't find the location. `locationId` isn't a location of the site.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: DUPLICATE_INTAKE_FORM | Description: The same `formId` appears more than once in `policy.intakeForms`. List each intake form once.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_ENTRY_WINDOW | Description: `policy.scheduledEventsPolicy.entryGrantingAppIds` is not empty and `policy.scheduledEventsPolicy.entryWindow` has both `opensBeforeStartInMinutes` and `closesAfterStartInMinutes` at `0`, which admits practically no one. Set at least one of them above `0`.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ENTRY_WINDOW_REQUIRED | Description: `policy.scheduledEventsPolicy.entryGrantingAppIds` is not empty and the area has no `policy.scheduledEventsPolicy.entryWindow`.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MULTIPLE_DEFAULT_ENTRANCES | Description: More than one entrance in `entrances` is marked `defaultEntrance`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: AREA_ARCHIVED | Description: The area is archived. Unarchive it first.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INTAKE_FORM_APP_NOT_INSTALLED | Description: The Intake Forms app isn't installed on the site, so `policy.intakeForms` can't name a form. Install the app first.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INTAKE_FORM_ARCHIVED | Description: A `policy.intakeForms` `formId` is an archived intake form, which can't be required. Unarchive it or remove it.


```

### Examples

### Update Area
Adds a second entrance and requires a swim waiver for the pool

```curl
curl -X PATCH \
  'https://www.wixapis.com/arrivals/v1/areas/5c2e7a90-3d4f-4b1a-8e6c-7f8a9b0c1d2e' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "area": {
      "id": "5c2e7a90-3d4f-4b1a-8e6c-7f8a9b0c1d2e",
      "revision": "2",
      "entrances": [
        { "id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "name": "Pool gate" },
        { "name": "Changing rooms door" }
      ],
      "policy": {
        "intakeForms": [
          { "formId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "blocksEntry": true }
        ]
      }
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.arrivals.areas.updateArea(_id, area)
 Description: Updates an area.  Each time the area is updated, `revision` increments by 1. The current `revision` must be passed when updating the area. This ensures you're working with the latest area and prevents unintended overwrites.  Use it to rename the area, change its location, change its entrances, or change its policy. Plan benefits show the area's current name after a rename: Pricing Plans reads it from Arrivals by the area's GUID. Changing `locationId` moves the area with its entrances; entrance GUIDs don't change, so a device paired to an entrance now admits people at the new location. Past arrivals keep the location they were recorded at, and Query Areas filtered by the old `locationId` no longer returns the area.  When the area held its old location's default entrance, changing `locationId` removes it, and the old location is left without a default until one is marked or a later write there sets one. At the new location the area keeps or gets the default only when that location has none, unless the request marks one of its entrances.  `entrances` is replaced as a whole: send every entrance to keep, with its `id`, and any new one without an GUID; an entrance left out is removed: it disappears from the scanner, and past arrivals keep its GUID and name. An `id` that is not one of the area's current entrances, or appears more than once, fails with `ENTRANCE_NOT_FOUND`: for an unknown GUID, call [Get Area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/get-area.md) again and rebuild `entrances` from its current entrances; for a repeated GUID, send each entrance once. The list must keep at least one entrance. Marking an entrance `defaultEntrance` makes it the default entrance of the area's location and clears the entrance that was; when that entrance is in another area, that area's `revision` increments and an Area Updated event fires for it. Marking more than one fails with `MULTIPLE_DEFAULT_ENTRANCES`. If the area held its location's default and the list sent marks none, its first entrance becomes the default. `policy.intakeForms` is replaced as a whole too, so an empty list clears every requirement. `policy.scheduledEventsPolicy.entryWindow` is changed with both of its values; an update that leaves `policy.scheduledEventsPolicy.entryGrantingAppIds` not empty with no window on the area fails with `ENTRY_WINDOW_REQUIRED`. An update that writes the window or the apps and leaves apps listed with both window values `0` fails with `EMPTY_ENTRY_WINDOW`; an area already stored that way can still be updated in its other fields.  The location is checked against the Locations API when `locationId` changes. When `policy.intakeForms` changes, every listed form is checked against the Intake Forms API, including forms already on the area.  `status` can't be updated here: sending `status` fails with `INVALID_ARGUMENT`. Use [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). An archived area can't be updated and fails with `AREA_ARCHIVED`; unarchive it first.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  area, _id, area.revision, area.entrances.name, area.policy.intakeForms.formId, area.policy.scheduledEventsPolicy.entryWindow.opensBeforeStartInMinutes, area.policy.scheduledEventsPolicy.entryWindow.closesAfterStartInMinutes
 Method parameters: 
   param 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. | required: true | validation: format GUID
   param name: area | type: UpdateArea | description: An area is a part of a business that pricing plans grant entry into (the main floor, the pool, a cycle studio), with the entrances clients pass through to get in. Plans are connected to areas: an area is the Benefit Programs item a pricing plan's benefit names, so which plans are allowed into an area is defined on the plans' benefits, not on the area. Every entry is recorded against an area and one of its entrances. An area belongs to a business location. When Arrivals is installed on a site, an area with one entrance (the default entrance of that location) is created at the site's default location, each with a default name in the site's language: "Main area" and "Main entrance" in English. The owner can rename them. A site can be installed before it has a default location, which the Locations API creates once the business info has an address; it then gets no area at install, and the dashboard's setup asks for a location and creates the first area. Other areas are created with Create Area.  An area's `policy` holds what the owner configures about entering it (whether a booked scheduled event admits a client, with its entry window, and the intake forms a client must have on file) and nothing about a single entry: whether a human is present to decide is a property of the scan, not of the area.  An area is archived to close it, or deleted. Either way, while Pricing Plans is enabled on the site, it is removed from its plans, and unarchiving does not put it back. Past arrivals keep the area's GUID and name either way. | required: true 
        - 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. | required: true | read-only: true | validation: format int64
        - 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: 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: 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. | required: true | validation: minimum 0, maximum 1440, format int32
                 - name: closesAfterStartInMinutes | type: integer | description: How many minutes after the event's start entry closes. | required: true | 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`  
 Return type: PROMISE<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: 400 | Status Code: INVALID_ARGUMENT | Application Code: ENTRANCE_NOT_FOUND | Description: Couldn't find the entrance. An entrance `id` isn't one of the area's current entrances, or appears more than once. For an unknown GUID, retrieve the area again and rebuild `entrances` from its current entrances. For a repeated GUID, send each entrance once.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INTAKE_FORM_NOT_FOUND | Description: Couldn't find the intake form. A `policy.intakeForms` `formId` isn't an intake form of the site.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: LOCATION_NOT_FOUND | Description: Couldn't find the location. `locationId` isn't a location of the site.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: DUPLICATE_INTAKE_FORM | Description: The same `formId` appears more than once in `policy.intakeForms`. List each intake form once.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_ENTRY_WINDOW | Description: `policy.scheduledEventsPolicy.entryGrantingAppIds` is not empty and `policy.scheduledEventsPolicy.entryWindow` has both `opensBeforeStartInMinutes` and `closesAfterStartInMinutes` at `0`, which admits practically no one. Set at least one of them above `0`.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ENTRY_WINDOW_REQUIRED | Description: `policy.scheduledEventsPolicy.entryGrantingAppIds` is not empty and the area has no `policy.scheduledEventsPolicy.entryWindow`.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MULTIPLE_DEFAULT_ENTRANCES | Description: More than one entrance in `entrances` is marked `defaultEntrance`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: AREA_ARCHIVED | Description: The area is archived. Unarchive it first.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INTAKE_FORM_APP_NOT_INSTALLED | Description: The Intake Forms app isn't installed on the site, so `policy.intakeForms` can't name a form. Install the app first.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INTAKE_FORM_ARCHIVED | Description: A `policy.intakeForms` `formId` is an archived intake form, which can't be required. Unarchive it or remove it.


```

### Examples

### Add an entrance to an area
Send every entrance to keep with its ID, and the new one without an ID. Pass the current revision.

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

async function updateArea() {
  const response = await areas.updateArea(
    "5c2e7a90-3d4f-4b1a-8e6c-7f8a9b0c1d2e",
    {
      revision: "2",
      entrances: [
        { _id: "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", name: "Pool gate" },
        { name: "Changing rooms door" },
      ],
    },
  );

  return response;
}

/* Promise resolves to:
 * {
 *   "_id": "5c2e7a90-3d4f-4b1a-8e6c-7f8a9b0c1d2e",
 *   "revision": "3",
 *   "_createdDate": "2026-10-04T09:20:00.000Z",
 *   "_updatedDate": "2026-10-04T10:02:41.118Z",
 *   "name": "Pool",
 *   "locationId": "0b3fa0a1-6f0a-4a5e-9e64-2b7a4a6f0c11",
 *   "status": "ACTIVE",
 *   "entrances": [
 *     {
 *       "_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
 *       "name": "Pool gate",
 *       "defaultEntrance": false
 *     },
 *     {
 *       "_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
 *       "name": "Changing rooms door",
 *       "defaultEntrance": false
 *     }
 *   ],
 *   "policy": {
 *     "intakeForms": [
 *       {
 *         "formId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
 *         "blocksEntry": true
 *       }
 *     ]
 *   }
 * }
 */

```

### updateArea (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 updateArea(_id,area) {
  const response = await myWixClient.areas.updateArea(_id,area);
};
```

---