PATCH

Update Area


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

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 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 and Unarchive Area. An archived area can't be updated and fails with AREA_ARCHIVED; unarchive it first.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permission Scopes
SCOPE.ARRIVALS.MANAGE-AREAS
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/arrivals/v1/areas/{area.id}

Errors
400Invalid Argument

There are 7 errors with this status code.

428Failed Precondition

There are 3 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?