Skip to main content

Export Zones

Export delivery zones configured for your organization.

GET /integrations/yango/zones/export

Request

Query Parameters

ParameterTypeRequiredDescription
formatstringNoExport format: json (default) or csv

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

Use Cases

  • Reconcile zones with external systems
  • Backup zone configurations
  • Analyze zone coverage
  • Import zones into GIS tools

Examples

JSON Format

cURL

curl -X GET "https://api.courimax.com/api/integrations/yango/zones/export" \
-H "X-API-Key: cmx_your_api_key"

JavaScript (Fetch)

const response = await fetch(
'https://api.courimax.com/api/integrations/yango/zones/export',
{
headers: {
'X-API-Key': 'cmx_your_api_key'
}
}
);

const zones = await response.json();
console.log(zones);

Python (Requests)

import requests

response = requests.get(
'https://api.courimax.com/api/integrations/yango/zones/export',
headers={
'X-API-Key': 'cmx_your_api_key'
}
)

zones = response.json()
print(zones)

CSV Format

cURL

curl -X GET "https://api.courimax.com/api/integrations/yango/zones/export?format=csv" \
-H "X-API-Key: cmx_your_api_key" \
-o zones.csv

JavaScript (Fetch)

const response = await fetch(
'https://api.courimax.com/api/integrations/yango/zones/export?format=csv',
{
headers: {
'X-API-Key': 'cmx_your_api_key'
}
}
);

const csvText = await response.text();
console.log(csvText);

Python (Requests)

import requests

response = requests.get(
'https://api.courimax.com/api/integrations/yango/zones/export',
headers={
'X-API-Key': 'cmx_your_api_key'
},
params={'format': 'csv'}
)

# Save to file
with open('zones.csv', 'w') as f:
f.write(response.text)

Response

JSON Format (200 OK)

{
"format": "json",
"organizationId": "org-uuid",
"generatedAt": "2026-08-19T10:00:00.000Z",
"zones": [
{
"name": "TLV-CENTER",
"slug": "tlv-center",
"isActive": true,
"polygon": [
{ "lat": 32.0639, "lng": 34.7742 },
{ "lat": 32.0753, "lng": 34.7749 },
{ "lat": 32.0800, "lng": 34.7800 },
{ "lat": 32.0639, "lng": 34.7742 }
],
"metadata": {
"city": "Tel Aviv",
"region": "Center"
}
},
{
"name": "TLV-NORTH",
"slug": "tlv-north",
"isActive": true,
"polygon": [
{ "lat": 32.1000, "lng": 34.8000 },
{ "lat": 32.1100, "lng": 34.8100 },
{ "lat": 32.1200, "lng": 34.8200 },
{ "lat": 32.1000, "lng": 34.8000 }
],
"metadata": {
"city": "Tel Aviv",
"region": "North"
}
}
]
}

CSV Format (200 OK)

name,slug,isActive,polygon,metadata
TLV-CENTER,tlv-center,true,"[[32.0639,34.7742],[32.0753,34.7749],[32.0800,34.7800],[32.0639,34.7742]]","{""city"":""Tel Aviv"",""region"":""Center""}"
TLV-NORTH,tlv-north,true,"[[32.1000,34.8000],[32.1100,34.8100],[32.1200,34.8200],[32.1000,34.8000]]","{""city"":""Tel Aviv"",""region"":""North""}"

Response headers for CSV:

Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="courimax-zones.csv"

Response Fields (JSON)

FieldTypeDescription
formatstringExport format (json or csv)
organizationIdstringOrganization ID
generatedAtstringExport timestamp (ISO 8601)
zonesarrayList of zones
zones[].namestringZone name
zones[].slugstringZone slug (URL-safe identifier)
zones[].isActivebooleanWhether zone is active
zones[].polygonarrayPolygon coordinates defining zone boundary
zones[].polygon[].latnumberLatitude
zones[].polygon[].lngnumberLongitude
zones[].metadataobjectAdditional zone metadata

Error Responses

401 Unauthorized - Missing or invalid API key

{
"statusCode": 401,
"message": "Missing X-API-Key header",
"error": "Unauthorized"
}

403 Forbidden - API key not associated with Yango integration

{
"statusCode": 403,
"message": "API key does not match Yango integration",
"error": "Forbidden"
}

Zone Polygons

Zone polygons are defined as arrays of latitude/longitude coordinates that form a closed polygon. The first and last coordinates should be the same to close the polygon.

GeoJSON Conversion

Convert Courimax polygons to GeoJSON:

function toGeoJSON(zone) {
return {
type: 'Feature',
properties: {
name: zone.name,
slug: zone.slug,
isActive: zone.isActive
},
geometry: {
type: 'Polygon',
coordinates: [
zone.polygon.map(p => [p.lng, p.lat])
]
}
};
}

const geojson = {
type: 'FeatureCollection',
features: zones.zones.map(toGeoJSON)
};

Next Steps