post
/api/v2/zones/metadata/contained-zones
Python SDK method:
client.zone_metadata.contained_zones(params).run()

Start contained zones job

Creates a contained zones job. Finds all zones of a given type that are geographically contained within a set of parent zones.

Altitude Help Center — getContainedZones

Request Body

Contained zones query parameters.

application/json: object

NameTypeInput ShapeValuesDescriptionValue Required
asOfDatestring--OSM basemap version date in YYYY-MM-DD format. Omit to use the most recent month.N
buffernumber (double)--Buffer distance in metres applied around the parent zone boundary before finding contained zones. Omit to use no buffer.N
customZoneSubTypesarray<string>--Custom zone sub-type IDs to filter results. An empty array includes all sub-types. Applies only when requestZoneTypes contains 'Custom'.N
excludeServiceRoadsboolean--When true, service road categories are excluded. Applies only when requestZoneTypes contains 'Segment'.N
isMetricboolean--Override the requesting user's unit preference. Omit to use the user's stored preference.N
relatedRoadTypesarray<RoadType>-living_street, motorway, motorway_link, primary, primary_link, residential, road, secondary, secondary_link, service, tertiary, tertiary_link, trunk, trunk_link, unclassifiedRoad types for related-road segments. Applies only when requestZoneTypes contains 'RelatedRoad'.N
requestZoneTypesarray<ZoneType>-Country, State, County, City, FSA, ZIP, TAZ, CTR, Custom, Segment, RelatedRoadZone types of the contained zones to return. An empty array returns all zone types.N
roadTypesarray<RoadType>-living_street, motorway, motorway_link, primary, primary_link, residential, road, secondary, secondary_link, service, tertiary, tertiary_link, trunk, trunk_link, unclassifiedOSM road types to include when requestZoneTypes contains 'Segment'. An empty array includes all road types.N
zoneIdsarray<string>--Encoded zone ID strings. Provide exactly one of zoneIds or zones (not both).N
zonesarray<object>code: string; iso_3166_2: string; type: string-Zone objects with code, type, and iso_3166_2. Provide exactly one of zones or zoneIds (not both).N

Examples

Contained zones request

Translated from the v1 getContainedZones sample.

{
  "isMetric": false,
  "requestZoneTypes": [
    "County"
  ],
  "zones": [
    {
      "code": "US-GA",
      "iso_3166_2": "US-GA",
      "type": "State"
    }
  ]
}

Success Responses

202 response: object

Job accepted and queued for processing. Poll the location header URL to check status.

NameTypeDescription
errorobjectDetails about why the job failed (RFC 7807 format), or null if it succeeded.
idstringUnique job identifier.
linksobjectNavigation URLs for polling and result retrieval.
statusstringCurrent job lifecycle state: PENDING, QUEUED, RUNNING, DONE, FAILED, CANCELED, or NOT_FOUND.

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.
409The operation conflicts with the current state of the resource.
422The request is syntactically valid but semantically cannot be processed.
429The request rate limit has been exceeded.
500An unexpected server error occurred.