> ## 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 /v1/domains/{domain}/dns/{id} — Update DNS Record

> PATCH /v1/domains/{domain}/dns/{recordId} — Partially update a DNS record. Only the fields you provide are modified; all others stay unchanged.

Use this endpoint to modify one or more fields on an existing DNS record. The update is partial — only the fields you include in the request body are changed, and all other fields retain their current values. This makes it safe to, for example, update just the `value` of an `A` record without affecting its `ttl` or `name`. You'll need the opaque `id` returned when the record was created or listed.

## Endpoint

**PATCH** `/v1/domains/{domain}/dns/{recordId}`

## Path Parameters

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

<ParamField path="recordId" type="string" required>
  The opaque record identifier returned by the [list](/api-reference/dns/list) or [create](/api-reference/dns/create) endpoints.
</ParamField>

## Body Parameters

All body fields are optional. At least one must be provided.

<ParamField body="type" type="string">
  The new record type. Must be one of: `A`, `AAAA`, `ALIAS`, `CNAME`, `HTTPS`, `MX`, `NS`, `PTR`, `SRV`, `SVCB`, `TLS`, `TXT`.
</ParamField>

<ParamField body="name" type="string">
  The new record name. Use `@` for the domain apex.
</ParamField>

<ParamField body="ttl" type="integer">
  The new time to live in seconds. Values are clamped to the range `60`–`86400`.
</ParamField>

<ParamField body="value" type="string">
  The new record value.
</ParamField>

## Request Example

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

## Response

**200 OK**

The full updated record object is returned.

<ResponseField name="record" type="object">
  The DNS record after applying the requested changes.

  <Expandable title="record object">
    <ResponseField name="id" type="string">
      The opaque record identifier.
    </ResponseField>

    <ResponseField name="type" type="string">
      The DNS record type.
    </ResponseField>

    <ResponseField name="name" type="string">
      The record name. `@` represents the domain apex (root).
    </ResponseField>

    <ResponseField name="ttl" type="integer">
      Time to live in seconds.
    </ResponseField>

    <ResponseField name="value" type="string">
      The record value after the update.
    </ResponseField>
  </Expandable>
</ResponseField>

```json theme={null}
{ "record": { "id": "b6b0b6a2-...", "type": "A", "name": "@", "ttl": 3600, "value": "203.0.113.5" } }
```

## Errors

| Status | Description                                                |
| ------ | ---------------------------------------------------------- |
| `404`  | No record with the given `recordId` exists on this domain. |
