Get Service Territories
Changed onLists service territories. Role-based auto-scoping applies: a Team Leader only sees territories owned/created by users on their teams; a Field Executive only sees their own owned/created territories.
Request
- Base URLhttps://dc-region.zuperpro.com/api
- URLhttps://dc-region.zuperpro.com/api/territory
- AuthAPI key in header x-api-key
Query parameters
For search (includes only territory_name)
created_at
Must be sent together with the other updated_at bound. Strict format: YYYY-MM-DDTHH:mm:ssZ, YYYY-MM-DD HH:mm:ss, YYYY-MM-DDTHH:mm:ss.SSSZ, or YYYY-MM-DD HH:mm:ss.SSS.
Must be sent together with the other updated_at bound. Strict format: YYYY-MM-DDTHH:mm:ssZ, YYYY-MM-DD HH:mm:ss, YYYY-MM-DDTHH:mm:ss.SSSZ, or YYYY-MM-DD HH:mm:ss.SSS.
"<latitude>,<longitude>" — applied as an in-memory geo filter (point-in-radius for RADIUS territories, point-in-polygon for GEOFENCE) after the DB query, so pagination totals reflect the post-filter count.
If true, populates owners with user details.
If true, populates teams with team details.
If true, restricts to territories where the requesting user is listed in owners.
Response
200
Example response
{
"type": "success",
"data": [
{
"territory_uid": "0f4ee337-85c6-472b-a0c9-f471b67f8ea5",
"territory_name": "check 2",
"territory_description": "check",
"territory_color": "#4960a0",
"territory_type": "ZIPCODE",
"territory_zipcodes": [
"600028"
],
"created_by": {
"user_uid": "48625036-fef6-4637-99e7-f09377a4f9ba",
"first_name": "Hariharan",
"last_name": "M",
"email": "hariharan.m@zuper.co",
"designation": "Tech",
"emp_code": "1234",
"prefix": "Z22",
"profile_picture": "https://s3.ap-south-1.amazonaws.com/prod.app.zuperpro/assets/profile_picture.jpg",
"hourly_labor_charge": 20,
"is_active": true,
"created_at": "2024-07-05T06:42:02.000Z",
"updated_at": "2024-07-05T06:42:02.000Z"
},
"is_active": true,
"created_at": "2024-09-19T10:39:36.663Z",
"updated_at": "2024-09-19T10:39:36.667Z"
}
],
"total_records": 3,
"current_page": "1",
"total_pages": 1
}Changes
- info
endpoint added
- info