The Geometry API allows you to create, retrieve, and manage geometries (polygons) in GeoJSON format.
X-API-Key
header.
`GET` /api/geometry/
Get all geometries for the authenticated user in GeoJSON format.
Name | Required | Description |
---|---|---|
X-API-Key | Yes | Your API key in UUID format |
Returns a GeoJSON FeatureCollection containing all geometries.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[lon1, lat1], [lon2, lat2], ...]]
},
"properties": {
"id": "uuid-string",
"name": "Farm 1",
"area": 12345.67,
"created_at": "2023-01-01T12:00:00Z"
}
},
...
]
}
Status Code | Description |
---|---|
401 | Unauthorized - Missing API key |
403 | Forbidden - Invalid API key |
500 | Internal Server Error |
POST /api/geometry/
Create a new geometry with name and polygon data.
Name | Required | Description |
---|---|---|
X-API-Key | Yes | Your API key in UUID format |
Content-Type | Yes | application/json |
Parameter | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the geometry |
geometry | object | Yes | Geometry in GeoJSON format |
{
"name": "Farm 1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[longitude1, latitude1],
[longitude2, latitude2],
[longitude3, latitude3],
[longitude1, latitude1]
]
]
}
}
Returns the created geometry object with id, name, geometry, and created_at.
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[lon1, lat1], [lon2, lat2], ...]]
},
"properties": {
"id": "uuid-string",
"name": "Farm 1",
"area": 12345.67,
"created_at": "2023-01-01T12:00:00Z"
}
}
Status Code | Description |
---|---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Missing API key |
403 | Forbidden - Invalid API key |
500 | Internal Server Error |
GET /api/geometry/{id}/
Get a specific geometry by UUID in GeoJSON format.
Parameter | Type | Required | Description |
---|---|---|---|
id | UUID | Yes | UUID of the geometry |
Name | Required | Description |
---|---|---|
X-API-Key | Yes | Your API key in UUID format |
Returns a GeoJSON Feature containing the geometry.
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[lon1, lat1], [lon2, lat2], ...]]
},
"properties": {
"id": "uuid-string",
"name": "Farm 1",
"area": 12345.67,
"created_at": "2023-01-01T12:00:00Z"
}
}
Status Code | Description |
---|---|
400 | Bad Request - Invalid geometry ID format |
401 | Unauthorized - Missing API key |
403 | Forbidden - Invalid API key |
404 | Not Found - Geometry not found |
500 | Internal Server Error |
DELETE /api/geometry/{id}/
Delete a specific geometry by UUID.
Parameter | Type | Required | Description |
---|---|---|---|
id | UUID | Yes | UUID of the geometry to delete |
Name | Required | Description |
---|---|---|
X-API-Key | Yes | Your API key in UUID format |
Returns 204 No Content on successful deletion.
Status Code | Description |
---|---|
400 | Bad Request - Invalid geometry ID format |
401 | Unauthorized - Missing API key |
403 | Forbidden - Invalid API key or insufficient permissions |
404 | Not Found - Geometry not found |
500 | Internal Server Error |