Create a new zone
POST/zones
The Create Zone request allows you to create a new zone for the current active map in ANSCER Robot. The request body should contain the GeoJSON data of the zone to be created, along with other properties such as the name and category of the zone.
Note: The isActive property is set to true by default when a new zone is created. This means that the zone is immediately available for use in ANSCER Robot.
Request
- application/json
Body
required
- GeoJSONPoint
- GeoJSONLineString
- GeoJSONPolygon
Possible values: >= 3 characters and <= 50 characters
A unique name of the zone
Possible values: [restricted, warning, blink, buzzer, speed, no-plan]
Possible values: [Feature]
GeoJSON type of the zone, always Feature
geometry object required
Possible values: [Point]
Possible values: [LineString]
Possible values: [Polygon]
Responses
- 200
- 400
- 401
- 403
- 409
- 500
Zone created
- application/json
- Schema
- Example (from schema)
Schema
- GeoJSONPoint
- GeoJSONLineString
- GeoJSONPolygon
Possible values: >= 3 characters and <= 50 characters
Possible values: [restricted, warning, blink, buzzer, speed, no-plan]
Default value: true
Possible values: [Feature]
GeoJSON type of the zone, always Feature
geometry object
Possible values: [Point]
Possible values: [LineString]
Possible values: [Polygon]
map object
Possible values: >= 3 characters and <= 50 characters
createdBy object
The user who created this zone
updatedBy object
The user who last updated this zone
The date and time this zone was created
The date and time this zone was last updated
{
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"category": "restricted",
"isActive": true,
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-73.989,
40.735
]
},
"map": {
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"properties": {},
"createdBy": {
"_id": "string",
"name": "string",
"email": "user@example.com"
},
"updatedBy": {
"_id": "string",
"name": "string",
"email": "user@example.com"
},
"createdAt": "2024-12-03T13:26:27.510Z",
"updatedAt": "2024-12-03T13:26:27.510Z"
}
Bad Request due to validation errors in the request body
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Validation failed.",
"errors": [
{
"field": "name",
"message": "Name is required."
}
]
}
{
"message": "Validation failed.",
"errors": [
{
"field": "name",
"message": "Name is required."
}
]
}
Unauthorized.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Authentication token not provided."
}
{
"message": "Authentication token not provided."
}
Forbidden.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Access to this resource is forbidden."
}
{
"message": "Access to this resource is forbidden."
}
The Zone with given name already exists.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "The Zone with given name already exists."
}
{
"message": "The Zone with given name already exists."
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Internal Server Error. Please try again later."
}
{
"message": "Internal Server Error. Please try again later."
}