---
title: "Validate a GeoJSON polygon"
method: POST
path: "/v1/geofences/validate"
tags: ["Geofences"]
---

# Validate a GeoJSON polygon

`POST /v1/geofences/validate`

## Request

- Base URL: `https://geo.thinair.co`
- URL: `https://geo.thinair.co/v1/geofences/validate`
- Auth: HTTP bearer

Check a caller-supplied GeoJSON polygon for well-formedness: ring closure, minimum vertex count, self-intersection, winding order (RFC 7946 right-hand rule), coordinate bounds, and complexity limits. Pure geometry — costs 0 quota units. A malformed polygon is NOT a 400; it returns `valid: false` with structured `errors`. Winding-order issues surface as `warnings` (containment is winding-agnostic).

## Request body

- GeofenceValidateRequest
  - `polygon` union, required: A GeoJSON Polygon / MultiPolygon geometry, a Feature wrapping one, or a FeatureCollection of them. Ring geometry is validated server-side (closure, winding, self-intersection, complexity limits).
    - object
      - `type` 'Polygon', required
      - `coordinates` array[], required
        - array[]
          - number[]
    - object
      - `type` 'MultiPolygon', required
      - `coordinates` array[], required
        - array[]
          - array[]
            - number[]
    - object
      - `type` 'Feature', required
      - `geometry` object, required
        - `type` string, required
      - `properties` object, nullable
    - object
      - `type` 'FeatureCollection', required
      - `features` object[], required
        - `type` 'Feature', required
        - `geometry` object, required
          - `type` string, required
        - `properties` object, nullable

## Response `200`

Validation report. `valid: false` + errors on a malformed polygon (still a 200).

- GeofenceValidateResponse
  - `valid` boolean, required
  - `errors` string[], required
  - `warnings` string[], required

## Other responses

- `400`: Invalid request body (non-JSON or schema mismatch).
- `429`: Quota exceeded for this tenant.

---

[API](https://skmtc.dev/thinair/apis/thinair-geo-api.md) · [All operations](https://skmtc.dev/thinair/apis/thinair-geo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thinair/apis/thinair-geo-api/revisions/8fac2d5e4b34?raw)
