> ## Documentation Index
> Fetch the complete documentation index at: https://docs.namegrid.org/llms.txt
> Use this file to discover all available pages before exploring further.

# PATCH /domains/{domain} — Update Auto-Renew & Privacy

> Toggle auto-renew and WHOIS privacy for a domain you own. Send only the fields you want to change; unspecified fields are left exactly as they are.

Use this endpoint to update the `autoRenew` or `privacyEnabled` settings on a domain you own. The request is a partial update — you only need to send the fields you want to change, and everything else stays exactly as it is. The response echoes back the current values of both settings after your change is applied.

## Request

**Method:** `PATCH`\
**Path:** `/v1/domains/{domain}`

| Header         | Required | Value              |
| -------------- | -------- | ------------------ |
| `x-api-key`    | Yes      | Your API key       |
| `Content-Type` | Yes      | `application/json` |

### Path Parameters

<ParamField path="domain" type="string" required>
  The domain name to update (e.g. `example.com`).
</ParamField>

### Body Parameters

<ParamField body="autoRenew" type="boolean">
  Set to `true` to enable automatic renewal, or `false` to disable it. Omit this field to leave the current setting unchanged.
</ParamField>

<ParamField body="privacyEnabled" type="boolean">
  Set to `true` to enable WHOIS privacy protection, or `false` to disable it. Omit this field to leave the current setting unchanged.
</ParamField>

<Note>
  You must include at least one of `autoRenew` or `privacyEnabled` in the request body. Sending an empty object returns a `400 Bad Request` error.
</Note>

### Request Example

```bash theme={null}
curl -X PATCH https://api.namegrid.org/v1/domains/example.com \
  -H "x-api-key: ng_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "autoRenew": false }'
```

## Response — 200 OK

The response reflects the current state of both settings after the update is applied, regardless of which fields you sent.

<ResponseField name="autoRenew" type="boolean">
  The current auto-renew setting for the domain after the update.
</ResponseField>

<ResponseField name="privacyEnabled" type="boolean">
  The current WHOIS privacy setting for the domain after the update.
</ResponseField>

```json theme={null}
{ "autoRenew": false, "privacyEnabled": true }
```

## Errors

| Status | Reason                                                                    |
| ------ | ------------------------------------------------------------------------- |
| `400`  | Neither `autoRenew` nor `privacyEnabled` was provided in the request body |
| `404`  | The domain does not exist or is not owned by your workspace               |
