Skip to content
Pile
Esc
↑↓navigate↵open⌘Jpreview

List customer territories

Group active customers with addresses into canvassing territories (neighborhood field, then borough / postal code / city parsed from the address). Stops inside each territory sort by street name then house number so a field rep gets a ready-to-walk route list per neighborhood.

GET/workspaces/{organizationId}/customers/territories
Authorization
AuthorizationBearer token · headerrequired

Workspace API key (Authorization: Bearer <key>). Issue keys under Settings → Developer or POST /workspaces/{organizationId}/tokens.

Path parameters
organizationIdstringrequired
Responses
200

Canvassing territories with ordered stops

territoriesobject[]required
Show properties
Array of object
keystringrequired
labelstringrequired
countintegerrequired
dueCountintegerrequired
stopsobject[]required
Show properties
Array of object
idstringrequired
namestringrequired
addressstring | nullrequired
phonestring | nullrequired
streetNamestringrequired
houseNumbernumber | nullrequired
priorityScorenumber | nullrequired
nextStepDueAtstring | nullrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://pile.nyc/workspaces/string/customers/territories' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "territories": [
    {
      "key": "string",
      "label": "string",
      "count": 0,
      "dueCount": 0,
      "stops": [
        {
          "id": "string",
          "name": "string",
          "address": "string",
          "phone": "string",
          "streetName": "string",
          "houseNumber": 0,
          "priorityScore": 0,
          "nextStepDueAt": "string"
        }
      ]
    }
  ]
}

Was this page helpful?