# Zones endpoints

Every path starts at your [API URL](https://docs.qualithm.com/api.md#find-your-api-url). Every response is JSON, and an error has the [error body](https://docs.qualithm.com/api.md#errors).

## List the environment's zones and their public endpoints

`GET /v1/zones`

Needs no credential.

**Response:** `200` with [ZoneList](#zonelist) in `data`.

**[Errors](https://docs.qualithm.com/api.md#errors):** `429`, `500`, `503`

```bash
curl "<your-api-url>/v1/zones"
```

## Types

### ZoneList

The environment's public endpoints.

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `api` | string | Yes | The global API host |
| `zones` | array of [Zone](#zone) | Yes | Every zone, open zones first |

### Zone

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `id` | [ZoneId](#zoneid) | Yes |  |
| `name` | string | Yes |  |
| `open` | boolean | Yes | Whether the zone accepts new scopes in this environment |
| `api` | string | Yes | The zone's regional API host |
| `gateway` | [GatewayEndpoint](#gatewayendpoint) | Yes |  |

### ZoneId

A device zone: where a scope's devices connect and their data lives.

one of `"de-fra-a"`, `"sg-sin-a"`, `"us-nyc-a"`.

### GatewayEndpoint

Where a device connects: a zone's MQTT gateway.

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `host` | string | Yes |  |
| `port` | integer (int64) | Yes |  |
