Skip to main content

List Zones

Query Parameters

page
integer
default:"1"
Page number (minimum: 1)
limit
integer
default:"10"
Items per page (minimum: 1, maximum: 100)
cityId
string
Filter zones by city UUID
q
string
Free text search by name (case-insensitive)
name
string
Filter by exact name
kind
string
Filter by zone kind/type
priorityGte
integer
Filter zones with priority greater than or equal to this value
active
boolean
Filter by active status

Response

Returns a paginated list of zones with metadata.

Get Zone by ID

Path Parameters

id
string
required
Zone UUID

Response

Returns the zone details including geometry.

Create Zone

Body Parameters

cityId
string
required
UUID of the city this zone belongs to
name
string
required
Zone name (max 120 characters)
kind
string
Zone type or category (max 60 characters)
priority
integer
default:"0"
Zone priority (0-100000). Higher priority zones take precedence
geom
object
required
GeoJSON MultiPolygon representing the zone boundaries
active
boolean
default:"true"
Whether the zone is active

Response

status
string
Response status
data
object
The created zone object

Error Responses

  • 409 Conflict: Zone already exists in this city (cityId + name combination)
  • 400 Bad Request: Validation error

Update Zone

Path Parameters

id
string
required
Zone UUID

Body Parameters

All parameters are optional (partial update):
cityId
string
UUID of the city this zone belongs to
name
string
Zone name (max 120 characters)
kind
string
Zone type or category
priority
integer
Zone priority (0-100000)
geom
object
GeoJSON MultiPolygon representing the zone boundaries
active
boolean
Whether the zone is active

Response

Returns the updated zone object.

Error Responses

  • 409 Conflict: Another zone with that name already exists in this city
  • 400 Bad Request: Validation error

Set Active Status

Path Parameters

id
string
required
Zone UUID

Body Parameters

active
boolean
required
Set to true to activate, false to deactivate

Response

Returns the updated zone with new active status.

Resolve Zone by Point

Query Parameters

cityId
string
required
UUID of the city to search within
lat
number
required
Latitude coordinate
lng
number
required
Longitude coordinate

Response

Returns the best matching zone containing the point (based on priority), or null if no zone is found.

Example Request

curl "https://api.rodando.com/zones/resolve/by-point?cityId=a1b2c3d4-5678-90ab-cdef-1234567890ab&lat=19.4326&lng=-99.1332"

Example Response

{
  "success": true,
  "message": "Zone resolved",
  "data": {
    "id": "b2c3d4e5-6789-01ab-cdef-234567890abc",
    "cityId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
    "name": "Zona Centro",
    "kind": "downtown",
    "priority": 100,
    "active": true,
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T10:30:00Z"
  }
}
If no zone contains the point:
{
  "success": true,
  "message": "No zone found",
  "data": null
}

Priority-Based Resolution

When multiple zones overlap at the same point, the zone with the highest priority value is returned. This allows you to:
  • Define general zones with lower priority (e.g., “North District” with priority 50)
  • Override with specific high-priority zones (e.g., “Airport Zone” with priority 200)

Use Cases

This endpoint is essential for:
  • Dynamic pricing - Apply zone-specific pricing policies
  • Surge pricing - Identify high-demand zones
  • Service restrictions - Enforce zone-specific service rules
  • Trip routing - Determine pickup and dropoff zone information
This endpoint uses PostGIS spatial queries and returns the zone with the highest priority value among all zones that contain the point. Only active zones are considered.

Build docs developers (and LLMs) love