v15

latestOpenAPI 3.1.02026-07-1295183803.5 KB
Map-Data_Road-Editor

Create a new restriction

post/restrictions/{restriction_type}

Path parameters

restriction_type'turn' | 'parking' | 'fixedspeed' | 'maxspeed' | 'closure' | 'truck' required
Example:restriction_type = closure

Specify the type of restriction being created. Following restriction types are supported:

  • turn: Taking the given turn is restricted.

  • fixedspeed: Applies a fixed speed restriction in the given segments or geofence.

  • maxspeed: Applies a maximum speed limit in the given segments or geofence.

  • closure: The given segments or geofence is closed for specified mode of travel.

  • truck: Trucks are restricted in the given segments or geofence.

  • parking: No parking allowed in the given segments or geofence.

Query parameters

latlonboolean

Use this parameter to decide the format for specifying the geofence coordinates. If true, then the coordinates of geofence can be specified as "latitude,longitude" format, otherwise they should be specified in "longitude,latitude" format.

keystring 32 character alphanumeric string required
Example:key=API_KEY

A key is a unique identifier that is required to authenticate a request to the API.

Request body

namestring required

Specify a custom, descriptive name for the restriction.

areastring required

Specify the area name. It represents a region where restrictions can be applied. This is a custom field and it is recommended for the users to check with NextBillion.ai support for the right value. Alternatively, users can invoke the Areas method to get a list of available areas for them.

repeat_onstring

It represents the days and times when the restriction is in effect. Users can use this property to set recurring or one-time restrictions as per the given format for specifying the recurring schedule of the restriction.

Please provided values as per the local time of the region where the restriction is being applied.

commentstring

Use this parameter to add any custom information about the restriction being created.

start_timenumber

Provide a UNIX epoch timestamp in seconds, representing the start time for the restriction to be in-effect.

end_timenumber

Provide a UNIX epoch timestamp in seconds, representing the time when the restriction should cease to be in-effect.

modestring[]

Provide the driving modes for which the restriction should be effective. If the value is an empty array or if it is not provided then the restriction would be applied for all modes.

speednumber

Provide the the fixed speed of the segment where the restriction needs to be applied. Please note that this parameter is mandatory when the restrictionType is fixedspeed.

speed_limitnumber

Provide the the maximum speed of the segment where the restriction needs to be applied. Please note that this parameter is mandatory when the restrictionType is maxspeed.

direction'forward' | 'backward' | 'both'

Represents the traffic direction on the segments to which the restriction will be applied.

weightinteger

Specify the maximum truck weight, in kilograms, that the restriction will allow. A value of 0 indicates no limit.

Please note this parameter is effective only when restriction_type is truck. At least one of truck parameters - weight, height, width and truck - needs to be provided for is truck restriction type.

heightinteger

Specify the maximum truck height, in centimeter, that will be allowed under the restriction. A value of 0 indicates no limit.

Please note this parameter is effective only when restriction_type is truck. At least one of truck parameters - weight, height, width and truck - needs to be provided when restriction type is truck.

widthinteger

Specify the maximum truck width, in centimeter, that will be allowed under the restriction. A value of 0 indicates no limit.

Please note this parameter is effective only when restriction_type is truck. At least one of truck parameters - weight, height, width and truck - needs to be provided when restriction type is truck.

lengthinteger

Specify the maximum truck length, in centimeter, that will be allowed under the restriction. A value of 0 indicates no limit.

Please note this parameter is effective only when restriction_type is truck. At least one of truck parameters - weight, height, width and truck - needs to be provided when restriction type is truck.

Example request

{
  "repeat_on": "repeatOn=\"Mo-Fr 07:00-09:00,17:00-19:00\""
}

Response

The restriction has been successfully created.

idinteger

Returns the unique ID of the restriction. This ID can be used for update, delete, get operations on the restriction using the available API methods.

namestring

Returns the name of the restriction. This value is same as that provided at the time of creating or updating the restriction.

areastring

Returns the area to which the restriction belongs to.

bboxobject

Returns the details of the bounding box containing the restriction.

status'active' | 'inactive'

Returns the status of the restriction at the time of making the request i.e. whether the restriction is in force or not. It will have one of the following values: active or inactive.

Please note that this field can not be directly influenced by the users. It will always be calculated using the start_time, end_time and repeat_on parameters.

repeat_onstring

Returns the time periods during which this restriction active or repeats on. The time values follow a given format.

commentstring

Returns the comments that were provided for the restriction at the time of creating or updating the request.

create_atstring date-time

The timestamp at which the restriction was created.

update_atstring date-time

The timestamp at which the restriction was updated.

start_timenumber

The time when the restriction starts to be in-effect. It is a UNIX timestamp.

end_timenumber

The time when the restriction ceases to be in-effect. It is a UNIX timestamp.

modestring[]

Returns an array denoting all the traveling modes the restriction applies on.

restriction_type'closure' | 'maxspeed' | 'fixedspeed' | 'parking' | 'turn' | 'truck'

Returns the type of restriction. This is the same value as provided when creating or updating the restriction.

highwaystring

Returns the highway information on which the restriction applies to. If no highway is impacted by the restriction, then this field is not present in the response.

speednumber

Returns the fixed speed of segments. This field is not present in the response if the restriction type is not fixedspeed

speed_limitnumber

Returns the maximum speed of segments. This field is not present in the response if the restriction type is not maxspeed

direction'forward' | 'backward' | 'both'

Returns the direction of travel on the segments to which the restriction applies.

state'enabled' | 'disabled' | 'deleted'

Returns the state of the "restriction" itself - enabled, disabled or deleted. It does not denote if the restriction is actually in effect or not.

geofenceobject

Returns the list of coordinates representing the area that was used to apply the given restriction. The geofence returned is same as that provided while creating or updating the restriction.

Example response

{
  "bbox": {
    "minLat": 0,
    "minLon": 0,
    "maxLat": 1,
    "maxLon": 1
  },
  "repeat_on": "Mo-Fr 07:00-09:00,17:00-19:00"
}