{
  "openapi": "3.1.0",
  "info": {
    "title": "AutoMapa API v3",
    "version": "3.0-public",
    "description": "AutoMapa REST API v3 uses JSON. Successful responses contain result; errors contain message. Available operations and response fields may depend on your API access. See each operation for its request and response format."
  },
  "servers": [
    {
      "url": "https://api.automapa.com",
      "description": "AutoMapa public API"
    }
  ],
  "security": [
    {
      "SessionId": []
    }
  ],
  "tags": [
    {
      "name": "Session",
      "description": "Create the short-lived session used by protected operations."
    },
    {
      "name": "PingPong",
      "description": "Authenticated connectivity check."
    },
    {
      "name": "Geocoder",
      "description": "Forward and reverse geocoding."
    },
    {
      "name": "Autocomplete",
      "description": "Address and point-of-interest suggestions."
    },
    {
      "name": "Routes",
      "description": "Routes, matrices, and stop-order optimization."
    },
    {
      "name": "Road",
      "description": "Road-segment and speed-limit information."
    },
    {
      "name": "RoadPermit",
      "description": "Road-permit document management for configured clients."
    },
    {
      "name": "Speed",
      "description": "Asynchronous speed-violation reports."
    }
  ],
  "paths": {
    "/v3/Session/getSalt": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Get authentication salt",
        "description": "Creates a one-minute authentication salt for an active access key.",
        "operationId": "sessionGetSalt",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetSaltRequest"
              },
              "example": {
                "key": "<access-key>"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Salt created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSaltResponse"
                },
                "example": {
                  "result": {
                    "salt": "aB3dE5gH7j"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Session/generateSession": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Generate a session",
        "description": "Exchanges an access key and `MD5(MD5(password) + salt)` for a session identifier. The session is valid for 10 minutes.",
        "operationId": "sessionGenerateSession",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSessionRequest"
              },
              "example": {
                "key": "<access-key>",
                "pass": "<password-digest>"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateSessionResponse"
                },
                "example": {
                  "result": {
                    "sessionId": "Q7rT2vX9pL"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/PingPong/ping": {
      "post": {
        "tags": [
          "PingPong"
        ],
        "summary": "Check authenticated connectivity",
        "operationId": "pingPongPing",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PingRequest"
              },
              "example": {
                "msg": "ping"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connectivity confirmed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResponse"
                },
                "example": {
                  "result": {
                    "msg": "pong"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "description": "Requires the Session-Id header. Send \"ping\" to receive \"pong\".",
        "security": [
          {
            "SessionId": []
          }
        ]
      }
    },
    "/v3/Geocoder/geocode": {
      "post": {
        "tags": [
          "Geocoder"
        ],
        "summary": "Geocode one structured address",
        "description": "Convert one structured address with a required city to coordinates and matching address details.",
        "operationId": "geocoderGeocode",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeocodeRequest"
              },
              "example": {
                "address": {
                  "country": "PL",
                  "city": "Warszawa",
                  "street": "Domaniewska",
                  "house": "37"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The example shows selected response fields. Actual coordinates and postal-code data depend on the input and current map data; entitlement-dependent extended fields may also be present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeocodeResponse"
                },
                "example": {
                  "result": [
                    {
                      "quality": 9,
                      "x": 21.0071318,
                      "y": 52.18284,
                      "country": "PL",
                      "city": "Warszawa",
                      "pcode": "02-672",
                      "street": "Domaniewska",
                      "house": "37",
                      "resultRadius": 0
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Geocoder/geocodemulti": {
      "post": {
        "tags": [
          "Geocoder"
        ],
        "summary": "Geocode up to 100 addresses",
        "description": "Geocode up to 100 structured addresses in one request. Each address requires city; results follow input order.",
        "operationId": "geocoderGeocodeMulti",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeocodeMultiRequest"
              },
              "example": {
                "addresses": [
                  {
                    "country": "PL",
                    "city": "Warszawa",
                    "street": "Domaniewska",
                    "house": "37"
                  },
                  {
                    "country": "PL",
                    "city": "Rumia",
                    "street": "Grunwaldzka",
                    "house": "2"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The example shows a batch response whose result entries preserve request order. Actual coordinates and postal-code data depend on each input address and current map data; each address can return a different number of matches up to maxResult.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeocodeMultiResponse"
                },
                "example": {
                  "result": [
                    [
                      {
                        "quality": 9,
                        "x": 21.0071318,
                        "y": 52.18284,
                        "country": "PL",
                        "city": "Warszawa",
                        "street": "Domaniewska",
                        "house": "37"
                      }
                    ],
                    [
                      {
                        "quality": 9,
                        "x": 18.3865894,
                        "y": 54.57206,
                        "country": "PL",
                        "city": "Rumia",
                        "street": "Grunwaldzka",
                        "house": "2"
                      }
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Geocoder/revgeocode": {
      "post": {
        "tags": [
          "Geocoder"
        ],
        "summary": "Reverse-geocode one point",
        "description": "The point is `[longitude, latitude]`. Availability outside Poland depends on the customer's entitlement. Poland-only `params` are not accepted by the external provider path.",
        "operationId": "geocoderReverseGeocode",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReverseGeocodeRequest"
              },
              "example": {
                "point": [
                  21.0065983,
                  52.1832837
                ],
                "params": {
                  "snapToBld": true,
                  "snapToBldRadius": 50
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Nearest address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReverseGeocodeResponse"
                },
                "example": {
                  "result": {
                    "country": "PL",
                    "province": "mazowieckie",
                    "district": "Warszawa",
                    "community": "Warszawa",
                    "city": "Warszawa",
                    "quarter": "Mokotów",
                    "pcode": "02-672",
                    "street": "Domaniewska",
                    "house": "37p"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Geocoder/revgeocodemulti": {
      "post": {
        "tags": [
          "Geocoder"
        ],
        "summary": "Reverse-geocode up to 100 points",
        "description": "The required `params` object may be empty. The response preserves input order and can contain item-level errors.",
        "operationId": "geocoderReverseGeocodeMulti",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReverseGeocodeMultiRequest"
              },
              "example": {
                "points": [
                  [
                    21.0065983,
                    52.1832837
                  ],
                  [
                    27.5434388,
                    53.9014812
                  ]
                ],
                "params": {
                  "snapToBld": true,
                  "snapToBldRadius": 50
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ordered reverse-geocoding results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReverseGeocodeMultiResponse"
                },
                "example": {
                  "result": [
                    {
                      "country": "PL",
                      "province": "mazowieckie",
                      "city": "Warszawa",
                      "street": "Domaniewska",
                      "house": "37p"
                    },
                    {
                      "status": "ERROR",
                      "message": "No data"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Autocomplete/search": {
      "post": {
        "tags": [
          "Autocomplete"
        ],
        "summary": "Search places and POIs",
        "description": "Searches Polish places and points of interest. If present, `types` must be a non-empty subset of `place` and `poi`.",
        "operationId": "autocompleteSearch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutocompleteSearchRequest"
              },
              "example": {
                "query": "Warszawa Domaniewska 37",
                "types": [
                  "place",
                  "poi"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching suggestions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutocompleteSearchResponse"
                },
                "example": {
                  "result": {
                    "items": [
                      {
                        "type": "place",
                        "subtype": "building",
                        "name": "Domaniewska 37, 02-672 Warszawa",
                        "province": "mazowieckie",
                        "place": "Warszawa",
                        "quarter": "Mokotów",
                        "street": "Domaniewska",
                        "number": "37",
                        "postal_code": "02-672",
                        "coords": {
                          "x": 21.0071318,
                          "y": 52.18284
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Autocomplete/searchAddress": {
      "post": {
        "tags": [
          "Autocomplete"
        ],
        "summary": "Suggest structured address fields",
        "description": "All four query keys are required, although their values may be empty. At least one value must be non-empty. `limit` defaults to 10.",
        "operationId": "autocompleteSearchAddress",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutocompleteAddressRequest"
              },
              "example": {
                "query": {
                  "city": "Warszawa",
                  "street": "Dom",
                  "number": "",
                  "zipcode": "02-672"
                },
                "source": "street",
                "selected": [
                  "city",
                  "zipcode"
                ],
                "limit": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Address-field suggestions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutocompleteAddressResponse"
                },
                "example": {
                  "result": {
                    "items": [
                      {
                        "city": "Warszawa",
                        "street": "Domaniewska",
                        "zipcode": "02-672",
                        "count": 1
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Routes/route": {
      "post": {
        "tags": [
          "Routes"
        ],
        "summary": "Calculate a route",
        "description": "Calculates a route through at least two ordered points. `route` and `object` are optional and use server defaults. Routing outside Poland depends on customer entitlement.",
        "operationId": "routesRoute",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteRequest"
              },
              "example": {
                "points": [
                  [
                    20.6350676,
                    52.1044404
                  ],
                  [
                    21.0230905,
                    52.2318032
                  ]
                ],
                "route": {
                  "start": "NOW",
                  "type": "optimal",
                  "traffic": true,
                  "desc": true
                },
                "object": {
                  "type": "car"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculated route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteResponse"
                },
                "example": {
                  "result": {
                    "length": 37640,
                    "eta": 60,
                    "routePoints": [
                      [
                        20.6350445,
                        52.1044257
                      ],
                      [
                        21.0228726,
                        52.2318902
                      ]
                    ],
                    "desc": [
                      {
                        "location": "Warszawa",
                        "road": "",
                        "roadType": "internal",
                        "distance": 22,
                        "eta": 60,
                        "routePoint": [
                          21.022875,
                          52.2318984
                        ]
                      }
                    ],
                    "mapurl": "https://mapa.targeo.pl/trasa_api,example"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Routes/matrix": {
      "post": {
        "tags": [
          "Routes"
        ],
        "summary": "Calculate a distance matrix",
        "description": "Calculates pairs for 4–10 Polish points under the standard public limit. `simple=true` returns each unordered pair once; otherwise both directions are returned. Separately contracted clients may have different point limits.",
        "operationId": "routesMatrix",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixRequest"
              },
              "example": {
                "points": [
                  [
                    20.5334473,
                    53.7373403
                  ],
                  [
                    17.0178223,
                    52.3370173
                  ],
                  [
                    16.9299316,
                    51.0603863
                  ],
                  [
                    20.8355713,
                    52.1958233
                  ]
                ],
                "type": 1,
                "precise": false,
                "simple": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Distance-matrix rows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixResponse"
                },
                "example": {
                  "result": [
                    {
                      "length": 482244,
                      "duration": 229,
                      "points": "0-1"
                    },
                    {
                      "length": 224693,
                      "duration": 141,
                      "points": "0-3"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Routes/optimize": {
      "post": {
        "tags": [
          "Routes"
        ],
        "summary": "Optimize stop order synchronously",
        "description": "Reorders 3–10 points. The first point is fixed; the last point is fixed by default. Routing outside Poland depends on customer entitlement.",
        "operationId": "routesOptimize",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptimizeRequest"
              },
              "example": {
                "points": [
                  [
                    15.1138007,
                    53.8820782
                  ],
                  [
                    17.5527656,
                    51.3344674
                  ],
                  [
                    20.9365546,
                    54.2431568
                  ]
                ],
                "type": 1,
                "fixedEnd": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Optimized point order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptimizeResponse"
                },
                "example": {
                  "result": {
                    "order": "0,1,2",
                    "points": [
                      [
                        15.1138007,
                        53.8820782
                      ],
                      [
                        17.5527656,
                        51.3344674
                      ],
                      [
                        20.9365546,
                        54.2431568
                      ]
                    ],
                    "sections": [
                      {
                        "x": 15.1138007,
                        "y": 53.8820782,
                        "eta": 0,
                        "dist": 0
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Routes/optimizeQueue": {
      "post": {
        "tags": [
          "Routes"
        ],
        "summary": "Queue stop-order optimization",
        "description": "Submit 3–50 points for asynchronous stop-order optimization. Use requestId to retrieve the result.",
        "operationId": "routesOptimizeQueue",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptimizeQueueRequest"
              },
              "example": {
                "points": [
                  {
                    "id": "Warszawa",
                    "x": 21.0020722,
                    "y": 52.2278077
                  },
                  {
                    "id": "Krakow",
                    "x": 19.9277367,
                    "y": 50.0548261
                  },
                  {
                    "id": "Gdansk",
                    "x": 18.6453959,
                    "y": 54.3471121
                  }
                ],
                "optimizeBy": "time",
                "route": {
                  "start": "NOW"
                },
                "object": {
                  "type": "car"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Queued or immediately completed optimization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptimizeQueueResponse"
                },
                "example": {
                  "result": {
                    "requestId": "reef1.example.request"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Routes/optimizeQueueResult": {
      "post": {
        "tags": [
          "Routes"
        ],
        "summary": "Read queued optimization result",
        "description": "Check an optimization request and retrieve the ordered point IDs when ready.",
        "operationId": "routesOptimizeQueueResult",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptimizeQueueResultRequest"
              },
              "example": {
                "requestId": "reef1.example.request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current optimization status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptimizeQueueResultResponse"
                },
                "example": {
                  "result": {
                    "resultReady": true,
                    "optimizedSequence": [
                      "Warszawa",
                      "Gdansk",
                      "Krakow"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Road/getSegmentInfo": {
      "post": {
        "tags": [
          "Road"
        ],
        "summary": "Get nearest road-segment information",
        "description": "Returns normalized fields from the nearest road segment. `dir` accepts -2 through 359.",
        "operationId": "roadGetSegmentInfo",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentInfoRequest"
              },
              "example": {
                "x": 21.00736,
                "y": 52.18288,
                "distLimit": 50
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Nearest segment information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentInfoResponse"
                },
                "example": {
                  "result": {
                    "attractedX": 21.0070737,
                    "attractedY": 52.18288,
                    "pureDistance": 10,
                    "segment": {
                      "category": 3,
                      "country": 31,
                      "dir": 0,
                      "id": 37530,
                      "isFerry": -1,
                      "isHighway": -1,
                      "isToll": -1,
                      "length": 55,
                      "placeName": "Warszawa",
                      "speedLimit": 50,
                      "streetName": "Domaniewska",
                      "urbanArea": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Road/speedCheck": {
      "post": {
        "tags": [
          "Road"
        ],
        "summary": "Get speed limits at one point",
        "description": "Returns car and truck speed limits at the nearest segment. `-1` means no data and `0` means unrestricted.",
        "operationId": "roadSpeedCheck",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeedCheckRequest"
              },
              "example": {
                "x": 15.2154636,
                "y": 52.3118895,
                "dir": 350
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Speed-limit information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeedCheckResponse"
                },
                "example": {
                  "result": {
                    "speedLimit": 140,
                    "speedLimitTruck": 80,
                    "urbanArea": false,
                    "x": 15.2154624,
                    "y": 52.31186,
                    "distance": 1
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Road/speedCheckMulti": {
      "post": {
        "tags": [
          "Road"
        ],
        "summary": "Get speed limits for up to 100 points",
        "description": "Batch version of `speedCheck`; response order matches request order.",
        "operationId": "roadSpeedCheckMulti",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeedCheckMultiRequest"
              },
              "example": {
                "points": [
                  {
                    "x": 15.2154636,
                    "y": 52.3118895,
                    "dir": 350
                  },
                  {
                    "x": 13.8412285,
                    "y": 52.3111549
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ordered speed-limit results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeedCheckMultiResponse"
                },
                "example": {
                  "result": [
                    {
                      "speedLimit": 140,
                      "speedLimitTruck": 80,
                      "urbanArea": false,
                      "x": 15.2154624,
                      "y": 52.31186,
                      "distance": 1
                    },
                    {
                      "speedLimit": 0,
                      "speedLimitTruck": -1,
                      "urbanArea": false,
                      "x": 13.8412231,
                      "y": 52.31114,
                      "distance": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/RoadPermit/add": {
      "post": {
        "tags": [
          "RoadPermit"
        ],
        "summary": "Add a road-permit document",
        "description": "Creates a document for a configured client. The server generates a 12-character hexadecimal identifier. `environment` is preferred; legacy `enviroment` remains accepted. If both are supplied, they must match.",
        "operationId": "roadPermitAdd",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoadPermitWriteRequest"
              },
              "example": {
                "environment": "uat",
                "date_start": "2026-05-01",
                "date_end": "2026-12-31",
                "description": "Temporary heavy-vehicle restriction.",
                "document_name": "example-permit",
                "location": "Tarnów",
                "permissions": {
                  "tr_tonnage": 24,
                  "tr_tonn_axis": 8.5
                },
                "poly": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        20.9931,
                        50.0106
                      ],
                      [
                        20.9944,
                        50.0108
                      ],
                      [
                        20.9941,
                        50.0115
                      ],
                      [
                        20.9931,
                        50.0106
                      ]
                    ]
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Document created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoadPermitIdResponse"
                },
                "example": {
                  "result": {
                    "id": "60a79ba2c3d4"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/RoadPermit/overwrite": {
      "post": {
        "tags": [
          "RoadPermit"
        ],
        "summary": "Overwrite a road-permit document",
        "description": "Replaces the complete document identified by `id`. Omitted optional fields are removed or reset to their defaults.",
        "operationId": "roadPermitOverwrite",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoadPermitOverwriteRequest"
              },
              "example": {
                "id": "60a79ba2c3d4",
                "environment": "uat",
                "date_end": "2027-01-31",
                "document_name": "example-permit",
                "permissions": {
                  "tr_tonnage": 26
                },
                "poly": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      [
                        20.9931,
                        50.0106
                      ],
                      [
                        20.9945,
                        50.0108
                      ],
                      [
                        20.9942,
                        50.0116
                      ],
                      [
                        20.9931,
                        50.0106
                      ]
                    ]
                  ]
                },
                "is_valid_after_expiry": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Document overwritten.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoadPermitIdResponse"
                },
                "example": {
                  "result": {
                    "id": "60a79ba2c3d4"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/RoadPermit/remove": {
      "post": {
        "tags": [
          "RoadPermit"
        ],
        "summary": "Remove a road-permit document",
        "operationId": "roadPermitRemove",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoadPermitRemoveRequest"
              },
              "example": {
                "id": "60a79ba2c3d4",
                "environment": "uat"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Document removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoadPermitRemoveResponse"
                },
                "example": {
                  "result": {
                    "id": "60a79ba2c3d4",
                    "deleted": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/RoadPermit/list": {
      "post": {
        "tags": [
          "RoadPermit"
        ],
        "summary": "List road-permit documents",
        "description": "Filters by `id` and/or `document_name`. With neither filter, returns all documents available in the client's selected environment, sorted by `document_name` and then `id`.",
        "operationId": "roadPermitList",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoadPermitListRequest"
              },
              "example": {
                "document_name": "example-permit",
                "environment": "uat"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching documents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoadPermitListResponse"
                },
                "example": {
                  "result": [
                    {
                      "id": "60a79ba2c3d4",
                      "date_start": "2026-05-01",
                      "date_end": "2026-12-31",
                      "description": "Temporary heavy-vehicle restriction.",
                      "document_name": "example-permit",
                      "location": "Tarnów",
                      "permissions": {
                        "tr_tonnage": 24,
                        "tr_tonn_axis": 8.5
                      },
                      "poly": {
                        "type": "Polygon",
                        "coordinates": [
                          [
                            [
                              20.9931,
                              50.0106
                            ],
                            [
                              20.9944,
                              50.0108
                            ],
                            [
                              20.9941,
                              50.0115
                            ],
                            [
                              20.9931,
                              50.0106
                            ]
                          ]
                        ]
                      },
                      "is_valid_after_expiry": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Speed/speedReport": {
      "post": {
        "tags": [
          "Speed"
        ],
        "summary": "Submit a GPS trace for speed analysis",
        "description": "Queues a trace of at least two points. The time span between the earliest and latest sample must not exceed 24 hours.",
        "operationId": "speedSubmitReport",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeedReportRequest"
              },
              "example": {
                "objID": "vehicle-09",
                "objName": "Vehicle 09",
                "objGroup": "fleet-A",
                "points": [
                  {
                    "x": 21.001,
                    "y": 52.227,
                    "t": 1747349800
                  },
                  {
                    "x": 21.005,
                    "y": 52.229,
                    "t": 1747349830
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Trace queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeedReportResponse"
                },
                "example": {
                  "result": {
                    "requestID": "speed-report-example-id",
                    "objID": "vehicle-09"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v3/Speed/speedReportResult": {
      "post": {
        "tags": [
          "Speed"
        ],
        "summary": "Read a speed-analysis report",
        "description": "Returns progress while the report is pending, or the completed report. `limit` is required and filters out offenses whose severity bucket is lower than the supplied value.",
        "operationId": "speedGetReportResult",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeedReportResultRequest"
              },
              "example": {
                "requestID": "speed-report-example-id",
                "limit": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current report state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeedReportResultResponse"
                },
                "example": {
                  "result": {
                    "requestID": "speed-report-example-id",
                    "progress": 1,
                    "reportURL": "https://apps.targeo.pl/speedreport/speedmap.html?id=speed-report-example-id",
                    "overspeedingArray": [
                      {
                        "duration": 47,
                        "length": 1280,
                        "type": 3,
                        "speedMax": 78.4,
                        "speedAvg": 71.2,
                        "urbanArea": true,
                        "startLocation": "Warszawa",
                        "endLocation": "Warszawa",
                        "startPoint": {
                          "x": 21.001,
                          "y": 52.227
                        },
                        "endPoint": {
                          "x": 21.005,
                          "y": 52.229
                        },
                        "startTime": 1747349800,
                        "endTime": 1747349830,
                        "speedLimit": 50
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "SessionId": {
        "type": "apiKey",
        "in": "header",
        "name": "Session-Id",
        "description": "Session identifier returned by `/v3/Session/generateSession`; valid for 10 minutes. Access is additionally checked per class and method."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed JSON contract, missing parameter, invalid value, or rejected request data.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "message": "Params missing: points"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication data or an entitlement-dependent upstream authorization failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "message": "ERROR_BAD_AUTH_DATA"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Session missing or invalid, permission missing, client blocked, or requested geographic capability unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "message": "Forbidden - no permission"
            }
          }
        }
      },
      "NotFound": {
        "description": "Requested key, method, resource, or document was not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "message": "Road permit not found"
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "The operation only accepts POST.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "message": "GET is not accepted HTTP method for this action"
            }
          }
        }
      },
      "InternalError": {
        "description": "The operation failed internally.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "message": "Something went wrong"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "A required API dependency or service is temporarily unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "message": "Unknown error"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "GetSaltRequest": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "description": "Customer access key."
          }
        },
        "additionalProperties": true
      },
      "GetSaltResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "salt"
            ],
            "properties": {
              "salt": {
                "type": "string",
                "minLength": 10,
                "maxLength": 10
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "GenerateSessionRequest": {
        "type": "object",
        "required": [
          "key",
          "pass"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "pass": {
            "type": "string",
            "minLength": 1,
            "description": "MD5(MD5(password) + salt). The inner MD5 is lowercase hexadecimal text, not binary bytes; + means text concatenation. Never send the plain-text password."
          }
        },
        "additionalProperties": true
      },
      "GenerateSessionResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "sessionId"
            ],
            "properties": {
              "sessionId": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "PingRequest": {
        "type": "object",
        "required": [
          "msg"
        ],
        "properties": {
          "msg": {
            "type": "string",
            "const": "ping"
          }
        },
        "additionalProperties": true
      },
      "PingResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "msg"
            ],
            "properties": {
              "msg": {
                "type": "string",
                "const": "pong"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "Coordinate": {
        "type": "array",
        "description": "WGS84 `[longitude, latitude]` pair.",
        "items": {
          "type": "number"
        },
        "minItems": 2,
        "maxItems": 2
      },
      "PointObject": {
        "type": "object",
        "required": [
          "x",
          "y"
        ],
        "properties": {
          "x": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "y": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          }
        },
        "additionalProperties": false
      },
      "Address": {
        "type": "object",
        "description": "Provide an address object with city. Other fields are optional; include enough detail to find a match.",
        "required": [
          "city"
        ],
        "properties": {
          "country": {
            "type": [
              "string",
              "null"
            ],
            "default": "PL",
            "description": "Optional country code. Omitted or null defaults to PL; an empty value remains empty. Use uppercase PL for Polish addresses. International geocoding requires access to international coverage."
          },
          "province": {
            "type": "string",
            "description": "Optional province name; no value is filled in automatically."
          },
          "district": {
            "type": [
              "string",
              "null"
            ],
            "default": "",
            "description": "Optional. Missing or null defaults to an empty string."
          },
          "community": {
            "type": [
              "string",
              "null"
            ],
            "default": "",
            "description": "Optional. Missing or null defaults to an empty string."
          },
          "city": {
            "type": "string",
            "description": "Required city name for every address, including PL."
          },
          "quarter": {
            "type": [
              "string",
              "null"
            ],
            "default": "",
            "description": "Optional. Missing or null defaults to an empty string."
          },
          "pcode": {
            "type": [
              "string",
              "null"
            ],
            "default": "",
            "description": "Optional. Missing or null defaults to an empty string."
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "default": "",
            "description": "Optional. Missing or null defaults to an empty string."
          },
          "house": {
            "type": [
              "string",
              "null"
            ],
            "default": "",
            "description": "Optional. Missing or null defaults to an empty string."
          },
          "maxResult": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3,
            "default": 1,
            "description": "For PL addresses, maximum matches per address: 1–3 (default 1). Values outside this range are limited to 1–3. Set maxResult in each address; maxResults does not set this limit."
          }
        },
        "additionalProperties": true
      },
      "GeocodeResult": {
        "type": "object",
        "properties": {
          "quality": {
            "type": "integer"
          },
          "x": {
            "type": [
              "number",
              "null"
            ]
          },
          "y": {
            "type": [
              "number",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "province": {
            "type": [
              "string",
              "null"
            ]
          },
          "district": {
            "type": [
              "string",
              "null"
            ]
          },
          "community": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "quarter": {
            "type": [
              "string",
              "null"
            ]
          },
          "pcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "street": {
            "type": [
              "string",
              "null"
            ]
          },
          "house": {
            "type": [
              "string",
              "null"
            ]
          },
          "flat": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultRadius": {
            "type": "number",
            "minimum": -1,
            "description": "Result envelope radius in metres; -1 means unknown."
          },
          "mapLink": {
            "type": "string",
            "format": "uri"
          },
          "addressType": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Entitlement-dependent extended field."
          },
          "peoplesForAddress": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Entitlement-dependent extended field."
          },
          "flatsForAddress": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Entitlement-dependent extended field."
          },
          "buildingsForAddress": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Entitlement-dependent extended field."
          },
          "pcodeExtraInfo": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object"
            },
            "description": "Entitlement-dependent extended field; item keys are not specified by this public contract."
          }
        },
        "additionalProperties": true
      },
      "BatchItemError": {
        "type": "object",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "ERROR"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "GeocodeRequest": {
        "type": "object",
        "required": [
          "address"
        ],
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          }
        },
        "additionalProperties": true
      },
      "GeocodeResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GeocodeResult"
            }
          }
        },
        "additionalProperties": false
      },
      "GeocodeMultiRequest": {
        "type": "object",
        "required": [
          "addresses"
        ],
        "properties": {
          "addresses": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Address"
            }
          }
        },
        "additionalProperties": true
      },
      "GeocodeMultiResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GeocodeResult"
                  }
                },
                {
                  "$ref": "#/components/schemas/BatchItemError"
                }
              ]
            }
          }
        },
        "additionalProperties": false
      },
      "ReverseGeocodeOptions": {
        "type": "object",
        "properties": {
          "snapToBld": {
            "type": "boolean"
          },
          "snapToBldRadius": {
            "type": "integer",
            "minimum": 1,
            "description": "Building snap radius in metres when `snapToBld` is true."
          },
          "getPostalCode": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "ReverseAddress": {
        "type": "object",
        "properties": {
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "province": {
            "type": [
              "string",
              "null"
            ]
          },
          "district": {
            "type": [
              "string",
              "null"
            ]
          },
          "community": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "quarter": {
            "type": [
              "string",
              "null"
            ]
          },
          "pcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "street": {
            "type": [
              "string",
              "null"
            ]
          },
          "house": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "ReverseGeocodeRequest": {
        "type": "object",
        "required": [
          "point"
        ],
        "properties": {
          "point": {
            "$ref": "#/components/schemas/Coordinate"
          },
          "params": {
            "$ref": "#/components/schemas/ReverseGeocodeOptions"
          }
        },
        "additionalProperties": true
      },
      "ReverseGeocodeResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/ReverseAddress"
          }
        },
        "additionalProperties": false
      },
      "ReverseGeocodeMultiRequest": {
        "type": "object",
        "required": [
          "points",
          "params"
        ],
        "properties": {
          "points": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Coordinate"
            }
          },
          "params": {
            "$ref": "#/components/schemas/ReverseGeocodeOptions"
          }
        },
        "additionalProperties": true
      },
      "ReverseGeocodeMultiResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ReverseAddress"
                },
                {
                  "$ref": "#/components/schemas/BatchItemError"
                }
              ]
            }
          }
        },
        "additionalProperties": false
      },
      "AutocompleteSearchRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1
          },
          "types": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "place",
                "poi"
              ]
            }
          }
        },
        "additionalProperties": true
      },
      "AutocompleteItem": {
        "type": "object",
        "required": [
          "type",
          "subtype",
          "name",
          "coords"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "place",
              "poi"
            ]
          },
          "subtype": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "province": {
            "type": "string"
          },
          "district": {
            "type": "string"
          },
          "community": {
            "type": "string"
          },
          "place": {
            "type": "string"
          },
          "quarter": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "coords": {
            "$ref": "#/components/schemas/PointObject"
          }
        },
        "additionalProperties": false
      },
      "AutocompleteSearchResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "items"
            ],
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AutocompleteItem"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "AutocompleteAddressQuery": {
        "type": "object",
        "required": [
          "city",
          "street",
          "number",
          "zipcode"
        ],
        "properties": {
          "city": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "zipcode": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "AutocompleteAddressRequest": {
        "type": "object",
        "required": [
          "query",
          "source"
        ],
        "properties": {
          "query": {
            "$ref": "#/components/schemas/AutocompleteAddressQuery"
          },
          "source": {
            "type": "string",
            "enum": [
              "city",
              "street",
              "number",
              "zipcode"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "default": 10
          },
          "selected": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "city",
                "street",
                "number",
                "zipcode"
              ]
            }
          }
        },
        "additionalProperties": true
      },
      "AutocompleteAddressItem": {
        "type": "object",
        "properties": {
          "city": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "zipcode": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 1
          },
          "coords": {
            "$ref": "#/components/schemas/PointObject"
          }
        },
        "additionalProperties": false
      },
      "AutocompleteAddressResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "items"
            ],
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AutocompleteAddressItem"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "RouteOptions": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "description": "`NOW` or a date/time accepted by the server.",
            "default": "NOW"
          },
          "type": {
            "type": "string",
            "enum": [
              "quick",
              "short",
              "optimal"
            ],
            "default": "optimal"
          },
          "traffic": {
            "type": "boolean",
            "default": true
          },
          "desc": {
            "type": "boolean",
            "default": false
          },
          "onlyLengthAndETA": {
            "type": "boolean",
            "default": false
          },
          "avoidTolls": {
            "type": "boolean"
          },
          "avoidFerries": {
            "type": "boolean"
          },
          "avoidHighways": {
            "type": "boolean"
          },
          "calculateTolls": {
            "type": "boolean",
            "default": false
          },
          "vehicleCatForEToll": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5,
            "description": "Required when `calculateTolls` is true."
          }
        },
        "additionalProperties": true
      },
      "TruckParams": {
        "type": "object",
        "required": [
          "axleLoad",
          "truckWeight",
          "truckLength",
          "truckWidth",
          "truckHeight"
        ],
        "properties": {
          "axleLoad": {
            "type": "number"
          },
          "truckWeight": {
            "type": "number"
          },
          "truckLength": {
            "type": "number"
          },
          "truckWidth": {
            "type": "number"
          },
          "truckHeight": {
            "type": "number"
          },
          "euroNormForToll": {
            "type": "integer",
            "minimum": 1,
            "maximum": 6
          }
        },
        "additionalProperties": true
      },
      "Vehicle": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "car",
              "truck"
            ],
            "default": "car"
          },
          "truckParams": {
            "$ref": "#/components/schemas/TruckParams"
          }
        },
        "additionalProperties": true
      },
      "RouteRequest": {
        "type": "object",
        "required": [
          "points"
        ],
        "properties": {
          "points": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/Coordinate"
            }
          },
          "route": {
            "$ref": "#/components/schemas/RouteOptions"
          },
          "object": {
            "$ref": "#/components/schemas/Vehicle"
          }
        },
        "additionalProperties": true
      },
      "RouteManeuver": {
        "type": "object",
        "properties": {
          "viaPoint": {
            "type": "boolean"
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "road": {
            "type": [
              "string",
              "null"
            ]
          },
          "roadType": {
            "type": [
              "string",
              "null"
            ]
          },
          "distance": {
            "type": "number"
          },
          "eta": {
            "type": "number"
          },
          "routePoint": {
            "$ref": "#/components/schemas/Coordinate",
            "description": "Coordinates [longitude, latitude] (WGS84), when available. The desc array may be absent."
          },
          "maneuver": {
            "type": "string",
            "enum": [
              "Turn left",
              "Turn right",
              "Roundabout"
            ]
          }
        },
        "additionalProperties": true
      },
      "RouteResult": {
        "type": "object",
        "required": [
          "length",
          "eta"
        ],
        "properties": {
          "length": {
            "type": "integer",
            "description": "Route length in metres."
          },
          "eta": {
            "type": "integer",
            "description": "Estimated travel time in minutes."
          },
          "mapurl": {
            "type": "string",
            "format": "uri"
          },
          "routePoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Coordinate"
            }
          },
          "desc": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RouteManeuver"
            }
          },
          "tolls": {
            "type": "object",
            "properties": {
              "systems": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "price": {
                      "type": "number"
                    },
                    "distance": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "additionalProperties": true
          },
          "roadClassGroups": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "required": [
                "distance"
              ],
              "properties": {
                "distance": {
                  "type": "integer"
                }
              },
              "additionalProperties": false
            }
          },
          "truck_restricted_pts": {
            "type": "array",
            "description": "Truck-restriction details, when available. Item fields may vary."
          }
        },
        "additionalProperties": true
      },
      "RouteResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/RouteResult"
          }
        },
        "additionalProperties": false
      },
      "MatrixRequest": {
        "type": "object",
        "required": [
          "points",
          "type"
        ],
        "properties": {
          "points": {
            "type": "array",
            "minItems": 4,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/Coordinate"
            }
          },
          "type": {
            "type": "integer",
            "enum": [
              1,
              2
            ],
            "description": "1 optimizes time; 2 optimizes length."
          },
          "precise": {
            "type": "boolean",
            "default": false
          },
          "simple": {
            "type": "boolean",
            "default": false
          }
        },
        "additionalProperties": true
      },
      "MatrixRow": {
        "type": "object",
        "required": [
          "points",
          "length",
          "duration"
        ],
        "properties": {
          "points": {
            "type": "string",
            "pattern": "^[0-9]+-[0-9]+$"
          },
          "length": {
            "type": "integer"
          },
          "duration": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "MatrixResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MatrixRow"
            }
          }
        },
        "additionalProperties": false
      },
      "OptimizeRequest": {
        "type": "object",
        "required": [
          "points",
          "type"
        ],
        "properties": {
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/Coordinate"
            }
          },
          "type": {
            "type": "integer",
            "enum": [
              1,
              2
            ],
            "description": "1 optimizes time; 2 optimizes length."
          },
          "fixedEnd": {
            "type": "boolean",
            "default": true
          },
          "route": {
            "$ref": "#/components/schemas/OptimizeQueueRouteOptions"
          },
          "object": {
            "$ref": "#/components/schemas/Vehicle"
          }
        },
        "additionalProperties": true
      },
      "OptimizeSection": {
        "type": "object",
        "required": [
          "x",
          "y",
          "eta",
          "dist"
        ],
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "eta": {
            "type": "integer"
          },
          "dist": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      },
      "OptimizeResult": {
        "type": "object",
        "required": [
          "order",
          "points",
          "sections"
        ],
        "properties": {
          "order": {
            "type": "string",
            "pattern": "^[0-9]+(?:,[0-9]+)*$"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Coordinate"
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OptimizeSection"
            }
          }
        },
        "additionalProperties": true
      },
      "OptimizeResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/OptimizeResult"
          }
        },
        "additionalProperties": false
      },
      "NamedPoint": {
        "type": "object",
        "required": [
          "id",
          "x",
          "y"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_]{1,20}$"
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "OptimizeQueueRouteOptions": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "default": "NOW"
          },
          "avoidTolls": {
            "type": "boolean"
          },
          "avoidFerries": {
            "type": "boolean"
          },
          "avoidHighways": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "OptimizeQueueRequest": {
        "type": "object",
        "required": [
          "points",
          "optimizeBy",
          "route",
          "object"
        ],
        "properties": {
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/NamedPoint"
            }
          },
          "optimizeBy": {
            "type": "string",
            "enum": [
              "distance",
              "time"
            ]
          },
          "route": {
            "$ref": "#/components/schemas/OptimizeQueueRouteOptions",
            "description": "Required route options. Send an empty object to use defaults."
          },
          "object": {
            "$ref": "#/components/schemas/Vehicle",
            "description": "Required vehicle configuration. For a car, send {\"type\":\"car\"}."
          }
        },
        "additionalProperties": true
      },
      "OptimizeQueueState": {
        "type": "object",
        "required": [
          "requestId"
        ],
        "properties": {
          "requestId": {
            "type": "string"
          },
          "resultReady": {
            "type": "boolean",
            "description": "If present, false means pending and true means ready."
          },
          "optimizedSequence": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "OptimizeQueueResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/OptimizeQueueState"
          }
        },
        "additionalProperties": false
      },
      "OptimizeQueueResultRequest": {
        "type": "object",
        "required": [
          "requestId"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "pattern": "^(reef|bob).+"
          }
        },
        "additionalProperties": true
      },
      "OptimizeQueueResult": {
        "type": "object",
        "required": [
          "resultReady",
          "optimizedSequence"
        ],
        "properties": {
          "resultReady": {
            "type": "boolean",
            "description": "If present, false means pending and true means ready."
          },
          "optimizedSequence": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "OptimizeQueueResultResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/OptimizeQueueResult"
          }
        },
        "additionalProperties": false
      },
      "RoadPointOptions": {
        "type": "object",
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "distLimit": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": true
      },
      "SegmentInfoRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoadPointOptions"
          },
          {
            "type": "object",
            "required": [
              "x",
              "y"
            ],
            "properties": {
              "dir": {
                "type": "integer",
                "minimum": -2,
                "maximum": 359
              },
              "minCategory": {
                "type": "integer"
              },
              "ignoreNoWaySegments": {
                "type": "boolean"
              },
              "treatTruckTollsAsTolls": {
                "type": "boolean"
              },
              "ignoreSegmentsUnderConstruction": {
                "type": "boolean"
              },
              "ignorePhysicallyBlockedSegs": {
                "type": "boolean"
              },
              "useTolls": {
                "type": "integer",
                "enum": [
                  -1,
                  0,
                  1
                ]
              },
              "useFerries": {
                "type": "integer",
                "enum": [
                  -1,
                  0,
                  1
                ]
              },
              "useHighways": {
                "type": "integer",
                "enum": [
                  -1,
                  0,
                  1
                ]
              }
            }
          }
        ]
      },
      "RoadSegment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "speedLimit": {
            "type": "integer"
          },
          "speedLimitTruck": {
            "type": "integer"
          },
          "isToll": {
            "type": "integer"
          },
          "isFerry": {
            "type": "integer"
          },
          "isHighway": {
            "type": "integer"
          },
          "length": {
            "type": "integer"
          },
          "dir": {
            "type": "integer"
          },
          "category": {
            "type": "integer"
          },
          "country": {
            "type": "integer"
          },
          "placeName": {
            "type": "string"
          },
          "streetName": {
            "type": "string"
          },
          "urbanArea": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "SegmentInfoResult": {
        "type": "object",
        "properties": {
          "segment": {
            "$ref": "#/components/schemas/RoadSegment"
          },
          "attractedX": {
            "type": "number"
          },
          "attractedY": {
            "type": "number"
          },
          "pureDistance": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "SegmentInfoResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/SegmentInfoResult"
          }
        },
        "additionalProperties": false
      },
      "SpeedCheckRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoadPointOptions"
          },
          {
            "type": "object",
            "required": [
              "x",
              "y"
            ],
            "properties": {
              "dir": {
                "type": "integer",
                "minimum": -1,
                "maximum": 359
              }
            }
          }
        ]
      },
      "SpeedCheckResult": {
        "type": "object",
        "required": [
          "speedLimit",
          "speedLimitTruck"
        ],
        "properties": {
          "speedLimit": {
            "type": "integer"
          },
          "speedLimitTruck": {
            "type": "integer"
          },
          "urbanArea": {
            "type": "boolean"
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "distance": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "SpeedCheckResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/SpeedCheckResult"
          }
        },
        "additionalProperties": false
      },
      "SpeedCheckMultiRequest": {
        "type": "object",
        "required": [
          "points"
        ],
        "properties": {
          "points": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/RoadPointOptions"
                },
                {
                  "type": "object",
                  "required": [
                    "x",
                    "y"
                  ],
                  "properties": {
                    "dir": {
                      "type": "integer",
                      "minimum": -1,
                      "maximum": 359
                    }
                  }
                }
              ]
            }
          }
        },
        "additionalProperties": true
      },
      "SpeedCheckMultiResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpeedCheckResult"
            }
          }
        },
        "additionalProperties": false
      },
      "GeoJsonPolygon": {
        "type": "object",
        "required": [
          "type",
          "coordinates"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "Polygon"
          },
          "coordinates": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "array",
              "minItems": 4,
              "items": {
                "$ref": "#/components/schemas/Coordinate"
              }
            }
          }
        },
        "description": "Valid GeoJSON Polygon. Every ring must be closed, non-self-intersecting, and have at least three unique vertices. Inner rings must be inside the outer ring and may not touch, overlap, or nest.",
        "additionalProperties": false
      },
      "RoadPermitPermissions": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "tr_tonnage": {
            "type": "number"
          },
          "tr_tonn_axis": {
            "type": "number"
          },
          "tr_height": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "RoadPermitEnvironmentFields": {
        "type": "object",
        "properties": {
          "environment": {
            "type": "string",
            "enum": [
              "uat",
              "prod"
            ],
            "default": "uat"
          },
          "enviroment": {
            "type": "string",
            "enum": [
              "uat",
              "prod"
            ],
            "deprecated": true,
            "description": "Legacy misspelling; use `environment`."
          }
        },
        "additionalProperties": true
      },
      "RoadPermitWriteFields": {
        "type": "object",
        "required": [
          "permissions",
          "poly"
        ],
        "properties": {
          "date_start": {
            "type": "string",
            "format": "date"
          },
          "date_end": {
            "type": "string",
            "format": "date",
            "description": "Must not be earlier than `date_start`."
          },
          "description": {
            "type": "string",
            "maxLength": 255
          },
          "document_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "default": "default"
          },
          "location": {
            "type": "string",
            "maxLength": 255
          },
          "permissions": {
            "$ref": "#/components/schemas/RoadPermitPermissions"
          },
          "poly": {
            "$ref": "#/components/schemas/GeoJsonPolygon"
          },
          "is_valid_after_expiry": {
            "type": "boolean",
            "default": true
          }
        },
        "additionalProperties": true
      },
      "RoadPermitWriteRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoadPermitEnvironmentFields"
          },
          {
            "$ref": "#/components/schemas/RoadPermitWriteFields"
          }
        ]
      },
      "RoadPermitOverwriteRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoadPermitEnvironmentFields"
          },
          {
            "$ref": "#/components/schemas/RoadPermitWriteFields"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": [
                  "string",
                  "integer"
                ],
                "minLength": 1
              }
            }
          }
        ]
      },
      "RoadPermitRemoveRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoadPermitEnvironmentFields"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": [
                  "string",
                  "integer"
                ]
              }
            }
          }
        ]
      },
      "RoadPermitListRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoadPermitEnvironmentFields"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": [
                  "string",
                  "integer"
                ]
              },
              "document_name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            }
          }
        ]
      },
      "RoadPermitDocument": {
        "type": "object",
        "required": [
          "id",
          "document_name",
          "permissions",
          "poly",
          "is_valid_after_expiry"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "date_start": {
            "type": "string",
            "format": "date"
          },
          "date_end": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "document_name": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "permissions": {
            "$ref": "#/components/schemas/RoadPermitPermissions"
          },
          "poly": {
            "$ref": "#/components/schemas/GeoJsonPolygon"
          },
          "is_valid_after_expiry": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "RoadPermitIdResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "RoadPermitRemoveResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "id",
              "deleted"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "deleted": {
                "type": "boolean",
                "const": true
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "RoadPermitListResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoadPermitDocument"
            }
          }
        },
        "additionalProperties": false
      },
      "TrackPoint": {
        "type": "object",
        "required": [
          "x",
          "y",
          "t"
        ],
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "t": {
            "type": "integer",
            "description": "Unix timestamp in seconds."
          }
        },
        "additionalProperties": true
      },
      "SpeedReportRequest": {
        "type": "object",
        "required": [
          "objID",
          "objName",
          "objGroup",
          "points"
        ],
        "properties": {
          "objID": {
            "type": "string"
          },
          "objName": {
            "type": "string"
          },
          "objGroup": {
            "type": "string"
          },
          "points": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/TrackPoint"
            },
            "description": "The complete trace may span at most 24 hours."
          }
        },
        "additionalProperties": true
      },
      "SpeedReportResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "requestID",
              "objID"
            ],
            "properties": {
              "requestID": {
                "type": "string"
              },
              "objID": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "SpeedReportResultRequest": {
        "type": "object",
        "required": [
          "requestID",
          "limit"
        ],
        "properties": {
          "requestID": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "description": "Minimum speeding severity bucket included in the result."
          }
        },
        "additionalProperties": true
      },
      "SpeedOffense": {
        "type": "object",
        "required": [
          "duration",
          "length",
          "type",
          "speedMax",
          "speedAvg",
          "urbanArea",
          "startLocation",
          "endLocation",
          "startPoint",
          "endPoint",
          "startTime",
          "endTime",
          "speedLimit"
        ],
        "properties": {
          "duration": {
            "type": "number"
          },
          "length": {
            "type": "number"
          },
          "type": {
            "type": "integer"
          },
          "speedMax": {
            "type": "number"
          },
          "speedAvg": {
            "type": "number"
          },
          "urbanArea": {
            "type": "boolean"
          },
          "startLocation": {
            "type": "string"
          },
          "endLocation": {
            "type": "string"
          },
          "startPoint": {
            "$ref": "#/components/schemas/PointObject"
          },
          "endPoint": {
            "$ref": "#/components/schemas/PointObject"
          },
          "startTime": {
            "type": "integer"
          },
          "endTime": {
            "type": "integer"
          },
          "speedLimit": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "SpeedReportState": {
        "type": "object",
        "required": [
          "requestID",
          "progress"
        ],
        "properties": {
          "requestID": {
            "type": "string"
          },
          "progress": {
            "type": "number"
          },
          "reportURL": {
            "type": "string",
            "format": "uri"
          },
          "overspeedingArray": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpeedOffense"
            }
          }
        },
        "additionalProperties": false
      },
      "SpeedReportResultResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/SpeedReportState"
          }
        },
        "additionalProperties": false
      }
    }
  }
}
