Skip to main content
Before committing a polygon to a full ingestion pipeline, you can use this endpoint to run an on-the-fly deforestation risk pre-assessment. Submit a GeoJSON geometry and AgriBackup will query the Country Risk Matrix and execute a live Sentinel-2 NDVI analysis, returning a risk classification and satellite metrics without creating any persisted records or consuming batch quota. POST /api/v1/enterprise/eudr/risk/assess-polygon

Request Body

geoJson
object
required
A valid GeoJSON geometry object representing the polygon to assess. The object must conform to the GeoJSON specification (RFC 7946). Coordinates are expressed as [longitude, latitude] pairs, and the polygon ring must be closed (first and last coordinate must match).
{
  "type": "Polygon",
  "coordinates": [
    [
      [36.80, -1.30],
      [36.85, -1.30],
      [36.85, -1.25],
      [36.80, -1.25],
      [36.80, -1.30]
    ]
  ]
}

Code Examples

import agribackup
from agribackup.rest import ApiException

configuration = agribackup.Configuration(host="https://live.agribackup.com/api/v1")
configuration.api_key["ApiKeyAuth"] = "sk_live_YOUR_API_KEY"

payload = {
    "geoJson": {
        "type": "Polygon",
        "coordinates": [
            [
                [36.80, -1.30],
                [36.85, -1.30],
                [36.85, -1.25],
                [36.80, -1.25],
                [36.80, -1.30]
            ]
        ]
    }
}

with agribackup.ApiClient(configuration) as api_client:
    try:
        api_instance = agribackup.EnterpriseRiskManagementApi(api_client)
        response = api_instance.assess_polygon_risk(body=payload)
        print(response)
    except ApiException as e:
        print("Exception when calling API: %s\n" % e)
import { AgriBackupClient } from "@agribackup/sdk";

const client = new AgriBackupClient({
  apiKey: "sk_live_YOUR_API_KEY",
  baseUrl: "https://live.agribackup.com/api/v1",
});

async function assessPolygonRisk() {
  try {
    const response = await client.management.assessPolygonRisk({
      geoJson: {
        type: "Polygon",
        coordinates: [
          [
            [36.80, -1.30],
            [36.85, -1.30],
            [36.85, -1.25],
            [36.80, -1.25],
            [36.80, -1.30],
          ],
        ],
      },
    });
    console.log(response);
  } catch (error) {
    console.error(error);
  }
}

assessPolygonRisk();
curl --request POST \
  --url https://live.agribackup.com/api/v1/enterprise/eudr/risk/assess-polygon \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer sk_live_YOUR_API_KEY" \
  --data '{
    "geoJson": {
      "type": "Polygon",
      "coordinates": [
        [
          [36.80, -1.30],
          [36.85, -1.30],
          [36.85, -1.25],
          [36.80, -1.25],
          [36.80, -1.30]
        ]
      ]
    }
  }'

Response

A 200 OK response indicates the risk assessment completed synchronously. The body contains satellite NDVI metrics, the country risk classification, and a deforestation probability score.
{
  "countryCode": "KEN",
  "countryName": "Kenya",
  "countryRiskLevel": "STANDARD",
  "countryRiskJustification": "Standard default risk assigned",
  "satelliteAnalysisState": "COMPLETED",
  "deforestationDetected": false,
  "deforestationProbability": 0.05,
  "ndviBaseline": 0.72,
  "ndviCurrent": 0.70,
  "ndviChange": -0.02,
  "dataSource": "COPERNICUS-SENTINEL-2"
}
countryCode
string
ISO-3166-1 alpha-3 country code detected from the polygon’s centroid (e.g., KEN, BRA, IDN). May be null if the coordinate falls in international waters or an unmapped territory.
countryName
string
Human-readable name of the detected country. May be null in the same circumstances as countryCode.
countryRiskLevel
string
The EUDR Country Risk Matrix classification for the detected country. One of LOW, STANDARD, or HIGH. HIGH risk countries require additional due-diligence evidence before a DDS can be submitted.
countryRiskJustification
string
A plain-language explanation for the assigned risk level, derived from the Country Risk Matrix dataset.
satelliteAnalysisState
string
Indicates the completion state of the Sentinel-2 analysis. Possible values:
  • COMPLETED — analysis finished successfully
  • PHASE_2_SAR_FAILOVER_PENDING — optical imagery was insufficient; SAR fallback is queued
  • UNSUPPORTED_OR_EMPTY_ACQUISITION — no satellite data is available for this geometry
deforestationDetected
boolean
true if on-the-fly analysis triggered a deforestation alert for the submitted polygon; false otherwise.
deforestationProbability
number
A decimal value between 0.0 and 1.0 representing the NDVI-derived probability of deforestation activity. Values above 0.30 should be treated as elevated risk.
ndviBaseline
number
The historical baseline NDVI index for the polygon area, used as the reference point for change detection.
ndviCurrent
number
The most recent NDVI index reading from the latest Sentinel-2 acquisition over the polygon.
ndviChange
number
The delta between ndviCurrent and ndviBaseline. Negative values indicate vegetation loss. Values below -0.10 warrant closer inspection.
dataSource
string
The satellite programme used for analysis, typically COPERNICUS-SENTINEL-2. Fallback analyses may report SENTINEL_1_SAR.

Error Responses

HTTP StatusError CodeDescription
400 Bad RequestVALIDATION_FAILEDThe geoJson field is missing, malformed, or the polygon coordinates are invalid (e.g., ring not closed, self-intersecting).
401 UnauthorizedUNAUTHORIZEDThe Authorization header is missing or the bearer token is not recognised.
403 ForbiddenFORBIDDENYour API key does not have the required scope to access risk assessment endpoints.
429 Too Many RequestsRATE_LIMITEDYou have exceeded the hourly rate limit. Check the X-RateLimit-Reset response header for the UTC epoch second at which your quota resets.
{
  "code": "VALIDATION_FAILED",
  "message": "Invalid polygon coordinates",
  "details": [
    {
      "code": "INVALID_COORDINATE_CLOSURE",
      "field": "geoJson.coordinates[0]",
      "issue": "Polygon ring is not closed — the first and last coordinate must be identical."
    }
  ]
}