# The connection's managed DNS zone

> The connection's managed DNS zone: CustomDomain™ API reference in the managed dns group. Covers request parameters, the request body, responses and error codes.

Source: https://docs.customdomain.ai/docs/api-reference/managed-dns/getManagedDNS

## `GET https://api.customdomain.ai/v1/connections/{id}/managed-dns`

The hosted zone's status, the nameservers to set at the registrar, what the registry currently lists, the registrar, every record, and notes to show the user. Poll it while `status` is `awaiting_delegation`. 404 when managed DNS was never started for this connection. A widget token reads it only for its own end user's connection and only when the zone is that end user's (every connection linked to it is the token's, as for the start above); otherwise it gets 403 or 409 and none of the zone.

### Authentication

`apiKey`, `widgetJWT`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Responses

| Status | Description |
| --- | --- |
| `200` | The zone |
| `401` | Error envelope: {code, title, details}. |
| `403` | `token_wrong_end_user`: a widget token whose end user is not the connection's (mint a token with this domain's `end_user_ref`). |
| `404` | Error envelope: {code, title, details}. |
| `409` | A widget token only: the zone is hosted for someone else, because not every connection linked to it is the token's. |
| `503` | Error envelope: {code, title, details}. |

### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `zone` | string | yes | The hosted zone: the registrable domain. |
| `status` | `awaiting_delegation`, `active`, `failed` | yes | `awaiting_delegation`: the zone holds the records; set the nameservers below at the registrar. `active`: every nameserver the registry lists is ours. `failed`: the switch never happened within 14 days, or the nameservers moved away again (the first warning says which); a failed zone keeps being checked and turns active once the delegation appears. |
| `nameservers` | array of string | yes | The nameservers to set at the registrar. |
| `observed_nameservers` | array of string | yes | The nameservers the registry listed at the last check. |
| `registrar` | object | yes | The domain's registrar, or null when unknown. |
| `records` | array of object | yes |  |
| `warnings` | array of string | yes | Plain-language notes for the user (a partial delegation, records a zone file import skipped, records replaced). |
| `checked_at` | string | yes | When the delegation was last checked. |
| `activated_at` | string or null | yes |  |

The full specification is served at `GET https://api.customdomain.ai/v1/openapi.json`.
