Boundaries

Boundary detection is a helper endpoint that proxies an external field-boundary detection service: give it a coordinate, get back a candidate field boundary you can then use as the boundary value when creating a Field. It's a standalone lookup, not a CRUD resource — there's no boundary object to list, retrieve, or delete. For the base URL, the response envelope, and permission errors, see Farm Management Overview.

Two endpoints, not one

There are two distinct boundary-detection endpoints, with different query parameter names and different auth requirements. They are not versions of the same contract — pick the one that matches your auth setup and use its exact parameter names.

EndpointAuthQuery paramsNotes
GET /boundary/detect-boundary/ (v1)None — public?lat=&lng=Proxies the external field-boundary detection service
GET /detect-boundary/ (v2)Bearer token required?latitude=&longitude=Authenticated equivalent; permission slug boundary.field_boundary

The v2 endpoint's exact resolved path (/detect-boundary/, with no boundary/ prefix — it's mounted at a bare root path, not nested under boundary/ like v1) is inferred from router registration mechanics, not independently confirmed by a live request. Verify with a real call before hard-committing to this exact path in integration code.

Auth

The v1 endpoint (/boundary/detect-boundary/) is intentionally public — no token, no permission check. Anyone with the URL can call it.

The v2 endpoint (/detect-boundary/) requires a Bearer token — see Farm Management Overview for how to send one — plus the boundary.field_boundary dynamic permission. A request with a valid token but missing that permission gets the structured 403 body described in Farm Management Overview.

Response shape

Both endpoints return the same shape.

Success — 200:

{
  "status": "success",
  "message": "Operation successful.",
  "data": {
    "...": "detection result, provider-defined"
  }
}

Both endpoints catch broad, unfiltered exceptions internally. Any failure — including one unrelated to "no boundary found," such as the upstream detection service being unreachable — comes back as the same 404 with the same generic message:

{
  "status": "error",
  "message": "No Field Boundary Available",
  "details": {}
}

Don't treat a 404 here as a reliable "genuinely no boundary at this coordinate" signal — it's also what you get for an unrelated internal error.

Request examples

v1 (public, no auth):

curl -X GET "https://backend.spacenus.de/api/v1.2/boundary/detect-boundary/?lat=52.5200&lng=13.4050"

v2 (authenticated):

curl -X GET "https://backend.spacenus.de/api/v1.2/detect-boundary/?latitude=52.5200&longitude=13.4050" \
  -H "Authorization: Bearer YOUR_TOKEN"