Skip to content
Track That Ride
Menu

API documentation

Zones API

Zones are named delivery areas. You create a zone with a name and, optionally, a GeoJSON polygon boundary; Track That Ride then works out which zone a delivery address falls in and can limit which drivers are offered for it. Assign drivers to zones through the drivers API.

Looking for every endpoint and schema in one place? See the Full OpenAPI reference.

Endpoints

Method and path What it does Key permission
GET /api/v1/zones List Zones Query: search, sortBy, sortOrder zones:read
GET /api/v1/zones/{id} Get Zone Details zones:read
POST /api/v1/zones Create Zone zones:write
PUT /api/v1/zones/{id} Update Zone zones:write
DELETE /api/v1/zones/{id} Delete Zone zones:delete

Creating a zone

curl -X POST https://trackthatride.com/api/v1/zones \
  -H "Authorization: Bearer $TTR_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "Central",
    "color": "#ff9900",
    "boundary": {
      "type": "Polygon",
      "coordinates": [[[-0.15, 51.50], [-0.10, 51.50], [-0.10, 51.53], [-0.15, 51.53], [-0.15, 51.50]]]
    }
  }'

name is required. boundary is a GeoJSON Polygon or MultiPolygon with coordinates as [longitude, latitude] and at most 500 points. An invalid boundary returns 400 with "code": "INVALID_BOUNDARY" and a list of problems. The zone’s centre is calculated for you.