Zum Inhalt

Road Closure Api

The Localion Navigator provides an HTTP-API which allows customers to manage the road closures of their group. The closures are synchronized to the Localion Navigator of every user in the group and are taken into account there.

Authentication

The Road Closures Api is secured with OAuth2 and uses the same API key as the other customer APIs. If you have not received it yet, please contact the support at navigation@localion.de.

Every request is authorized in two steps:

  1. Request a short-lived access token from the token endpoint using your key.

  2. Send that access token as a Bearer token in the Authorization header of each API request.

The access token is valid for one hour and can be reused until it expires; request a new one afterwards.

Example token request (the token endpoint is the same for every customer; only the key differs):

curl --location --request POST 'https://localion-navigator-tasks-prod.auth.eu-central-1.amazoncognito.com/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic <your-key>' \
--data-urlencode 'grant_type=client_credentials'

Example response:

{
    "access_token": "<your-key>",
    "expires_in": 3600,
    "token_type": "Bearer"
}

The access_token is then used for every API request:

--header 'Authorization: Bearer <your-key>'

URL and endpoints

This API is accessible through the URL: https://customerapi.navigator.localion.de/manageRoadClosures.

The following endpoints are provided:

  • /closures (GET) – list the active road closures of your group

  • /closures (POST) – add one or more road closures

  • /closures/{closureId} (PUT) – replace a road closure

  • /closures/{closureId} (DELETE) – delete a road closure

  • /closures (DELETE) – delete several road closures

Changes reach the users' devices with the next synchronization of the Navigator app.

The Closure Object

A road closure is described by a JSON object:

Key Type Description Required
title String A short title for the closure. Must not be empty. Yes
description String A more detailed description of the closure. No
latitude Double The latitude of the decimal coordinate (WGS84), -90 to 90. Must be provided together with longitude. See below
longitude Double The longitude of the decimal coordinate (WGS84), -180 to 180. Must be provided together with latitude. See below
azimuth Double The direction the road is closed, in radians (see below). No
polygonCoordinates List of Object The closure area as a list of at least three coordinate objects with latitude and longitude. See below
polygonBlocksIngoing Boolean Whether driving into the polygon area is blocked. No
polygonBlocksOutgoing Boolean Whether driving out of the polygon area is blocked. No
startDateTime String The start of the closure's validity as an ISO-8601 datetime with a timezone offset, e.g. 2026-08-01T00:00:00Z. Stored and returned normalized to UTC. No
endDateTime String The end of the closure's validity as an ISO-8601 datetime with a timezone offset. Must not be before startDateTime. Stored and returned normalized to UTC. No
emergencyClass Integer The passage class of the closure, 1 to 9 (see below). No

A closure either blocks a single road at a coordinate (latitude and longitude, optionally restricted by azimuth) or an area (polygonCoordinates with polygonBlocksIngoing/polygonBlocksOutgoing). One of the two positions is required; if both are provided, the polygon is used. Unknown fields are rejected. The polygon does not need to be closed: the last coordinate is connected to the first one.

The azimuth is the direction the road is closed, in radians between 0 and : 0 is north bound, π/2 is east bound, and so on, with a matching tolerance of ±45 degrees. Use -1.0 to close both traffic directions. It only applies to closures at a coordinate and is ignored for polygon closures.

The emergencyClass controls which vehicles the closure applies to, with increasing permeability: the closure applies to vehicles whose configured passage class is the given value or higher, while vehicles with a lower passage class may pass. If omitted, the closure applies to all vehicles.

The fields closureId, createdAt and updatedAt are managed by the API and returned with every closure. The closureId is generated when the closure is added; use it to update or delete the closure.

List Road Closures

Returns the active road closures of your group, paginated. Use the /closures endpoint with the GET method.

Parameters

Query parameter Description Required
limit The maximum number of closures per page, 1 to 200. Defaults to 200. No
nextToken The token from the previous response to fetch the next page. No

Result

A JSON object containing one page of closures. If more pages exist, the response carries a nextToken; repeat the request with it until the response contains no nextToken. A page may contain fewer closures than limit — even none — while more pages exist, so always follow the token instead of stopping at an empty page.

{
    "closures": [
        {
            "closureId": "7d3adf16-4a54-46d0-9c1e-9d135e2aa621",
            "title": "Brückensperrung B1",
            "description": "Vollsperrung",
            "latitude": 51.5,
            "longitude": 7.25,
            "azimuth": -1.0,
            "emergencyClass": 3,
            "startDateTime": "2026-08-01T00:00:00.000Z",
            "endDateTime": "2026-08-15T00:00:00.000Z",
            "createdAt": "2026-07-28T08:00:00.000Z",
            "updatedAt": "2026-07-28T08:00:00.000Z"
        }
    ],
    "nextToken": "N2QzYWRmMTYtNGE1NC00NmQwLTljMWUtOWQxMzVlMmFhNjIx"
}

Example Request:

