# Update domain record

`PATCH https://api.instacloud.com/orgs/{orgId}/domains/{domainName}/records/{recordId}`

**Token scope:** `account` · `org` — read-only tokens refused (not a GET).

Change a DNS record; a field left out keeps its value. A managed record is refused.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | `string` | yes |  |
| `domainName` | path | `string` | yes |  |
| `recordId` | path | `string` | yes | the id from the records list |

## Request body (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `"A" \| "AAAA" \| "ANAME" \| "CNAME" \| "MX" \| "NS" \| "SRV" \| "TXT"` | no |  |
| `host` | `string` | no | relative to the domain: "@" for the domain itself, "api" for api.<domain>; the full hostname is accepted too |
| `answer` | `string` | no | an IPv4 (A) or IPv6 (AAAA) address; a hostname (CNAME, ANAME, NS, MX); "<weight> <port> <target>" (SRV); text (TXT). "." is the null MX and the no-service SRV target |
| `ttl` | `integer` | no | seconds |
| `priority` | `integer` | no | required for MX and SRV, refused for every other type |

## Response 200

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | yes | the registrar's id for the record; the handle every write takes |
| `type` | `"A" \| "AAAA" \| "ANAME" \| "CNAME" \| "MX" \| "NS" \| "SRV" \| "TXT"` | yes |  |
| `host` | `string` | yes | relative to the domain: "@" is the domain itself, "api" is api.<domain> |
| `fqdn` | `string` | yes |  |
| `answer` | `string` | yes |  |
| `ttl` | `integer` | yes | seconds |
| `priority` | `integer` | no | MX and SRV only |
| `managed` | `boolean` | yes | published by InstaCloud: read-only while `hostname` names the attached hostname it serves; without one, a leftover no hostname claims, which may be deleted |
| `hostname` | `string` | no | the attached hostname a managed record serves |

## Response 400

the merged record does not fit its type, the zone cannot hold it, or the registrar refused it — with its own sentence

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 404

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 409

the record is managed, or the host it moves to serves a compute service (for an NS: or has one beneath it)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 502

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 503

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |
