> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcargo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Territories

> Group members into named pools and distribute leads across them with weighted round-robin — the building block Allocate nodes route leads to.

A **territory** is a named group of [members](/reference/revenue-organization) that leads can be distributed across. When an [Allocate](/workflows/overview) node routes a lead to a territory, Cargo picks one of its members with **weighted round-robin** — spreading assignments evenly (or proportionally, if you set weights) and skipping anyone who is unavailable.

<Note>
  Territories don't encode region, vertical, or segment rules themselves. They're
  a pool of members plus distribution weights. To route different leads to
  different territories, branch upstream in your [workflow](/workflows/overview)
  and point each Allocate node at the right `territoryUuid`.
</Note>

## Anatomy of a territory

| Field                | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| `label`              | Human-readable name (e.g. `West`, `Enterprise EMEA`).                       |
| `color`              | Visual tag: `orange`, `red`, `purple`, `green`, `yellow`, or `grey`.        |
| `description`        | Optional free-text note.                                                    |
| `members`            | The pool of members, each with an optional `weight`.                        |
| `fallbackMemberUuid` | Optional member who receives the lead when no one in the pool is available. |

Each entry in `members` is a member `uuid` plus an optional `weight`:

```json theme={null}
[
  { "uuid": "<member-uuid>", "weight": 2 },
  { "uuid": "<member-uuid>", "weight": 1 }
]
```

## How distribution works

When an Allocate node targets a territory, Cargo runs weighted round-robin over the pool:

* **`weight: 1` (or `null`)** — a normal share of leads. A missing weight is treated as `1`.
* **`weight: 2`, `3`, …** — proportionally more leads than lower-weighted members.
* **`weight: 0`** — excluded from the pool entirely (no leads).
* **Unavailable members** — anyone filtered out by a [capacity](/reference/revenue-organization/capacities) is skipped for that assignment.

Members are ordered deterministically and the rotation position is persisted, so distribution stays even across separate play runs rather than restarting each time.

### Fallback member

If every eligible member is unavailable (all at capacity, or all weighted `0`), the lead goes to the `fallbackMemberUuid` and the resulting allocation is flagged as a fallback assignment. If no fallback is set, allocation fails with a "no members available" error — so set a fallback whenever every lead must land somewhere.

## Manage territories from the CLI

```bash theme={null}
cargo-ai revenue-organization territory list
cargo-ai revenue-organization territory get <uuid>

cargo-ai revenue-organization territory create \
  --label "West" --color orange \
  --members '[{"uuid":"<member-uuid>","weight":1}]' \
  --description "West-coast AEs" \
  --fallback-member-uuid "<member-uuid>"

cargo-ai revenue-organization territory update \
  --uuid "<uuid>" \
  --members '[{"uuid":"<member-uuid>","weight":2}]'

cargo-ai revenue-organization territory remove <uuid>
```

| Command  | Required                          | Optional                                                                     |
| -------- | --------------------------------- | ---------------------------------------------------------------------------- |
| `create` | `--label`, `--color`, `--members` | `--description`, `--fallback-member-uuid`                                    |
| `update` | `--uuid`                          | `--label`, `--color`, `--description`, `--members`, `--fallback-member-uuid` |

<Note>
  Members are CRM-synced — run `cargo-ai revenue-organization member sync   --connector-uuid <uuid>` and `member list` to get the member UUIDs you
  reference in `--members`.
</Note>

## Route leads to a territory

Territories are consumed by the **Allocate** node in a play. Select the `territory` mode, choose the `territoryUuid`, and (optionally) attach a [capacity](/reference/revenue-organization/capacities) to cap each member's workload.

<CardGroup cols={2}>
  <Card title="Capacities" icon="gauge" href="/reference/revenue-organization/capacities">
    Cap how many records each member can receive within a time window.
  </Card>

  <Card title="Build a play" icon="play" href="/plays/overview">
    Add an Allocate step that distributes leads across your territory.
  </Card>
</CardGroup>