curl --location --request GET 'https://customerapi.navigator.localion.de/manageRoadClosures/closures?limit=200&nextToken=N2QzYWRmMTYtNGE1NC00NmQwLTljMWUtOWQxMzVlMmFhNjIx' \
--header 'Authorization: Bearer <your-key>'

Add Road Closures

Adds up to 25 road closures in a single request. Use the /closures endpoint with the POST method. The request is atomic: either all closures are added or none.

The id of each closure is generated by the API and returned in the response; a closureId in the request is rejected.

Body

The request body is a JSON object with a single closures list, each entry a closure object as described above:

{
    "closures": [ { ... }, { ... } ]
}

Result

On success the response has status code 201 and returns the stored closures including their generated ids and timestamps:

{
    "closures": [
        {
            "closureId": "7d3adf16-4a54-46d0-9c1e-9d135e2aa621",
            "title": "Brückensperrung B1",
            "latitude": 51.5,
            "longitude": 7.25,
            "azimuth": -1.0,
            "emergencyClass": 3,
            "createdAt": "2026-07-28T08:00:00.000Z",
            "updatedAt": "2026-07-28T08:00:00.000Z"
        }
    ]
}

A status code 400 means the request body is invalid, 403 that the token is not authorized for a group.

Example request adding a closure at a coordinate and a polygon closure:

curl --location --request POST 'https://customerapi.navigator.localion.de/manageRoadClosures/closures' \
--header 'Authorization: Bearer <your-key>' \
--header 'Content-Type: application/json' \
--data '{
    "closures": [
        {
            "title": "Brückensperrung B1",
            "description": "Vollsperrung",
            "latitude": 51.5,
            "longitude": 7.25,
            "azimuth": -1.0,
            "emergencyClass": 3,
            "startDateTime": "2026-08-01T00:00:00Z",
            "endDateTime": "2026-08-15T00:00:00Z"
        },
        {
            "title": "Waldbrandgebiet",
            "polygonCoordinates": [
                { "latitude": 52.556362, "longitude": 7.20849 },
                { "latitude": 52.566362, "longitude": 7.20849 },
                { "latitude": 52.566362, "longitude": 7.21849 },
                { "latitude": 52.556362, "longitude": 7.21849 }
            ],
            "polygonBlocksIngoing": true,
            "polygonBlocksOutgoing": true
        }
    ]
}'

Replace a Road Closure

Replaces a road closure with the closure object in the request body. Use the /closures/{closureId} endpoint with the PUT method.

The body is one closure object as described above. Optional fields that are omitted are removed from the closure; createdAt is kept. A closureId in the body may be omitted; if present it must match the id in the URL.

Result

On success the response has status code 200 and returns the stored closure. A status code 404 means that no closure with this id exists in your group.

Example Request:

curl --location --request PUT 'https://customerapi.navigator.localion.de/manageRoadClosures/closures/7d3adf16-4a54-46d0-9c1e-9d135e2aa621' \
--header 'Authorization: Bearer <your-key>' \
--header 'Content-Type: application/json' \
--data '{
    "title": "Brückensperrung B1 (verlängert)",
    "latitude": 51.5,
    "longitude": 7.25,
    "endDateTime": "2026-09-01T00:00:00Z"
}'

Delete Road Closures

Deletes road closures; the deletion is synchronized to the users' devices. Use the /closures/{closureId} endpoint with the DELETE method for a single closure, or the /closures endpoint with the DELETE method and a request body for up to 25 closures. The bulk request is atomic: either all listed closures are deleted or none.

Body (bulk deletion only)

{
    "closureIds": ["7d3adf16-4a54-46d0-9c1e-9d135e2aa621", "b81c6c04-51a3-4b6a-9c0e-2f7d8e9a0b1c"]
}

Result

On success the response has status code 200 and lists the deleted ids:

{
    "closureIds": ["7d3adf16-4a54-46d0-9c1e-9d135e2aa621", "b81c6c04-51a3-4b6a-9c0e-2f7d8e9a0b1c"]
}

A status code 404 means that some of the closures do not exist in your group; the response lists the missing ids and nothing is deleted:

{
    "error": "closures not found",
    "closureIds": ["b81c6c04-51a3-4b6a-9c0e-2f7d8e9a0b1c"]
}

Example request for a single closure (the id is part of the URL):

curl --location --request DELETE 'https://customerapi.navigator.localion.de/manageRoadClosures/closures/7d3adf16-4a54-46d0-9c1e-9d135e2aa621' \
--header 'Authorization: Bearer <your-key>'

Example request for several closures:

curl --location --request DELETE 'https://customerapi.navigator.localion.de/manageRoadClosures/closures' \
--header 'Authorization: Bearer <your-key>' \
--header 'Content-Type: application/json' \
--data '{ "closureIds": ["7d3adf16-4a54-46d0-9c1e-9d135e2aa621", "b81c6c04-51a3-4b6a-9c0e-2f7d8e9a0b1c"] }'