# updateDomain

```graphql
mutation UpdateDomain($input: UpdateDomainInput!) {
  updateDomain(input: $input) {
    domain {
      id
      domain
      environmentId
      projectId
      createdAt
      updatedAt
    }
    error
  }
}
```

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

## Arguments

| Name                  | Type               | Required | Description |
| --------------------- | ------------------ | -------- | ----------- |
| `input`               | UpdateDomainInput! | Yes      |             |
| `input.environmentId` | ID!                | Yes      |             |
| `input.domainId`      | ID!                | Yes      |             |
| `input.domain`        | String!            | Yes      |             |

## Variables

```json
{
  "input": {
    "environmentId": "string",
    "domainId": "string",
    "domain": "string"
  }
}
```

## Responses

| Status | Description                                    |
| ------ | ---------------------------------------------- |
| 200    | The UpdateDomainPayload! in data.updateDomain. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateDomain($input: UpdateDomainInput!) {\n  updateDomain(input: $input) {\n    domain {\n      id\n      domain\n      environmentId\n      projectId\n      createdAt\n      updatedAt\n    }\n    error\n  }\n}",
  "variables": {
    "input": {
      "environmentId": "string",
      "domainId": "string",
      "domain": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateDomain": {
      "domain": {
        "id": "string",
        "domain": "string",
        "environmentId": "string",
        "projectId": "string",
        "createdAt": "2026-01-01T00:00:00Z",
        "updatedAt": "2026-01-01T00:00:00Z"
      },
      "error": "string"
    }
  }
}
```
