Beta APIs

[beta] Create a route template for a specific hub

Create a new route template for a hub.

<b>Rate limit:</b> 5 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 Write 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.

post/hub/route-templates

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

defaultStartTimeOfDaystring

Default start time in HH:MM format in the hub's local timezone (e.g. '08:00').

hubIdstring required

The ID of the hub.

locationExternalIdsstring[]

Stop locations referenced by external ID, in the order they should be visited.

namestring required

The name of the route template.

Example request

{
  "defaultDepotEnd": {
    "externalId": "DEPOT-001"
  },
  "defaultDepotStart": {
    "externalId": "DEPOT-001"
  },
  "defaultStartTimeOfDay": "08:00",
  "hubId": "550e8400-e29b-41d4-a716-446655440000",
  "locationExternalIds": [
    "LOC-123",
    "LOC-123",
    "LOC-123",
    "LOC-123"
  ],
  "name": "Downtown Delivery Route"
}

Response

OK response.

Example response

{
  "data": {
    "createdAtTime": "2024-01-15T10:30:00Z",
    "defaultDepotEnd": {
      "externalId": "DEPOT-001",
      "formattedAddress": "123 Industrial Blvd, Los Angeles, CA 90210, US",
      "id": "750e8400-e29b-41d4-a716-446655440002",
      "latitude": 34.0522,
      "longitude": -118.2437,
      "name": "Main Warehouse"
    },
    "defaultDepotStart": {
      "externalId": "DEPOT-001",
      "formattedAddress": "123 Industrial Blvd, Los Angeles, CA 90210, US",
      "id": "750e8400-e29b-41d4-a716-446655440002",
      "latitude": 34.0522,
      "longitude": -118.2437,
      "name": "Main Warehouse"
    },
    "defaultStartTimeOfDay": "08:00",
    "distanceMeters": 15000,
    "durationSeconds": 3600,
    "hubId": "550e8400-e29b-41d4-a716-446655440000",
    "hubTimezone": "America/Los_Angeles",
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "locations": [
      {
        "externalId": "LOC-123",
        "formattedAddress": "456 Main St, Los Angeles, CA 90210, US",
        "latitude": 34.0522,
        "longitude": -118.2437,
        "name": "Customer ABC Warehouse",
        "position": 1
      }
    ],
    "name": "Downtown Delivery Route",
    "updatedAtTime": "2024-01-15T12:00:00Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.