API reference · preview

REST API

Areas, comparisons, changes and metrics over HTTPS with JSON. Preview, subject to change.

Preview, subject to change. Base URL: https://api.koredeza.com/v1. Breaking changes will be announced to design partners before release.

Authentication

Send an API key as a bearer token. Keys are created per project and carry scopes.

curl https://api.koredeza.com/v1/areas \
  -H "Authorization: Bearer kd_test_5f2c...redacted"
API scopes
ScopeAllows
areas:readList and read areas and scenes
areas:writeCreate and update areas
comparisons:writeStart comparisons
changes:readList changes and metrics
webhooks:manageRegister and rotate webhook endpoints

Rate limits

Every response includes RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds). Exceeding the limit returns 429 with a Retry-After header.

Errors

Error codes
StatusCodeMeaning
400invalid_requestMalformed JSON or a missing field
401unauthenticatedMissing or invalid API key
403insufficient_scopeThe key lacks the scope for this call
404not_foundNo such object in this project
409conflictA comparison for the same scene pair is already running
422invalid_geometryThe polygon is self-intersecting or too large
429rate_limitedToo many requests; retry after the given time
500internal_errorSomething failed on our side; safe to retry
{
  "error": {
    "code": "invalid_geometry",
    "message": "Polygon ring self-intersects near vertex 14.",
    "request_id": "req_01JD8X2M4Q"
  }
}

POST/areas

Create an area of interest. Requires areas:write.

{
  "project_id": "prj_8c1f",
  "name": "North block lease",
  "geometry": {"type": "Polygon", "coordinates": [[[85.312, 21.884], [85.361, 21.884], [85.361, 21.921], [85.312, 21.921], [85.312, 21.884]]]},
  "sources": ["sentinel-2-l2a", "sentinel-1-grd"],
  "cadence": "every_pass",
  "boundary_layer_id": "lyr_lease_02"
}

Response 201 Created:

{
  "id": "area_2kq9",
  "name": "North block lease",
  "area_km2": 21.0,
  "status": "active",
  "created_at": "2026-11-20T09:14:03Z"
}

POST/areas/{area_id}/comparisons

Start a comparison between two dates. Requires comparisons:write. Returns immediately; results arrive by webhook or polling.

{
  "reference_date": "2026-02-11",
  "target_date": "2026-10-03",
  "min_area_ha": 0.25
}

Response 202 Accepted:

{
  "id": "cmp_7hx3",
  "area_id": "area_2kq9",
  "state": "queued",
  "model_version": "delta-s2-2026.11.1"
}

GET/changes

List changes with filters and cursor pagination. Requires changes:read.

Query parameters
ParameterDescription
area_idFilter by area
classe.g. excavation, clearing, structure
review_statepending, approved or rejected
sinceISO 8601 date; changes first seen on or after it
min_area_haMinimum polygon area
limit1 to 200, default 50
cursorOpaque cursor from next_cursor
GET /v1/changes?area_id=area_2kq9&review_state=approved&limit=2
{
  "data": [
    {
      "id": "chg_91ab",
      "area_id": "area_2kq9",
      "class": "excavation",
      "area_ha": 6.8,
      "confidence": 0.94,
      "first_seen": "2026-06-14",
      "review_state": "approved",
      "geometry": {"type": "Polygon", "coordinates": [[[85.318, 21.902], [85.326, 21.903], [85.327, 21.897], [85.318, 21.902]]]}
    }
  ],
  "next_cursor": "c_eyJvIjoyfQ",
  "has_more": true
}

GET/areas/{area_id}/metrics

Summary metrics for one area over a period. Requires changes:read.

GET /v1/areas/area_2kq9/metrics?from=2026-06-01&to=2026-10-31
{
  "area_id": "area_2kq9",
  "period": {"from": "2026-06-01", "to": "2026-10-31"},
  "scenes_used": 9,
  "mean_visible_pct": 58.2,
  "changes": {"pending": 2, "approved": 5, "rejected": 3},
  "approved_area_ha_by_class": {"excavation": 6.8, "dump": 3.1, "road": 1.6},
  "model_version": "delta-s2-2026.11.1"
}

All example values on this page are synthetic.

Webhooks

Register an HTTPS endpoint per project. Events are sent as JSON POST requests.

comparison.failed

{
  "id": "evt_3m2p",
  "type": "comparison.failed",
  "created_at": "2026-11-21T06:02:11Z",
  "data": {
    "comparison_id": "cmp_7hx3",
    "area_id": "area_2kq9",
    "reason": "insufficient_visible_area",
    "visible_pct": 7.5
  }
}

model.drift_detected

{
  "id": "evt_3m2q",
  "type": "model.drift_detected",
  "created_at": "2026-11-21T06:05:40Z",
  "data": {
    "area_id": "area_2kq9",
    "model_version": "delta-s2-2026.11.1",
    "signal": "rejection_rate",
    "window_days": 30,
    "value": 0.41,
    "threshold": 0.25
  }
}

Verifying signatures

Each request carries Koredeza-Signature: t=<unix time>,v1=<hex>. Compute HMAC-SHA256 over <t>.<raw body> with your endpoint secret, compare in constant time, and reject timestamps older than five minutes.

import hmac, hashlib, time

def verify(raw_body: bytes, header: str, secret: str) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    t, sig = parts["t"], parts["v1"]
    if abs(time.time() - int(t)) > 300:
        return False
    mac = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(mac, sig)

Retries

Respond with any 2xx within 10 seconds. Otherwise we retry with exponential backoff (1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours) and then mark the delivery failed. Use the event id to deduplicate.