post
/api/v2/zones/by-hierarchyPython SDK method:
client.zones.by_hierarchy(params).run()Start zones by hierarchy job
Creates a zones by hierarchy job. Returns zones of the requested type within the context of the input zones based on geography-based country hierarchies. Only 'State', 'County', and 'City' zone types are accepted — for example, pass in California to get all counties or cities within it.
Altitude Help Center — getStandardZonesByHierarchyRequest Body
zones by hierarchy parameters.
application/json: object
| Name | Type | Input Shape | Values | Description | Value Required |
|---|---|---|---|---|---|
zoneIds | array<string> | - | - | Encoded zone ID strings. Provide exactly one of zoneIds or zones (not both). | N |
zoneType | string | - | - | Zone type of the child zones to return in the hierarchy (e.g. 'County' returns all counties within the selected states). | Y |
zones | array<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
State hierarchy request
Translated from the v1 getStandardZonesByHierarchy sample.
{
"zoneType": "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.
| Name | Type | Description |
|---|---|---|
error | object | Details about why the job failed (RFC 7807 format), or null if it succeeded. |
id | string | Unique job identifier. |
links | object | Navigation URLs for polling and result retrieval. |
status | string | Current job lifecycle state: PENDING, QUEUED, RUNNING, DONE, FAILED, CANCELED, or NOT_FOUND. |
Response Errors
| HTTP Status Code | Reason |
|---|---|
| 400 | The request body or parameters are invalid. |
| 401 | Authentication is required or the provided credentials are invalid. |
| 403 | The authenticated user lacks permission to perform this operation. |
| 409 | The operation conflicts with the current state of the resource. |
| 422 | The request is syntactically valid but semantically cannot be processed. |
| 429 | The request rate limit has been exceeded. |
| 500 | An unexpected server error occurred. |