Skip to main content
GET
/
api
/
forest
/
patrimony
curl -X GET "https://api.confor.app/api/forest/patrimony?level=5&parentId=770e8400-e29b-41d4-a716-446655440002" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "items": [
    {
      "id": "880e8400-e29b-41d4-a716-446655440003",
      "level4Id": "770e8400-e29b-41d4-a716-446655440002",
      "code": "SUBP-001",
      "name": "Subparcela de Muestreo 1",
      "type": "SUBPARCELA",
      "shapeType": "CUADRADA",
      "dimension1M": 20,
      "dimension2M": 20,
      "dimension3M": null,
      "dimension4M": null,
      "areaM2": 400,
      "centroidLatitude": 10.5251,
      "centroidLongitude": -66.8745,
      "lastInfoDate": "2024-01-12T00:00:00Z",
      "isActive": true,
      "createdAt": "2024-01-15T10:45:00Z",
      "updatedAt": "2024-01-15T10:45:00Z",
      "level4": {
        "id": "770e8400-e29b-41d4-a716-446655440002",
        "code": "RODAL-01",
        "name": "Rodal Pino Caribe"
      }
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "totalPages": 1
  }
}

Overview

Level 5 represents reference units, sub-parcels, or sample plots within Level 4 stands. These are the smallest spatial units in the hierarchy, used for detailed measurements and monitoring.

Hierarchy

Level 2 (FINCA, PREDIO, etc.)
  └─ Level 3 (Compartments, Blocks, Sections)
      └─ Level 4 (Stands, Parcels, Management Units)
          └─ Level 5 (REFERENCIA, SUBUNIDAD, etc.) ← You are here
Parent Relationship: Each Level 5 unit must belong to a Level 4 unit via level4Id.

List Level 5 Units

level
string
required
Must be set to "5" to retrieve Level 5 units
page
number
default:"1"
Page number for pagination
limit
number
default:"25"
Number of items per page
parentId
string
Filter by Level 4 parent ID (UUID)
Search by code or name (case-insensitive)

Response

items
array
id
string
Unique identifier (UUID)
level4Id
string
Parent Level 4 unit ID (UUID)
code
string
Unique code for the unit (max 80 characters, unique within parent)
name
string
Name of the reference unit or sub-parcel
type
enum
Type of reference unit. Possible values:
  • REFERENCIA - Reference
  • SUBUNIDAD - Sub-unit
  • SUBPARCELA - Sub-parcel
  • MUESTRA - Sample
  • SUBMUESTRA - Sub-sample
shapeType
enum
required
Shape of the plot. Possible values:
  • RECTANGULAR - Rectangular
  • CUADRADA - Square
  • CIRCULAR - Circular
  • HEXAGONAL - Hexagonal
dimension1M
number
First dimension in meters (non-negative)
dimension2M
number
Second dimension in meters (non-negative)
dimension3M
number
Third dimension in meters (non-negative, for complex shapes)
dimension4M
number
Fourth dimension in meters (non-negative, for complex shapes)
areaM2
number
Calculated area in square meters (automatically computed from dimensions)
centroidLatitude
number
Latitude of centroid (-90 to 90)
centroidLongitude
number
Longitude of centroid (-180 to 180)
lastInfoDate
date
Date of last information update
isActive
boolean
default:"true"
Whether the unit is active
createdAt
datetime
Creation timestamp
updatedAt
datetime
Last update timestamp
level4
object
Parent Level 4 unit information
id
string
Level 4 ID
code
string
Level 4 code
name
string
Level 4 name
pagination
object
total
number
Total number of items
page
number
Current page number
limit
number
Items per page
totalPages
number
Total number of pages
curl -X GET "https://api.confor.app/api/forest/patrimony?level=5&parentId=770e8400-e29b-41d4-a716-446655440002" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "items": [
    {
      "id": "880e8400-e29b-41d4-a716-446655440003",
      "level4Id": "770e8400-e29b-41d4-a716-446655440002",
      "code": "SUBP-001",
      "name": "Subparcela de Muestreo 1",
      "type": "SUBPARCELA",
      "shapeType": "CUADRADA",
      "dimension1M": 20,
      "dimension2M": 20,
      "dimension3M": null,
      "dimension4M": null,
      "areaM2": 400,
      "centroidLatitude": 10.5251,
      "centroidLongitude": -66.8745,
      "lastInfoDate": "2024-01-12T00:00:00Z",
      "isActive": true,
      "createdAt": "2024-01-15T10:45:00Z",
      "updatedAt": "2024-01-15T10:45:00Z",
      "level4": {
        "id": "770e8400-e29b-41d4-a716-446655440002",
        "code": "RODAL-01",
        "name": "Rodal Pino Caribe"
      }
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "totalPages": 1
  }
}

