# Client API: Deployments: Domains

> The 4 Client API operations for domains.

Source: https://www.coritan.com/docs/api/reference/client/deployments/deployments-domains/

Part of [Deployments](/docs/api/reference/client/deployments/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/client/deployments/{deployment_uuid}/domains`](#op-get-api-v1-client-deployments-deployment-uuid-domains) | List domains |
| POST | [`/api/v1/client/deployments/{deployment_uuid}/domains`](#op-post-api-v1-client-deployments-deployment-uuid-domains) | Add a custom domain |
| DELETE | [`/api/v1/client/deployments/{deployment_uuid}/domains/{hostname}`](#op-delete-api-v1-client-deployments-deployment-uuid-domains-hostname) | Remove domain |
| POST | [`/api/v1/client/deployments/{deployment_uuid}/domains/{hostname}/verify`](#op-post-api-v1-client-deployments-deployment-uuid-domains-hostname-verify) | Look for the domain's TXT record (outside any transaction) |

### List domains {#op-get-api-v1-client-deployments-deployment-uuid-domains}

`GET /api/v1/client/deployments/{deployment_uuid}/domains`

The deployment's domains: its platform name first, then its custom
domains, each saying whether it is verified and whether its certificate
is issued; an unverified one carries the TXT record in
``verification``. ``limits.custom_domains`` is how many custom domains
it may have: none for a template, whose addresses are its servers'.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `deployment_uuid` | path | string (uuid) | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Add a custom domain {#op-post-api-v1-client-deployments-deployment-uuid-domains}

`POST /api/v1/client/deployments/{deployment_uuid}/domains`

Add a custom domain. It gets no route until the TXT record in
``verification`` is published and checked.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `deployment_uuid` | path | string (uuid) | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `hostname` | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Remove domain {#op-delete-api-v1-client-deployments-deployment-uuid-domains-hostname}

`DELETE /api/v1/client/deployments/{deployment_uuid}/domains/{hostname}`

Remove a custom domain: the hostname stops reaching the deployment,
and its route and certificate are deleted. The platform name cannot be
removed (409 ``platform_domain``).

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `deployment_uuid` | path | string (uuid) | yes |
| `hostname` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Look for the domain's TXT record (outside any transaction) {#op-post-api-v1-client-deployments-deployment-uuid-domains-hostname-verify}

`POST /api/v1/client/deployments/{deployment_uuid}/domains/{hostname}/verify`

Look for the domain's TXT record (outside any transaction). Found:
the domain is verified, its route is created and, once instances serve
it, its certificate ordered.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `deployment_uuid` | path | string (uuid) | yes |
| `hostname` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
