Area
Areas define geographic territories used for account assignment and canvassing.
📄️ Get Area
Retrieves a single area by its ID. Returns the area definition including coordinates, assignment configuration, filters, and current job status (if an assignment is running). Requires the `area:list` permission scoped to the area's team or users. Use `/area/list` instead to find areas by user or team. An area outside the caller's company returns the same `NotFound` ('Area not found') as an unknown area ID.
📄️ List Areas
Lists areas visible to the current user. Pass `version: 2` (CLI: `--version 2`) to use filters, sorting, statistics, and pagination; omit `version` only for legacy v1 behavior. Set `size` to limit each v2 page, then pass the returned `sortTimestamp` to retrieve the next page. Filter by a specific user, team, or set of downline team IDs. When no filter is provided, returns all areas the caller has permission to view — company admins and users with company-level `area:add` see all areas; other users see areas for their managed teams plus any unassigned areas. Requires the `area:list` permission. Use `/area/get` instead when you already have the `areaId`.
📄️ Add Area
Creates a new area and returns the saved object. An area defines a geographic territory using polygon coordinates and optional filter criteria. The server automatically cleans invalid polygon geometries (e.g., self-intersections) before saving.
📄️ Update Area
Updates an existing area and returns the updated object. Pass the full area object including its `areaId`. All mutable fields (coordinates, assignment type, team, users, filters, schedule, etc.) can be changed. The server re-validates and cleans coordinates on every update. Fields omitted from the request, such as `note`, `color`, or `filters`, are cleared, so start from the area returned by `/area/get`. Updating an area does not reassign accounts; call `/area/assign` to apply the changes.
📄️ Remove Area
Deletes an area by its ID. This is a permanent deletion — the area and its configuration are removed. Any scheduled assignments for this area will no longer run.
📄️ Run Area Assignment
Triggers an assignment run for one or more areas. This is an **asynchronous** operation — it returns immediately with a success response while the assignment processes in the background.