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.
📄️ List Areas
Lists areas visible to the current user. 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.
📄️ 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.
📄️ 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.