Skip to content

Upsert area

PUT
/geo/areas
curl --request PUT \
--url https://portal.staging.arago-tech.com/geo/areas \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "id": "63e2d42a27ad5f2b345ca123", "tags": [ "tag1", "tag2" ], "name": "Area 1", "geo_json": { "coordinates": [ [ [ 30, 10 ], [ 40, 40 ], [ 20, 40 ], [ 10, 20 ], [ 30, 10 ] ] ], "type": "Polygon" } }'

Creates or updates a geo area

The request to upsert an area

Media typeapplication/json
Upsert Area

The request to upsert an area

object
id
Area ID

The area unique identifier. If not provided, a new area will be created.

string
Example
63e2d42a27ad5f2b345ca123
tags
Tags

The tags associated with the area (max 10 items, each tag must be between 3 and 255 characters). Each tag must not contain only whitespace (NOT_BLANK). Tags are not trimmed.

Array<string>
Example
[
"tag1",
"tag2"
]
name
required
Name

The name of the area. Must not contain only whitespace (NOT_BLANK). Length is checked before surrounding whitespace is trimmed on write; the response returns the stored name.

string
>= 1 characters <= 255 characters
Example
Area 1
geo_json
required
GeoJSON

The GeoJSON representation of the area. The total area must be at least the size of an S2 cell at level 10 (approximately 48 km² minimum).

object
type
Type

The GeoJSON object type

string
Example
FeatureCollection
features
Features

The list of GeoJSON features

Array<object>
>= 1 items <= 300 items
GeoJSON Feature

A GeoJSON feature object

object
type
required
Type

The GeoJSON feature type

string
Example
Feature
properties
required
Properties

The properties of the GeoJSON feature

object
key
additional properties
Example
{
"name": "Area 1"
}
bbox
Bounding Box

The bounding box of the GeoJSON feature

Array<number>
Example
[
100,
0,
105,
1
]
geometry
required
Geometry

The geometry of the GeoJSON feature. Accepts Polygon or MultiPolygon types.

object
Example
{
"coordinates": [
[
[
30,
10
],
[
40,
40
],
[
20,
40
],
[
10,
20
],
[
30,
10
]
]
],
"type": "Polygon"
}
bbox
Bounding Box

The bounding box of the GeoJSON object

Array<number>
Example
[
100,
0,
105,
1
]
Example
{
"coordinates": [
[
[
30,
10
],
[
40,
40
],
[
20,
40
],
[
10,
20
],
[
30,
10
]
]
],
"type": "Polygon"
}

A successful response.

Media typeapplication/json
object
area
Messages for Area
object
id
Area ID

The area unique identifier. If not provided, a new area will be created.

string
name
Name

The name of the area

string
>= 1 characters <= 255 characters
tags
Tags

The tags associated with the area

Array<string>
geometry_ids
Geometry IDs

The unique identifiers of the geometries associated with the area

Array<string>
created_at
Created At

The date and time when the area was created

string format: date-time
updated_at
Updated At

The date and time when the area was last updated

string format: date-time
Example
{
"area": {
"id": "63e2d42a27ad5f2b345ca123",
"name": "Area 1",
"tags": [
"tag1",
"tag2"
],
"geometry_ids": [
"63e2d42a27ad5f2b345ca123",
"63e2d42a27ad5f2b345ca124"
],
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
}

Bad request

Media typeapplication/json
object
Example
{
"error": {
"code": "BAD_REQUEST",
"details": [
{
"code": "MAX_ITEMS",
"field": "line_items",
"message": "value must contain no more than 3000 item(s)",
"params": {
"max": "3000"
}
}
],
"message": "Bad request"
}
}

Unauthorized

Media typeapplication/json
object
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}

Internal server error

Media typeapplication/json
object
Example
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
}
}

An unexpected error response.

Media typeapplication/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
any
Examplegenerated
{
"code": 1,
"message": "example",
"details": [
{
"@type": "example"
}
]
}