post
/api/v2/zones/custom
Python SDK method:
client.custom_zones.create(params)

Create custom zone

Creates a new custom zone in the authenticated user's database. Returns the created zone as a GeoJSON Feature with ZoneMetadata properties. The zone's geometry is defined in the request body.

Altitude Help Center — createCustomZone

Request Body

Custom zone definition.

application/json: object

NameTypeInput ShapeValuesDescriptionValue Required
commentsstring--Optional notes about the purpose or content of the zone.N
customZoneTypeIdsarray<string>--Sub-type IDs to assign to the new custom zone. At least one is required.Y
customerZoneIdstring--Customer-defined external identifier for the zone. Used to correlate with external systems.Y
geographystring--GeoJSON geometry string (Polygon or MultiPolygon) defining the zone boundary.Y
namestring--Display name for the new custom zone.Y

Examples

Create custom zone request

Translated from the v1 createCustomZone sample with a v2 GeoJSON geometry string.

{
  "comments": "Example custom zone",
  "customZoneTypeIds": [
    "fuel-stop"
  ],
  "customerZoneId": "customer-zone-001",
  "geography": "{\"type\":\"Polygon\",\"coordinates\":[[[-115.3,36.1],[-115.2,36.1],[-115.2,36.2],[-115.3,36.2],[-115.3,36.1]]]}",
  "name": "Example Fuel Stop"
}

Success Responses

201 response: object

Resource created.

NameTypeDescription
bboxarray<number (double)>Bounding box [west, south, east, north].
geometryobjectGeoJSON geometry object representing the zone boundary.
propertiesobjectZone metadata object containing the zone's identity, type, display name, and type-specific details.
typestringAlways "Feature".

Response Errors

HTTP Status CodeReason
400The request body or parameters are invalid.
401Authentication is required or the provided credentials are invalid.
403The authenticated user lacks permission to perform this operation.
422The request is syntactically valid but semantically cannot be processed.
429The request rate limit has been exceeded.
500An unexpected server error occurred.