# Update environment domain

```http
PATCH /projects/{project_reference}/environments/{environment_id}/domains/{domain_reference}
```

Update a custom domain. Requires project.domains.write.

## Parameters

| Name                | In   | Required | Description    |
| ------------------- | ---- | -------- | -------------- |
| `project_reference` | path | Yes      |                |
| `domain_reference`  | path | Yes      |                |
| `environment_id`    | path | Yes      | Environment ID |

## Request body

| Field    | Type   | Required | Description     |
| -------- | ------ | -------- | --------------- |
| `domain` | string | Yes      | New domain name |

## Responses

| Status | Description                     |
| ------ | ------------------------------- |
| 200    | Domain updated successfully     |
| 400    | Invalid input                   |
| 401    | Unauthorized                    |
| 403    | Forbidden                       |
| 404    | Environment or domain not found |
| 500    | Server error                    |