Create Level 5 Unit

When creating a Level 5 unit, the area is automatically calculated based on the shape type and dimensions provided.

Request Body

level
string
required
Must be set to "5" to create a Level 5 unit
data
object
required
level4Id
string
required
Parent Level 4 unit ID (UUID)
code
string
required
Unique code within parent (1-80 characters)
name
string
required
Name of the reference unit (2-255 characters)
type
enum
required
Type: REFERENCIA, SUBUNIDAD, SUBPARCELA, MUESTRA, SUBMUESTRA
shapeType
enum
required
Shape: RECTANGULAR, CUADRADA, CIRCULAR, HEXAGONAL
dimension1M
number
First dimension in meters (must be non-negative)
dimension2M
number
Second dimension in meters (must be non-negative)
dimension3M
number
Third dimension in meters (must be non-negative)
dimension4M
number
Fourth dimension in meters (must be non-negative)
centroidLatitude
number
Latitude of centroid (-90 to 90)
centroidLongitude
number
Longitude of centroid (-180 to 180)
lastInfoDate
date
Date of last information update
isActive
boolean
default:"true"
Whether the unit is active

Area Calculation

The area is automatically calculated based on shape type:
  • CUADRADA (Square): dimension1M²
  • RECTANGULAR: dimension1M × dimension2M
  • CIRCULAR: π × (dimension1M/2)² (dimension1M is diameter)
  • HEXAGONAL: Complex formula based on dimensions
If the dimensions are insufficient for the shape type, the request will fail with error code 400.

Response

Returns the created Level 5 unit with status code 201, including the calculated area and parent Level 4 information.
curl -X POST "https://api.confor.app/api/forest/patrimony" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "level": "5",
    "data": {
      "level4Id": "770e8400-e29b-41d4-a716-446655440002",
      "code": "SUBP-001",
      "name": "Subparcela de Muestreo 1",
      "type": "SUBPARCELA",
      "shapeType": "CUADRADA",
      "dimension1M": 20,
      "centroidLatitude": 10.5251,
      "centroidLongitude": -66.8745
    }
  }'
{
  "id": "880e8400-e29b-41d4-a716-446655440003",
  "level4Id": "770e8400-e29b-41d4-a716-446655440002",
  "code": "SUBP-001",
  "name": "Subparcela de Muestreo 1",
  "type": "SUBPARCELA",
  "shapeType": "CUADRADA",
  "dimension1M": 20,
  "dimension2M": null,
  "dimension3M": null,
  "dimension4M": null,
  "areaM2": 400,
  "centroidLatitude": 10.5251,
  "centroidLongitude": -66.8745,
  "lastInfoDate": null,
  "isActive": true,
  "createdAt": "2024-01-15T10:45:00Z",
  "updatedAt": "2024-01-15T10:45:00Z",
  "level4": {
    "id": "770e8400-e29b-41d4-a716-446655440002",
    "code": "RODAL-01",
    "name": "Rodal Pino Caribe"
  }
}

Build docs developers (and LLMs) love