---
title: "Update a restriction"
method: PATCH
path: "/restrictions/{id}"
tags: ["Map-Data_Road-Editor"]
---

# Update a restriction

`PATCH /restrictions/{id}`

## Path parameters

- `id` integer, required

## Query parameters

- `latlon` boolean
- `key` string, 32 character alphanumeric string, required

## Request body

- RichGroupDtoRequest
  - `name` string, required — Specify a custom, descriptive name for the restriction.
  - `area` string, 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](www.nextbillion.ai) support for the right value. Alternatively, users can invoke the *[Areas](#supported-areas)* method to get a list of available areas for them.
  - `repeat_on` string — 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](https://wiki.openstreetmap.org/wiki/Key:opening_hours) 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.
  - `comment` string — Use this parameter to add any custom information about the restriction being created.
  - `start_time` number — Provide a UNIX epoch timestamp in seconds, representing the start time for the restriction to be in-effect.
  - `end_time` number — Provide a UNIX epoch timestamp in seconds, representing the time when the restriction should cease to be in-effect.
  - `mode` string[] — 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.
  - `segments` object[] — An array of objects to collect the details of the segments of a road on which the restriction has to be applied. Each object corresponds to a new segment. Please note that segments is mandatory for all restrtiction_type except turn.
    - `from` number — An integer value representing the ID of the starting node of the segment.
    - `to` number — An integer value representing the ID of the ending node of the segment.
  - `turns` object[] — An array of objects to collect the details of the turns of a road on which the restriction has to be applied. Each object corresponds to a new turn. Please note that turns is mandatory for when restrtiction_type=turn.
    - `from` integer — An integer value that represents the ID of the starting node of the turn.
    - `via` integer — An integer value that represents the ID of a node connecting from and to nodes of the turn.
    - `to` integer — An integer value that represents the ID of the ending node of the turn.
  - `speed` number — 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_limit` number — 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.
  - `geofence` array[] — An array of coordinates denoting the boundary of an area in which the restrictions are to be applied. The format in which coordinates should be listed is defined by the latlon field. Geofences can be used to create all restriction types, except for a turn type restriction. Please note that segments is not required when using geofence to create restrictions.
    - number[]
  - `weight` integer — 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.
  - `height` integer — 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.
  - `width` integer — 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.
  - `length` integer — 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.
  - `tracks` array[] — Specify a sequence of coordinates (track) where the restriction is to be applied. The coordinates will be snapped to nearest road. Please note when using tracks, segments and turns are not required.
    - number[]

## Response `200`

- RichGroupDtoResponse
  - `id` integer — 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.
  - `name` string — Returns the name of the restriction. This value is same as that provided at the time of creating or updating the restriction.
  - `area` string — Returns the area to which the restriction belongs to.
  - `bbox` object — 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_on` string — Returns the time periods during which this restriction active or repeats on. The time values follow a [given format](https://wiki.openstreetmap.org/wiki/Key:opening_hours).
  - `comment` string — Returns the comments that were provided for the restriction at the time of creating or updating the request.
  - `create_at` string, date-time — The timestamp at which the restriction was created.
  - `update_at` string, date-time — The timestamp at which the restriction was updated.
  - `start_time` number — The time when the restriction starts to be in-effect. It is a UNIX timestamp.
  - `end_time` number — The time when the restriction ceases to be in-effect. It is a UNIX timestamp.
  - `mode` string[] — 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.
  - `highway` string — 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.
  - `speed` number — Returns the fixed speed of segments. This field is not present in the response if the restriction type is not fixedspeed
  - `speed_limit` number — 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.
  - `geofence` object — 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.

---

[API](https://skmtc.net/nextbillion-ai/apis/one-spec-service.md) · [All operations](https://skmtc.net/nextbillion-ai/apis/one-spec-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nextbillion-ai/one-spec-service/versions/b647f1808dda/schema)
