Skip to main content
GET
/
api
/
forest
/
patrimony
curl -X GET "https://api.confor.app/api/forest/patrimony?level=3&parentId=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "items": [
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "level2Id": "550e8400-e29b-41d4-a716-446655440000",
      "code": "COMP-A",
      "name": "Compartimiento Norte",
      "type": "COMPARTIMIENTO",
      "totalAreaHa": 450.25,
      "centroidLatitude": 10.52,
      "centroidLongitude": -66.88,
      "lastInfoDate": "2024-01-10T00:00:00Z",
      "isActive": true,
      "createdAt": "2024-01-15T10:35:00Z",
      "updatedAt": "2024-01-15T10:35:00Z",
      "level2": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "code": "FINCA-001",
        "name": "La Esperanza"
      }
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "totalPages": 1
  }
}

Overview

Level 3 represents compartments, blocks, or sections within Level 2 patrimony units. These are subdivisions that help organize large land holdings into manageable areas.

Hierarchy

Level 2 (FINCA, PREDIO, etc.)
  └─ Level 3 (COMPARTIMIENTO, BLOCK, etc.) ← You are here
      └─ Level 4 (Stands, Parcels, Management Units)
          └─ Level 5 (Reference Units, Sub-parcels)
Parent Relationship: Each Level 3 unit must belong to a Level 2 unit via level2Id.

List Level 3 Units

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

Response

items
array
id
string
Unique identifier (UUID)
level2Id
string
Parent Level 2 unit ID (UUID)
code
string
Unique code for the unit (max 80 characters, unique within parent)
name
string
Name of the compartment
type
enum
Type of compartment. Possible values:
  • COMPARTIMIENTO - Compartment
  • BLOCK - Block
  • SECCION - Section
  • LOTE - Lot
  • ZONA - Zone
  • BLOQUE - Block (alternative)
  • ZONIFICACION - Zoning
totalAreaHa
number
Total area in hectares
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
level2
object
Parent Level 2 unit information
id
string
Level 2 ID
code
string
Level 2 code
name
string
Level 2 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=3&parentId=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "items": [
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "level2Id": "550e8400-e29b-41d4-a716-446655440000",
      "code": "COMP-A",
      "name": "Compartimiento Norte",
      "type": "COMPARTIMIENTO",
      "totalAreaHa": 450.25,
      "centroidLatitude": 10.52,
      "centroidLongitude": -66.88,
      "lastInfoDate": "2024-01-10T00:00:00Z",
      "isActive": true,
      "createdAt": "2024-01-15T10:35:00Z",
      "updatedAt": "2024-01-15T10:35:00Z",
      "level2": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "code": "FINCA-001",
        "name": "La Esperanza"
      }
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "totalPages": 1
  }
}

Create Level 3 Unit

Request Body

level
string
required
Must be set to "3" to create a Level 3 unit
data
object
required
level2Id
string
required
Parent Level 2 unit ID (UUID)
code
string
required
Unique code within parent (1-80 characters)
name
string
required
Name of the compartment (2-255 characters)
type
enum
required
Type: COMPARTIMIENTO, BLOCK, SECCION, LOTE, ZONA, BLOQUE, ZONIFICACION
totalAreaHa
number
required
Total area in hectares (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

Response

Returns the created Level 3 unit with status code 201, including the parent Level 2 information.
curl -X POST "https://api.confor.app/api/forest/patrimony" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "level": "3",
    "data": {
      "level2Id": "550e8400-e29b-41d4-a716-446655440000",
      "code": "COMP-A",
      "name": "Compartimiento Norte",
      "type": "COMPARTIMIENTO",
      "totalAreaHa": 450.25,
      "centroidLatitude": 10.52,
      "centroidLongitude": -66.88
    }
  }'
{
  "id": "660e8400-e29b-41d4-a716-446655440001",
  "level2Id": "550e8400-e29b-41d4-a716-446655440000",
  "code": "COMP-A",
  "name": "Compartimiento Norte",
  "type": "COMPARTIMIENTO",
  "totalAreaHa": 450.25,
  "centroidLatitude": 10.52,
  "centroidLongitude": -66.88,
  "lastInfoDate": null,
  "isActive": true,
  "createdAt": "2024-01-15T10:35:00Z",
  "updatedAt": "2024-01-15T10:35:00Z",
  "level2": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "code": "FINCA-001",
    "name": "La Esperanza"
  }
}

Build docs developers (and LLMs) love