---
title: "[beta] List route templates for a specific hub"
method: GET
path: "/hub/route-templates"
tags: ["Beta APIs"]
---

# \[beta\] List route templates for a specific hub

`GET /hub/route-templates`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/hub/route-templates`
- Auth: HTTP bearer

Retrieve route templates for a specific hub. Optionally filter by route template ID or name.

 <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select **Read Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
 

 **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

## Query parameters

- `hubId` string, required
- `id` string
- `name` string
- `after` string
- `limit` integer

## Response `200`

OK response.

- HubRouteTemplatesListHubRouteTemplatesResponseBody
  - `data` HubRouteTemplateObjectResponseBody[], required: Route templates.
    - `createdAtTime` string, date-time, required: The timestamp when the route template was created, in RFC 3339 format.
    - `defaultDepotEnd` HubRouteTemplateDepotObjectResponseBody: A depot location for a route template.
      - `externalId` string: The customer-provided external identifier for the depot location.
      - `formattedAddress` string, required: The formatted address of the depot location.
      - `id` string, required: The unique identifier for the depot location.
      - `latitude` number, double, required: Latitude coordinate of the depot location.
      - `longitude` number, double, required: Longitude coordinate of the depot location.
      - `name` string, required: The name of the depot location.
    - `defaultDepotStart` HubRouteTemplateDepotObjectResponseBody: A depot location for a route template.
      - `externalId` string: The customer-provided external identifier for the depot location.
      - `formattedAddress` string, required: The formatted address of the depot location.
      - `id` string, required: The unique identifier for the depot location.
      - `latitude` number, double, required: Latitude coordinate of the depot location.
      - `longitude` number, double, required: Longitude coordinate of the depot location.
      - `name` string, required: The name of the depot location.
    - `defaultStartTimeOfDay` string: Default start time of day for the route template, in HH:MM format in the hub's local timezone (e.g. '08:00').
    - `distanceMeters` integer, required: Total distance of the route in meters.
    - `durationSeconds` integer, required: Total duration of the route in seconds.
    - `hubId` string, required: The hub identifier this route template belongs to.
    - `hubTimezone` string, required: The IANA timezone of the hub (e.g. 'America/Los_Angeles').
    - `id` string, required: The unique identifier for the route template.
    - `locations` HubRouteTemplateLocationObjectResponseBody[], required: Ordered list of stop locations in the route template.
      - `externalId` string: The customer-provided identifier for the location.
      - `formattedAddress` string, required: The formatted address of the location.
      - `latitude` number, double, required: Latitude coordinate of the location.
      - `longitude` number, double, required: Longitude coordinate of the location.
      - `name` string, required: The name of the location.
      - `position` integer, required: The 1-based position of this stop in the route template.
    - `name` string, required: The name of the route template.
    - `updatedAtTime` string, date-time, required: The timestamp when the route template was last updated, in RFC 3339 format.
  - `pagination` GoaPaginationResponseResponseBody, required: Pagination parameters.
    - `endCursor` string, required: Cursor identifier representing the last element in the response. This value should be used in conjunction with a subsequent request's 'after' query parameter. This may be an empty string if there are no more pages left to view.
    - `hasNextPage` boolean, required: True if there are more pages of results immediately available after this endCursor.

## Other responses

- `401`: Unauthorized response.
- `404`: Not Found response.
- `405`: Method Not Allowed response.
- `413`: Content Too Large response.
- `429`: Too Many Requests response.
- `500`: Internal Server Error response.
- `501`: Not Implemented response.
- `502`: Bad Gateway response.
- `503`: Service Unavailable response.
- `504`: Gateway Timeout response.
- `default`: Bad Request response.

---

[API](https://skmtc.dev/samsara/apis/samsara-api.md) - [All operations](https://skmtc.dev/samsara/apis/samsara-api/llms.txt) - [OpenAPI document](https://skmtc.dev/samsara/apis/samsara-api/revisions/a9e35d4999be?raw)
