{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-maps/json-schema/microsoft-azure-maps-directions-request-schema.json",
  "title": "DirectionsRequest",
  "description": "This object is the request body.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-maps-route-api-openapi.yml#/components/schemas/DirectionsRequest",
  "type": "object",
  "properties": {
    "type": {
      "$ref": "#/$defs/FeatureTypeEnum",
      "description": "Specifies the `GeoJSON` type. The only supported object type is\n`FeatureCollection`. For more information, see [RFC\n7946](https://www.rfc-editor.org/rfc/rfc7946)."
    },
    "features": {
      "type": "array",
      "description": "Driving, walking, and truck routes are defined by a set of waypoints(stops) and\nviaWaypoints (intermediate locations that the route must pass through). You can\nhave a maximum of 150 waypoints, and a maximum of 10 viaWaypoints between each\nset of waypoints.\n\nA route must have a minimum of 2 waypoints and the start and end points of the\nroute cannot be viaWaypoints.\n\nBoth waypoint and viaWaypoint locations must be specified as a valid GeoJSON\nPoint feature object along with pointIndex that specifies the order of the\nlocations. For more information on the GeoJSON format, see [RFC\n7946](https://www.rfc-editor.org/rfc/rfc7946).",
      "minItems": 2,
      "items": {
        "$ref": "#/$defs/InputWaypointFeaturesItem"
      }
    },
    "travelMode": {
      "type": "string",
      "description": "The mode of travel for the requested route. If not defined, the default value\nis \"driving\" that returns the route optimized for cars.\n\n`Note`: For truck travelMode, the requested truck route may not be available\nfor the entire route. Where the truck route is not available for a particular\nsection, the travelMode element of the response for that section will be\n\"other\".\n\nExample: \"travelMode\":\"driving\"",
      "default": "driving",
      "enum": [
        "driving",
        "truck",
        "walking"
      ],
      "x-ms-enum": {
        "name": "TravelModeEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "driving",
            "value": "driving",
            "description": "The returned routes are optimized for cars."
          },
          {
            "name": "truck",
            "value": "truck",
            "description": "The returned routes are optimized for large size trucks based on the vehicle\nspecification."
          },
          {
            "name": "walking",
            "value": "walking",
            "description": "The returned routes are optimized for pedestrians, including the use of\nsidewalks."
          }
        ]
      }
    },
    "departAt": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time of departure from the origin point formatted as a `dateTime`\nvalue defined by [RFC 3339, section\n5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). When a time zone\noffset is not specified, UTC will be assumed.\n\nIf the `departAt` is not set, the default value is the current time.\n\nExample:\n\n\"departAt\": \"2023-06-01T09:30:00.000-07:00\""
    },
    "arriveAt": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time of arrival at the destination point formatted as a `dateTime`\nvalue defined by [RFC 3339, section\n5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). When a time zone\noffset is not specified, UTC will be assumed.\n\nThe `arriveAt` parameter cannot be used in conjunction with `departAt`.\n\nExample: \"arriveAt\": \"2023-06-01T09:30:00.000-07:00\""
    },
    "optimizeRoute": {
      "type": "string",
      "description": "Specifies the parameter to use to optimize the route. If not defined, the\ndefault is \"fastestWithoutTraffic\" which returns the route to minimize the\ntravel time without using current traffic information.\n\nExample: \"optimizeRoute\":\"shortest\"",
      "default": "fastestWithoutTraffic",
      "enum": [
        "short",
        "shortest",
        "fastestWithoutTraffic",
        "fastestWithTraffic"
      ],
      "x-ms-enum": {
        "name": "RouteDirectionOptimizeRouteEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "Short",
            "value": "short",
            "description": "The route is calculated to balance fast travel time and short distance, rather\nthan prioritizing just one. It's optimized for both speed and efficiency.\nTraffic information is not used."
          },
          {
            "name": "Shortest",
            "value": "shortest",
            "description": "The route is calculated to minimize the distance. Traffic information is not\nused."
          },
          {
            "name": "FastestWithoutTraffic",
            "value": "fastestWithoutTraffic",
            "description": "Finds the fastest route, without factoring in traffic information."
          },
          {
            "name": "FastestWithTraffic",
            "value": "fastestWithTraffic",
            "description": "The route is calculated to minimize the time using current traffic information.\n`Note`: Only supported for driving and truck travelMode."
          }
        ]
      }
    },
    "optimizeWaypointOrder": {
      "type": "boolean",
      "description": "Re-order the route waypoints using a fast heuristic algorithm to reduce the\nroute cost specified with the optimize parameter. The origin and destination\nare excluded from the optimized waypoint and their position is considered\nfixed. Acceptable values are true or false.",
      "default": false
    },
    "avoid": {
      "type": "array",
      "description": "Specifies restrictions that the route calculation should honor when determining\nthe route. Avoid supports multiple values in a request and is only supported\nfor the driving and truck travelMode.\n\nExample: \"avoid\": [\"limitedAccessHighways\", \"tollRoads\"]",
      "items": {
        "$ref": "#/$defs/AvoidEnum"
      }
    },
    "routeOutputOptions": {
      "type": "array",
      "description": "Include the desired route information from the response. By default, the\nitinerary is included in the response.\n\nSupports multiple values such as \"routeOutputOptions\": [\"routePath\",\n\"itinerary\"]",
      "default": [
        "itinerary"
      ],
      "items": {
        "$ref": "#/$defs/RouteOutputOptionEnum"
      }
    },
    "maxRouteCount": {
      "type": "integer",
      "format": "int64",
      "description": "The maximum number of routes to return. Available for the driving and truck\ntravel modes.\n\nDefault: \"maxRouteCount\":1",
      "minimum": 1,
      "maximum": 6
    },
    "heading": {
      "type": "integer",
      "format": "int64",
      "description": "The initial directional heading of the vehicle in degrees starting at true\nNorth and continuing in clockwise direction. North is 0 degrees, east is 90\ndegrees, south is 180 degrees, west is 270 degrees.",
      "minimum": 0,
      "maximum": 359
    },
    "vehicleSpec": {
      "$ref": "#/$defs/RouteDirectionVehicleSpec",
      "description": "Specifies the vehicle attributes such as size, weight, max speed, type of\ncargo, etc. for truck routing only. This helps avoid low bridge clearances,\nroad restrictions, difficult right turns to provide the optimized truck route\nbased on the vehicle specifications.\n\n`Note`: Only supported for truck travelMode"
    }
  },
  "required": [
    "type",
    "features"
  ],
  "$defs": {
    "AdrTunnelRestrictionCodeEnum": {
      "type": "string",
      "description": "The ADR tunnel restriction code. ADR is a European agreement concerning the\ninternational carriage of dangerous goods by road. The ADR tunnel restriction\ncode is used to determine whether a vehicle is allowed to pass through a tunnel\nwith restrictions on the carriage of dangerous goods.",
      "enum": [
        "B",
        "C",
        "D",
        "E"
      ],
      "x-ms-enum": {
        "name": "AdrTunnelRestrictionCodeEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "B",
            "value": "B",
            "description": "Vehicles with code B are restricted from roads with ADR tunnel categories B, C,\nD, and E."
          },
          {
            "name": "C",
            "value": "C",
            "description": "Vehicles with code C are restricted from roads with ADR tunnel categories C, D,\nand E"
          },
          {
            "name": "D",
            "value": "D",
            "description": "Vehicles with code D are restricted from roads with ADR tunnel categories D and\nE."
          },
          {
            "name": "E",
            "value": "E",
            "description": "Vehicles with code E are restricted from roads with ADR tunnel category E."
          }
        ]
      }
    },
    "AvoidEnum": {
      "type": "string",
      "description": "Specifies restrictions that the route calculation should honor when determining the route.\nAvoid supports multiple values in a request and is only supported for the driving and truck\ntravelMode.\\n\\nExample: \\\"avoid\\\": [\\\"limitedAccessHighways\\\", \\\"tollRoads\\\"]",
      "enum": [
        "limitedAccessHighways",
        "tollRoads",
        "ferries",
        "tunnels",
        "borderCrossings",
        "lowEmissionZones",
        "unpavedRoads"
      ],
      "x-ms-enum": {
        "name": "AvoidEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "limitedAccessHighways",
            "value": "limitedAccessHighways",
            "description": "Avoids the use of limited access highways in the route."
          },
          {
            "name": "tollRoads",
            "value": "tollRoads",
            "description": "Avoids the use of toll roads in the route."
          },
          {
            "name": "ferries",
            "value": "ferries",
            "description": "Avoids the use of ferries in the route."
          },
          {
            "name": "tunnels",
            "value": "tunnels",
            "description": "Avoids the use of tunnels in the route."
          },
          {
            "name": "borderCrossings",
            "value": "borderCrossings",
            "description": "Avoids crossing country borders in the route."
          },
          {
            "name": "lowEmissionZones",
            "value": "lowEmissionZones",
            "description": "Avoids low-emission zones in the route."
          },
          {
            "name": "unpavedRoads",
            "value": "unpavedRoads",
            "description": "Avoids unpaved roads in the route."
          }
        ]
      }
    },
    "FeatureTypeEnum": {
      "type": "string",
      "description": "Specifies the `GeoJSON` type. The only supported object type is\n`FeatureCollection`. For more information, see [RFC\n7946](https://www.rfc-editor.org/rfc/rfc7946).",
      "enum": [
        "FeatureCollection"
      ],
      "x-ms-enum": {
        "name": "FeatureTypeEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "FeatureCollection",
            "value": "FeatureCollection",
            "description": "Specifies the `GeoJSON` `FeatureCollection` object type."
          }
        ]
      }
    },
    "FeaturesItemTypeEnum": {
      "type": "string",
      "description": "Specifies the `GeoJSON` type. The only supported object type is Feature. For\nmore information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).",
      "enum": [
        "Feature"
      ],
      "x-ms-enum": {
        "name": "FeaturesItemTypeEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "Feature",
            "value": "Feature",
            "description": "Specifies the `GeoJSON` Feature object type."
          }
        ]
      }
    },
    "GeoJsonGeometry": {
      "type": "object",
      "description": "A valid `GeoJSON` geometry object. The type must be one of the seven valid\nGeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString,\nPolygon, MultiPolygon and GeometryCollection. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1) for details.",
      "properties": {
        "type": {
          "$ref": "#/$defs/GeoJsonObjectType",
          "description": "Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object\ntypes - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon,\nGeometryCollection, Feature and FeatureCollection."
        }
      },
      "required": [
        "type"
      ]
    },
    "GeoJsonObjectType": {
      "type": "string",
      "description": "Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object\ntypes - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon,\nGeometryCollection, Feature and FeatureCollection.",
      "enum": [
        "Point",
        "MultiPoint",
        "LineString",
        "MultiLineString",
        "Polygon",
        "MultiPolygon",
        "GeometryCollection",
        "Feature",
        "FeatureCollection"
      ],
      "x-ms-enum": {
        "name": "GeoJsonObjectType",
        "modelAsString": false,
        "values": [
          {
            "name": "GeoJsonPoint",
            "value": "Point",
            "description": "`GeoJSON Point` geometry."
          },
          {
            "name": "GeoJsonMultiPoint",
            "value": "MultiPoint",
            "description": "`GeoJSON MultiPoint` geometry."
          },
          {
            "name": "GeoJsonLineString",
            "value": "LineString",
            "description": "`GeoJSON LineString` geometry."
          },
          {
            "name": "GeoJsonMultiLineString",
            "value": "MultiLineString",
            "description": "`GeoJSON MultiLineString` geometry."
          },
          {
            "name": "GeoJsonPolygon",
            "value": "Polygon",
            "description": "`GeoJSON Polygon` geometry."
          },
          {
            "name": "GeoJsonMultiPolygon",
            "value": "MultiPolygon",
            "description": "`GeoJSON MultiPolygon` geometry."
          },
          {
            "name": "GeoJsonGeometryCollection",
            "value": "GeometryCollection",
            "description": "`GeoJSON GeometryCollection` geometry."
          },
          {
            "name": "GeoJsonFeature",
            "value": "Feature",
            "description": "`GeoJSON Feature` object."
          },
          {
            "name": "GeoJsonFeatureCollection",
            "value": "FeatureCollection",
            "description": "`GeoJSON FeatureCollection` object."
          }
        ]
      }
    },
    "GeoJsonPoint": {
      "type": "object",
      "description": "A valid `GeoJSON Point` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details.",
      "properties": {
        "coordinates": {
          "type": "array",
          "description": "A `Position` is an array of numbers with two or more elements. The first two\nelements are _longitude_ and _latitude_, precisely in that order.\n_Altitude/Elevation_ is an optional third element. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.1) for details.",
          "items": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "required": [
        "coordinates"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/GeoJsonGeometry"
        }
      ],
      "x-ms-discriminator-value": "Point"
    },
    "InputWaypointFeaturesItem": {
      "type": "object",
      "description": "Specifies the input waypoint and viaWaypoint `GeoJSON` feature object and\nadditional properties. For more information, see [RFC\n7946](https://www.rfc-editor.org/rfc/rfc7946).",
      "properties": {
        "type": {
          "$ref": "#/$defs/FeaturesItemTypeEnum",
          "description": "Specifies the `GeoJSON` type. The only supported object type is Feature. For\nmore information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946)."
        },
        "geometry": {
          "$ref": "#/$defs/GeoJsonPoint",
          "description": "A valid `GeoJSON Point` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details."
        },
        "properties": {
          "$ref": "#/$defs/InputWaypointProperties",
          "description": "Specifies the properties of a waypoint which is a specific location or point\nalong a route or trip that serves as a reference or stopping point."
        }
      },
      "required": [
        "type",
        "geometry",
        "properties"
      ]
    },
    "InputWaypointProperties": {
      "type": "object",
      "description": "Specifies the properties of a waypoint which is a specific location or point\nalong a route or trip that serves as a reference or stopping point.",
      "properties": {
        "pointIndex": {
          "type": "integer",
          "format": "int64",
          "description": "Identify and order the sequence of waypoints in the route. The default value is\nthe `index value` of a features array."
        },
        "pointType": {
          "type": "string",
          "description": "Waypoint type on the route. It can be a stop or an intermediate location that\nthe route must pass through.",
          "default": "waypoint",
          "enum": [
            "waypoint",
            "viaWaypoint"
          ],
          "x-ms-enum": {
            "name": "InputWaypointTypeEnum",
            "modelAsString": true,
            "values": [
              {
                "name": "waypoint",
                "value": "waypoint",
                "description": "A waypoint is a specific location or point along a route or trip that serves as\na reference or stopping point."
              },
              {
                "name": "viaWaypoint",
                "value": "viaWaypoint",
                "description": "A viaWaypoint is a specific waypoint that must be passed through or visited\nalong a route or trip."
              }
            ]
          }
        }
      }
    },
    "RouteDirectionVehicleSpec": {
      "type": "object",
      "description": "Specifies the vehicle attributes such as size, weight, max speed, type of\ncargo, etc. for truck routing only. This helps avoid low bridge clearances,\nroad restrictions, difficult right turns to provide the optimized truck route\nbased on the vehicle specifications.\n\nIS`Note`: Only supported for truck travelMode.",
      "properties": {
        "isVehicleCommercial": {
          "type": "boolean",
          "description": "Whether the vehicle is used for commercial purposes. Commercial vehicles may\nnot be allowed to drive on some roads.",
          "default": false
        },
        "length": {
          "type": "number",
          "format": "double",
          "description": "Length of the vehicle in meters. A value of 0 means that length restrictions\nare not considered.",
          "default": 0,
          "minimum": 0,
          "maximum": 1000000
        },
        "width": {
          "type": "number",
          "format": "double",
          "description": "Width of the vehicle in meters. A value of 0 means that width restrictions are\nnot considered.",
          "default": 0,
          "minimum": 0,
          "maximum": 1000000
        },
        "height": {
          "type": "number",
          "format": "double",
          "description": "Height of the vehicle in meters. A value of 0 means that height restrictions\nare not considered.",
          "default": 0,
          "minimum": 0,
          "maximum": 1000000
        },
        "weight": {
          "type": "integer",
          "format": "int64",
          "description": "Weight of the vehicle in kilograms. A value of 0 means that weight restrictions\nare not considered.",
          "default": 0,
          "minimum": 0,
          "maximum": 1000000
        },
        "maxSpeed": {
          "type": "integer",
          "format": "int64",
          "description": "Maximum speed of the vehicle in km/hour. The max speed in the vehicle profile\nis used to check whether a vehicle is allowed on motorways.\n\nA value of 0 means that an appropriate value for the vehicle will be determined\nand applied during route planning.\n\nA non-zero value may be overridden during route planning. For example, the\ncurrent traffic flow is 60 km/hour. If the vehicle maximum speed is set to 50\nkm/hour, the routing engine will consider 60 km/hour as this is the current\nsituation. If the maximum speed of the vehicle is provided as 80 km/hour but\nthe current traffic flow is 60 km/hour, then routing engine will again use 60\nkm/hour.",
          "default": 0,
          "minimum": 0,
          "maximum": 250
        },
        "axleWeight": {
          "type": "integer",
          "format": "int64",
          "description": "Weight per axle of the vehicle in kg. A value of 0 means that weight\nrestrictions per axle are not considered.",
          "default": 0,
          "minimum": 0,
          "maximum": 1000000
        },
        "loadType": {
          "type": "array",
          "description": "Types of cargo that may be classified as hazardous materials and restricted\nfrom some roads. Available vehicleLoadType values are US Hazmat classes 1\nthrough 9, plus generic classifications for use in other countries. Values\nbeginning with USHazmat are for US routing while otherHazmat should be used for\nall other countries. vehicleLoadType supports multiple values in a request.",
          "items": {
            "$ref": "#/$defs/VehicleLoadTypeEnum"
          }
        },
        "adrTunnelRestrictionCode": {
          "$ref": "#/$defs/AdrTunnelRestrictionCodeEnum",
          "description": "The ADR tunnel restriction code. ADR is a European agreement concerning the\ninternational carriage of dangerous goods by road. The ADR tunnel restriction\ncode is used to determine whether a vehicle is allowed to pass through a tunnel\nwith restrictions on the carriage of dangerous goods."
        },
        "axleCount": {
          "type": "integer",
          "format": "int64",
          "description": "The number of axles on the vehicle."
        }
      }
    },
    "RouteOutputOptionEnum": {
      "type": "string",
      "description": "The desired route information from the response.",
      "enum": [
        "routeSummary",
        "routePath",
        "itinerary"
      ],
      "x-ms-enum": {
        "name": "RouteOutputOptionEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "routeSummary",
            "value": "routeSummary",
            "description": "Include only travel time and distance for the route, and do not provide other\ninformation."
          },
          {
            "name": "routePath",
            "value": "routePath",
            "description": "Include a GeoJSON MultiLineString [RFC 7946, section\n3.1.5](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.5) that describe the\nroute's path in the response."
          },
          {
            "name": "itinerary",
            "value": "itinerary",
            "description": "Include detailed directions in the response. Detailed directions are provided\nas \"ManeuverPoints\" and contain details such as turn-by-turn instructions."
          }
        ]
      }
    },
    "VehicleLoadTypeEnum": {
      "type": "string",
      "description": "Types of cargo that may be classified as hazardous materials and restricted from some roads.",
      "enum": [
        "USHazmatClass1",
        "USHazmatClass2",
        "USHazmatClass3",
        "USHazmatClass4",
        "USHazmatClass5",
        "USHazmatClass6",
        "USHazmatClass7",
        "USHazmatClass8",
        "USHazmatClass9",
        "otherHazmatExplosive",
        "otherHazmatGeneral",
        "otherHazmatHarmfulToWater"
      ],
      "x-ms-enum": {
        "name": "VehicleLoadTypeEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "USHazmatClass1",
            "value": "USHazmatClass1",
            "description": "Explosives"
          },
          {
            "name": "USHazmatClass2",
            "value": "USHazmatClass2",
            "description": "Compressed gas"
          },
          {
            "name": "USHazmatClass3",
            "value": "USHazmatClass3",
            "description": "Flammable liquids"
          },
          {
            "name": "USHazmatClass4",
            "value": "USHazmatClass4",
            "description": "Flammable solids"
          },
          {
            "name": "USHazmatClass5",
            "value": "USHazmatClass5",
            "description": "Oxidizers"
          },
          {
            "name": "USHazmatClass6",
            "value": "USHazmatClass6",
            "description": "Poisons"
          },
          {
            "name": "USHazmatClass7",
            "value": "USHazmatClass7",
            "description": "Radioactive"
          },
          {
            "name": "USHazmatClass8",
            "value": "USHazmatClass8",
            "description": "Corrosives"
          },
          {
            "name": "USHazmatClass9",
            "value": "USHazmatClass9",
            "description": "Miscellaneous"
          },
          {
            "name": "otherHazmatExplosive",
            "value": "otherHazmatExplosive",
            "description": "Explosives"
          },
          {
            "name": "otherHazmatGeneral",
            "value": "otherHazmatGeneral",
            "description": "Miscellaneous"
          },
          {
            "name": "otherHazmatHarmfulToWater",
            "value": "otherHazmatHarmfulToWater",
            "description": "Harmful to water"
          }
        ]
      }
    }
  }
}