---
title: "Use to send a batch of queries to the [Route
Directions](/rest/api/maps/route/post-route-directions?view=rest-maps-2025-01-01)
API in a single synchronous request."
method: POST
path: "/route/directions:batch"
---

# Use to send a batch of queries to the [Route
Directions](/rest/api/maps/route/post-route-directions?view=rest-maps-2025-01-01)
API in a single synchronous request.

`POST /route/directions:batch`

The `Route Directions Batch` API is an HTTP `POST` request that sends batches
of up to **100** queries in a single call to the [Route
Directions](/rest/api/maps/route/post-route-directions?view=rest-maps-2025-01-01)
API.

### Submit Synchronous Batch Request
The Synchronous API is recommended for lightweight batch requests. When the
service receives a request, it will respond as soon as the batch items are
calculated and there will be no possibility to retrieve the results later. The
Synchronous API will return a timeout error (a 408 response) if the request
takes longer than 60 seconds. The number of batch items is limited to **100**
for this API.
```
POST https://atlas.microsoft.com/route/directions:batch?api-version=2025-01-01
```
### POST Body for Batch Request
To send the _directions_ queries you will use a `POST` request where the
request body will contain the `batchItems` array in `json` format and the
`Content-Type` header will be set to `application/json`. Here's a sample
request body containing 2 _directions_ queries:


```
{
  "batchItems": [
    {
      "optionalId": "bbc9c0f6-ab52-49d8-a788-a658fa654c94",
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "geometry": {
            "coordinates": [
              -122.3368,
              47.614988
            ],
            "type": "Point"
          },
          "properties": {
            "pointIndex": 0,
            "pointType": "waypoint"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "coordinates": [
              -122.316067,
              47.606356
            ],
            "type": "Point"
          },
          "properties": {
            "pointIndex": 1,
            "pointType": "waypoint"
          }
        }
      ],
      "optimizeRoute": "fastestWithoutTraffic",
      "routeOutputOptions": [
        "routeSummary"
      ],
      "maxRouteCount": 3,
      "travelMode": "driving"
    },
    {
      "optionalId": "a191de3c-1268-4986-98f0-03f0a5d9302a",
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "geometry": {
            "coordinates": [
              -122.3368,
              47.614988
            ],
            "type": "Point"
          },
          "properties": {
            "pointIndex": 0,
            "pointType": "waypoint"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "coordinates": [
              -122.316067,
              47.606356
            ],
            "type": "Point"
          },
          "properties": {
            "pointIndex": 1,
            "pointType": "waypoint"
          }
        }
      ],
      "optimizeRoute": "shortest",
      "routeOutputOptions": [
        "routeSummary"
      ],
      "maxRouteCount": 2,
      "travelMode": "driving"
    }
  ]
}
 ```

