> ## Documentation Index
> Fetch the complete documentation index at: https://maps.solvice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# /route/batch

> Process multiple route requests in a single API call. Each route in the batch is calculated independently, reducing API overhead for bulk operations.



## OpenAPI

````yaml POST /route/batch
openapi: 3.1.0
info:
  title: Solvice Maps Routing API
  description: >
    The Solvice Maps Routing API provides distance matrices, routes, and travel
    time calculations

    for logistics and route optimization applications. Supports multiple routing
    engines including

    OpenStreetMap and TomTom with time-dependent traffic data.
  version: 1.0.0
  contact:
    name: Solvice Support
    url: https://solvice.io
    email: support@solvice.io
servers:
  - url: https://routing.solvice.io
    description: Production server
security:
  - apikey: []
tags:
  - name: Tables
    description: Distance/duration matrix operations
  - name: Cubes
    description: Time-dependent 3D travel time matrices
  - name: Routes
    description: Point-to-point routing
  - name: Trips
    description: Traveling salesman / round-trip optimization
paths:
  /route/batch:
    post:
      tags:
        - Routes
      summary: Calculate batch routes
      description: >-
        Process multiple route requests in a single API call. Each route in the
        batch is calculated independently, reducing API overhead for bulk
        operations.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchRouteRequestDto'
        required: true
      responses:
        '200':
          description: >-
            Batch routes processed successfully. Batch processing is handled by
            the external routing service.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchRouteResponseDto'
        '400':
          description: Bad request - Invalid input parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests - Rate limit exceeded
          headers:
            X-RateLimit-Limit:
              description: The maximum number of requests allowed per time window
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: The number of requests remaining in the current time window
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                The time at which the current rate limit window resets in UTC
                epoch seconds
              schema:
                type: integer
            Retry-After:
              description: The number of seconds to wait before making another request
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Bad gateway - External service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service unavailable - External service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway timeout - Request timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BatchRouteRequestDto:
      description: Request DTO for batch route processing
      examples:
        - routes:
            - coordinates:
                - - 4.9
                  - 50.2
                - - 4.8
                  - 50.4
            - coordinates:
                - - 5.1
                  - 50.3
                - - 5
                  - 50.5
      type: object
      required:
        - routes
      properties:
        routes:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/CreateRouteDto'
          description: Array of route requests to process in batch
          maxItems: 20
          minItems: 2
    BatchRouteResponseDto:
      description: Response DTO for batch route processing
      type: object
      required:
        - results
        - successful
        - failed
        - total
      properties:
        results:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/BatchRouteItemResponseDto'
          description: Array of individual route results
        successful:
          type:
            - integer
            - 'null'
          format: int32
          description: Number of routes that processed successfully
        failed:
          type:
            - integer
            - 'null'
          format: int32
          description: Number of routes that failed to process
        total:
          type:
            - integer
            - 'null'
          format: int32
          description: Total number of routes in the batch
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        timestamp:
          type: integer
          format: int64
    CreateRouteDto:
      type: object
      description: Route Dto
      examples:
        - coordinates:
            - - 4.9
              - 50.2
            - - 4.8
              - 50.4
      required:
        - coordinates
      properties:
        coordinates:
          type:
            - array
            - 'null'
          items:
            type: array
            items:
              type: number
              format: double
          description: >-
            The coordinates this request will use, coordinates as [{lon},{lat}]
            values, in decimal degrees.
          minItems: 2
        bearings:
          type:
            - array
            - 'null'
          items:
            type: array
            items:
              type: integer
              format: int32
          description: >-
            Limits the search to segments with given bearing in degrees towards
            true north in clockwise direction. Can be null or an array of
            [{value},{range}] with integer 0 .. 360,integer 0 .. 180.
        radiuses:
          type:
            - array
            - 'null'
          items:
            type: integer
            format: int32
          description: >-
            Limits the coordinate snapping to streets in the given radius in
            meters. Can be null double >= 0.
        hints:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Hints for the coordinate snapping. Array of base64 encoded strings.
        generate_hints:
          type:
            - boolean
            - 'null'
          description: >-
            Whether or not adds a Hint to the response which can be used in
            subsequent requests. (optional, default true)
        alternatives:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Search for up to this many alternative routes. Please note that even
            if alternative routes are requested, a result cannot be guaranteed.
            (optional, default 0)
          maximum: 10
          minimum: 0
        steps:
          type:
            - boolean
            - 'null'
          description: Return route steps for each route leg. (optional, default false)
        annotations:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            An array with strings of duration, nodes, distance, weight,
            datasources, speed (optional)
        geometries:
          type:
            - string
            - 'null'
          description: >-
            Returned route geometry format (influences overview and per step).
            Can also be geojson. (optional, default polyline)
          pattern: polyline|geojson|polyline6
        overview:
          type:
            - string
            - 'null'
          description: >-
            Add overview geometry either full, simplified according to highest
            zoom level it could be display on, or not at all (false). (optional,
            default simplified)
          pattern: full|simplified|false
        continue_straight:
          type:
            - boolean
            - 'null'
          description: >-
            Forces the route to keep going straight at waypoints and don't do a
            uturn even if it would be faster. Default value depends on the
            profile.
        approaches:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Keep waypoints on curb side. Can be null (unrestricted, default) or
            curb.
        waypoints:
          type:
            - array
            - 'null'
          items:
            type: integer
            format: int32
          description: >-
            Indices to coordinates to treat as waypoints. If not supplied, all
            coordinates are waypoints. Must include first and last coordinate
            index
        snapping:
          type:
            - string
            - 'null'
          pattern: default|any
        vehicleType:
          description: The vehicle type for which the table is requested
          type:
            - string
            - 'null'
          anyOf:
            - $ref: '#/components/schemas/VehicleType'
            - type: 'null'
        routingEngine:
          description: The vehicle type for which the table is requested
          type:
            - string
            - 'null'
          anyOf:
            - $ref: '#/components/schemas/RoutingEngine'
            - type: 'null'
        departureTime:
          description: >-
            The departure time for which you want to calculate the route. This
            will take into account predictive travel time based on TomTom data.
          type:
            - string
            - 'null'
          examples:
            - '2024-03-15T08:30:00.000Z'
          anyOf:
            - $ref: '#/components/schemas/LocalDateTime'
            - type: 'null'
        interpolate:
          type:
            - boolean
            - 'null'
          description: >-
            Enable linear interpolation between time slices for more accurate
            results based on departure time
        exclude:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/RoadTypeExclude'
          description: Exclude certain road types from routing
        slice:
          type:
            - number
            - 'null'
          format: double
          description: >-
            Time slice override for routing. Can be decimal for interpolation
            (e.g., 2.5 for halfway between slice 2 and 3). If not specified,
            slice will be determined from departure time.
    BatchRouteItemResponseDto:
      description: Individual route result within a batch response
      type: object
      required:
        - index
      properties:
        index:
          type:
            - integer
            - 'null'
          format: int32
          description: Index of this route in the original batch request
        result:
          description: Route response if processing was successful
          type: object
          anyOf:
            - $ref: '#/components/schemas/RouteDto'
            - type: 'null'
        error:
          description: Error details if processing failed
          type:
            - object
            - 'null'
          anyOf:
            - $ref: '#/components/schemas/BatchRouteErrorDto'
            - type: 'null'
    VehicleType:
      type: string
      enum:
        - CAR
        - BIKE
        - TRUCK
        - ELECTRIC_CAR
        - ELECTRIC_BIKE
    RoutingEngine:
      type: string
      description: >
        Routing data engine used to calculate distances/durations.


        - `OSM`: Open Street Map, traffic-unaware (default).

        - `TOMTOM`: TomTom map data with predictive traffic patterns. Use with
        `departureTime` and optionally `interpolate`.

        - `TOMTOM_REAL_TIME`: TomTom map data with **real-time traffic**. The
        `departureTime` field is ignored — every request uses the current time.
        Available on `POST /route` and `POST /table/sync` only (not on async
        `/table` or `/route/batch`).

        - `GOOGLE`: Google routing data (contact sales).

        - `ANYMAP`: Solvice's proprietary engine with advanced traffic modeling.

        - `CUSTOM`: Bring-your-own engine via custom integration.
      enum:
        - OSM
        - TOMTOM
        - GOOGLE
        - ANYMAP
        - CUSTOM
        - TOMTOM_REAL_TIME
    LocalDateTime:
      type: string
      format: date-time
    RoadTypeExclude:
      type: string
      enum:
        - TOLL
        - MOTORWAY
        - FERRY
        - TUNNEL
        - BRIDGE
    RouteDto:
      type: object
      description: Route response
      examples:
        - routes:
            - geometry: >-
                {wkqHi~{\tLb\uEvH{mA{`@{~Bnr@gSwKkQsp@iDkjBsn@uS}rAtr@ccBt}AuhBxEal@_Ow}AblCqfA~a@mn@{A_Vz~@w|@x{@{PmP{CikA}Sg|@ec@ve@y[xzEyGbLmLmJolA~yCwaB|_B
              legs:
                - steps: []
                  summary: ''
                  weight: 1976.1
                  duration: 1976.1
                  distance: 31561.2
              weight_name: routability
              weight: 1976.1
              duration: 1976.1
              distance: 31561.2
          waypoints:
            - hint: >-
                eX5AgduYjYYsAAAAlAAAAHIAAAAAAAAAxBf6QX7HzELIz51CAAAAACwAAACUAAAAcgAAAAAAAAAVtwAAlMNKAIj__QKgxEoAwP39AgEAXwRPrDVe
              distance: 54.20808645369059
              name: Avenue de la Restauration
              location:
                - 4.899732
                - 50.200456
            - hint: >-
                o_v2gPMxk4KXAAAAQwAAAJsAAADWAwAA4YOXQ0HtBEOh05pDGnn1RJcAAABDAAAAmwAAANYDAAAVtwAAEyhJAG0BAQMAPkkAAAsBAwMAXxRPrDVe
              distance: 483.4921257061384
              name: Route des Trois Communes
              location:
                - 4.794387
                - 50.397549
      properties:
        routes:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Route'
          description: Represents a route through (potentially multiple) waypoints.
        waypoints:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Waypoint'
          description: List of waypoints to get from A to B.
    BatchRouteErrorDto:
      description: Error details for a failed route in a batch request
      type: object
      required:
        - message
        - code
      properties:
        message:
          type:
            - string
            - 'null'
          description: Error message describing what went wrong
        code:
          type:
            - string
            - 'null'
          description: Error code identifying the type of error
    Route:
      type: object
      properties:
        distance:
          type:
            - number
            - 'null'
          format: double
          description: The distance traveled by the route, in `float` meters.
        duration:
          type:
            - number
            - 'null'
          format: double
          description: The estimated travel time, in `float` number of seconds.
        geometry:
          type:
            - string
            - 'null'
          description: >-
            The whole geometry of the route value depending on overview
            parameter, format depending on the geometries parameter. See
            RouteStep's geometry field for a parameter documentation.
        legs:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/RouteLeg'
          description: Represents a route between two waypoints.
    Waypoint:
      type: object
      properties:
        hint:
          type:
            - string
            - 'null'
          description: >-
            Unique internal identifier of the segment (ephemeral, not constant
            over data updates) This can be used on subsequent request to
            significantly speed up the query and to connect multiple services.
        distance:
          type:
            - number
            - 'null'
          format: double
          description: The distance of the snapped point from the original
        name:
          type:
            - string
            - 'null'
          description: Name of the street the coordinate snapped to
        location:
          type:
            - array
            - 'null'
          items:
            type: number
            format: double
          description: >-
            Array that contains the [longitude, latitude] pair of the snapped
            coordinate
    RouteLeg:
      type: object
      properties:
        summary:
          type:
            - string
            - 'null'
        distance:
          type:
            - number
            - 'null'
          format: double
          description: The distance traveled by the route, in `float` meters.
        duration:
          type:
            - number
            - 'null'
          format: double
          description: The estimated travel time, in `float` number of seconds.
        weight:
          type:
            - number
            - 'null'
          format: double
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````