---
title: "Get Zone for Location"
method: POST
path: "/zone-groups/{id}/bounds/contains"
tags: ["Zone Groups"]
---

# Get Zone for Location

`POST /zone-groups/{id}/bounds/contains`

## Request

- Base URL: `https://api.smartroutes.io/v2`
- URL: `https://api.smartroutes.io/v2/zone-groups/{id}/bounds/contains`
- Auth: none declared

Finds which zone of a zone group contains a location, for example to work out a delivery area before you create an order. Pass the zone group `id` in the path. You can get it from `GET /zone-groups`.

Send `location.lat` and `location.lng` if you have them. If either is missing, the `address`, `postcode` and `country` are geocoded first. If the location can't be geocoded, you get `400 INVALID_INPUT`.

- If the point is inside a zone, the response is `{"zone": {"id", "name", "zone_group": {"id", "name"}}}`.
- If the point is outside every zone in the group, the response is `200` with `{"zone": null}`.
- If zones overlap, only one matching zone is returned.
- If the zone group doesn't exist in this depot, or has no zones, the response is `404 RESOURCE_NOT_FOUND`.

## Path parameters

- `id` number, required

## Request body

- object: Request body for checking availability for bookings.
  - `location` object, required: Location information for zone. If no lat, lng is provided, address or postcode is required.
    - `lat` number, float: Latitude of the location for booking availability.
    - `lng` number, float: Longitude of the location for booking availability.
    - `address` string: Address of the location for booking availability.
    - `postcode` string: Postcode of the location for booking availability.
    - `country` string: Country of the location for booking availability.

## Response `200`

Successful response

## Other responses

- `400`: Invalid input. The request body failed validation.
- `403`: Forbidden. Returned for rate-limit exhaustion (`name = FORBIDDEN`, with `details.retry_after_seconds` and `Retry-After` header) and permission gate failures (`name = PERMISSION`). Inspect `name` to disambiguate. Send `x-sr-api-features: rate-limit-429` to receive `429 RATE_LIMIT_EXCEEDED` for the rate-limit case instead, leaving `403` to mean permission failures only — see [API Features](#section/Getting-started/API-Features).
- `404`: The requested resource was not found.
- `429`: Rate limit exceeded (`name = RATE_LIMIT_EXCEEDED`). **Only returned to callers that opt in** with the `x-sr-api-features: rate-limit-429` request header; without it the same condition returns `403` with `name = FORBIDDEN` and an otherwise identical body. See [API Features](#section/Getting-started/API-Features).
- `500`: An unexpected server error occurred. The body carries only `name` and `description`: internal details are never returned.

---

[API](https://skmtc.dev/smartroutes/apis/smartroutes-api.md) · [All operations](https://skmtc.dev/smartroutes/apis/smartroutes-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smartroutes/apis/smartroutes-api/revisions/a7ea507afac7?raw)