A _directions_ batchItem object can accept any of the supported _directions_
[Request
body](/rest/api/maps/route/post-route-directions?view=rest-maps-2025-01-01#request-body)



The batch should contain at least **1** query.


### Batch Response Model
The batch response contains a `summary` component that indicates the
`totalRequests` that were part of the original batch request and
`successfulRequests` i.e. queries which were executed successfully. The batch
response also includes a `batchItems` array which contains a response for each
and every query in the batch request. The `batchItems` will contain the results
in the exact same order the original queries were sent in the batch request.
Each item is of one of the following types:

- [`DirectionsResponse`](/rest/api/maps/route/post-directions#response) - If
the query completed successfully.

- `Error` - If the query failed. The response will contain a `code` and a
`message` in this case.

## Query parameters

- `api-version` string, required

## Headers

- `x-ms-client-id` string
- `Accept-Language` string

## Request body

- DirectionsBatchRequestBody — The list of directions queries/requests to process. The list can contain a max of 100 queries and must contain at least 1 query.
  - `batchItems` DirectionsBatchRequestItem[] — The list of queries to process.
    - `optionalId` string — Id of the request which would show in corresponding batchItem.
    - `type` 'FeatureCollection', required — Specifies the `GeoJSON` type. The only supported object type is `FeatureCollection`. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
    - `features` InputWaypointFeaturesItem[], required — Driving, walking, and truck routes are defined by a set of waypoints(stops) and viaWaypoints (intermediate locations that the route must pass through). You can have a maximum of 150 waypoints, and a maximum of 10 viaWaypoints between each set of waypoints. A route must have a minimum of 2 waypoints and the start and end points of the route cannot be viaWaypoints. Both waypoint and viaWaypoint locations must be specified as a valid GeoJSON Point feature object along with pointIndex that specifies the order of the locations. For more information on the GeoJSON format, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
      - `type` 'Feature', required — Specifies the `GeoJSON` type. The only supported object type is Feature. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
      - `geometry` GeoJsonPoint, required — A valid `GeoJSON` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) for details.
        - `type` 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon' | 'GeometryCollection' | 'Feature' | 'FeatureCollection', required — Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature and FeatureCollection.
      - `properties` InputWaypointProperties, required — Specifies the properties of a waypoint which is a specific location or point along a route or trip that serves as a reference or stopping point.
        - `pointIndex` integer — Identify and order the sequence of waypoints in the route. The default value is the `index value` of a features array.
        - `pointType` 'waypoint' | 'viaWaypoint' — Waypoint type on the route. It can be a stop or an intermediate location that the route must pass through.
    - `travelMode` 'driving' | 'truck' | 'walking' — The mode of travel for the requested route. If not defined, the default value is "driving" that returns the route optimized for cars. `Note`: For truck travelMode, the requested truck route may not be available for the entire route. Where the truck route is not available for a particular section, the travelMode element of the response for that section will be "other". Example: "travelMode":"driving"
    - `departAt` string, date-time — The date and time of departure from the origin point formatted as a `dateTime` value defined by [RFC 3339, section 5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). When a time zone offset is not specified, UTC will be assumed. If the `departAt` is not set, the default value is the current time. Example: "departAt": "2023-06-01T09:30:00.000-07:00"
    - `arriveAt` string, date-time — The date and time of arrival at the destination point formatted as a `dateTime` value defined by [RFC 3339, section 5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). When a time zone offset is not specified, UTC will be assumed. The `arriveAt` parameter cannot be used in conjunction with `departAt`. Example: "arriveAt": "2023-06-01T09:30:00.000-07:00"
    - `optimizeRoute` 'short' | 'shortest' | 'fastestWithoutTraffic' | 'fastestWithTraffic' — Specifies the parameter to use to optimize the route. If not defined, the default is "fastestWithoutTraffic" which returns the route to minimize the travel time without using current traffic information. Example: "optimizeRoute":"shortest"
    - `optimizeWaypointOrder` boolean — Re-order the route waypoints using a fast heuristic algorithm to reduce the route cost specified with the optimize parameter. The origin and destination are excluded from the optimized waypoint and their position is considered fixed. Acceptable values are true or false.
    - `avoid` AvoidEnum[] — Specifies restrictions that the route calculation should honor when determining the route. Avoid supports multiple values in a request and is only supported for the driving and truck travelMode. Example: "avoid": ["limitedAccessHighways", "tollRoads"]
    - `routeOutputOptions` RouteOutputOptionEnum[] — Include the desired route information from the response. By default, the itinerary is included in the response. Supports multiple values such as "routeOutputOptions": ["routePath", "itinerary"]
    - `maxRouteCount` integer — The maximum number of routes to return. Available for the driving and truck travel modes. Default: "maxRouteCount":1
    - `heading` integer — The initial directional heading of the vehicle in degrees starting at true North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is 180 degrees, west is 270 degrees.
    - `vehicleSpec` RouteDirectionVehicleSpec — Specifies the vehicle attributes such as size, weight, max speed, type of cargo, etc. for truck routing only. This helps avoid low bridge clearances, road restrictions, difficult right turns to provide the optimized truck route based on the vehicle specifications. IS`Note`: Only supported for truck travelMode.
      - `isVehicleCommercial` boolean — Whether the vehicle is used for commercial purposes. Commercial vehicles may not be allowed to drive on some roads.
      - `length` number, double — Length of the vehicle in meters. A value of 0 means that length restrictions are not considered.
      - `width` number, double — Width of the vehicle in meters. A value of 0 means that width restrictions are not considered.
      - `height` number, double — Height of the vehicle in meters. A value of 0 means that height restrictions are not considered.
      - `weight` integer — Weight of the vehicle in kilograms. A value of 0 means that weight restrictions are not considered.
      - `maxSpeed` integer — Maximum speed of the vehicle in km/hour. The max speed in the vehicle profile is used to check whether a vehicle is allowed on motorways. A value of 0 means that an appropriate value for the vehicle will be determined and applied during route planning. A non-zero value may be overridden during route planning. For example, the current traffic flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will again use 60 km/hour.
      - `axleWeight` integer — Weight per axle of the vehicle in kg. A value of 0 means that weight restrictions per axle are not considered.
      - `loadType` VehicleLoadTypeEnum[] — Types of cargo that may be classified as hazardous materials and restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, plus generic classifications for use in other countries. Values beginning with USHazmat are for US routing while otherHazmat should be used for all other countries. vehicleLoadType supports multiple values in a request.
      - `adrTunnelRestrictionCode` 'B' | 'C' | 'D' | 'E' — The ADR tunnel restriction code. ADR is a European agreement concerning the international carriage of dangerous goods by road. The ADR tunnel restriction code is used to determine whether a vehicle is allowed to pass through a tunnel with restrictions on the carriage of dangerous goods.
      - `axleCount` integer — The number of axles on the vehicle.

## Response `200`

The request has succeeded.

- DirectionsBatchResponse — This object is returned from a successful Directions Batch service call.
  - `summary` DirectionsBatchResponseSummary — Summary for the batch request
    - `successfulRequests` integer — Number of successful requests in the batch
    - `totalRequests` integer — Total number of requests in the batch
  - `batchItems` DirectionsBatchResponseItem[] — Array containing the batch results.
    - `optionalId` string — Id of the request which would show in corresponding batchItem.
    - `alternativeRoutes` FeatureCollection[] — Alternative route.
      - `type` 'FeatureCollection' — Specifies the `GeoJSON` type. The only supported object type is `FeatureCollection`. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
      - `features` FeaturesItem[] — `GeoJSON` feature object that contains Geometry object and additional properties. For more information, see [RFC 7946, Section 3.2](https://www.rfc-editor.org/rfc/rfc7946#section-3.2).
        - `type` 'Feature' — Specifies the `GeoJSON` type. The only supported object type is Feature. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
        - `geometry` RouteDirectionsGeometry — A valid `GeoJSON` Geometry object. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
          - `type` 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon' | 'GeometryCollection' | 'Feature' | 'FeatureCollection', required — Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature and FeatureCollection.
        - `properties` FeatureProperties — Specifies the feature properties of the route like itinerary, route Legs and geometry, travel summary.
          - `type` 'ManeuverPoint' | 'Waypoint' | 'RoutePath', required — Output type.
        - `bbox` number[] — A rectangular area on the earth defined as a bounding box object. The sides of the rectangles are defined by latitude and longitude values. For more information, see [RFC 7946, Section 5](https://www.rfc-editor.org/rfc/rfc7946#section-5). Example: "bbox": [-10.0, -10.0, 10.0, 10.0]
    - `type` 'FeatureCollection' — Specifies the `GeoJSON` type. The only supported object type is `FeatureCollection`. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
    - `features` FeaturesItem[] — `GeoJSON` feature object that contains Geometry object and additional properties. For more information, see [RFC 7946, Section 3.2](https://www.rfc-editor.org/rfc/rfc7946#section-3.2).
      - `type` 'Feature' — Specifies the `GeoJSON` type. The only supported object type is Feature. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
      - `geometry` RouteDirectionsGeometry — A valid `GeoJSON` Geometry object. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
        - `type` 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon' | 'GeometryCollection' | 'Feature' | 'FeatureCollection', required — Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature and FeatureCollection.
      - `properties` FeatureProperties — Specifies the feature properties of the route like itinerary, route Legs and geometry, travel summary.
        - `type` 'ManeuverPoint' | 'Waypoint' | 'RoutePath', required — Output type.
      - `bbox` number[] — A rectangular area on the earth defined as a bounding box object. The sides of the rectangles are defined by latitude and longitude values. For more information, see [RFC 7946, Section 5](https://www.rfc-editor.org/rfc/rfc7946#section-5). Example: "bbox": [-10.0, -10.0, 10.0, 10.0]
    - `error` CommonErrorDetail — The error detail.
      - `code` string — The error code.
      - `message` string — The error message.
      - `target` string — The error target.
      - `details` CommonErrorDetail[] — The error details.
      - `additionalInfo` ErrorAdditionalInfo[] — The error additional info.
        - `type` string — The additional info type.
        - `info` object — The additional info.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/maps-route.md) · [All operations](https://skmtc.net/azure/apis/maps-route/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/maps-route/revisions/4b7b4a919999/schema)
