---
schema_version: "1"
id: ff5e40f4fbe3c727bfbd9ceb1bb32a370382c68cab7329aa794ed9ce68e1b019
title: Get Service Territories
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/build-custom-apps/usecase11/uc11-get-service-territories.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc11-get-service-territories.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b00cdfdc18faa13a8e7323c3f9cf9ea0d1b22b111541ba31629f9a547ed45ffc
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Get Service Territories

A service territory represents a branch or office location where your service resources (appointment attendees) operate from or meet customers. Show your users your available service territorieson the next page on your website by retrieving a list of active service territories from your Salesforce instance. Your users can search for service territories based on user-entered name, city, postal code, or state. Users can also view the distance between two locations, such as between a service territory and the user's current location.

1.  Create a page for users to search for service territories.

    Here’s how a Select Service Territory page can look.

    ![A representation of the Select Service Territory screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/concurrent-serviceTerritory.png)

2.  To retrieve a list of active service territories from your Salesforce instance, use the `service-territories` Connect API request.

    **Sample Request**

    This sample REST API call uses the [`service-territories`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_service_territories.htm) request to retrieve service territories within a range of 10 miles from your current location. The default value is 5 miles.

    ```nolang
    https://YOUR_INSTANCE.salesforce.com/services/data/v68.0/connect/scheduling​​​/service-territories?workTypeGroupId=0VSS70000004DvWOAU
    ```

    Where `YOUR_INSTANCE` is a variable.

    **Sample Response**

    The request returns the service territory records.

    ```nolang
    {
      "result": {
        "serviceTerritories": [
          {
            "city": "Hyderabad",
            "country": "India",
            "id": "0HhS70000004F9zKAE",
            "name": "ServiceTerritory1",
            "operatingHoursId": "0OHS70000004FIxOAM",
            "postalCode": "500032",
            "state": "TG"
          }
        ]
      }
    }
    ```

3.  Parse the JSON response, and show the available service territories on a page that you created. Your users can select a service territory for the appointment.


