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.