Change a DNS record of a bought domain

update_dns_record

Replaces one DNS record of a domain the workspace bought, chosen by its Id from list_dns_records.

POST /v1/update_dns_recordScopedomains:writeDestructive

Every field is replaced, the type included, so pass the record as it should be afterwards and copy the fields that stay the same, ttl too, from list_dns_records. The new record follows the same rules as one added with create_dns_record, and a record with Locked true cannot be changed: the refusal names the site or email domain that holds it.

Sites, email or services that rely on the old record can stop working, so the tool tells the client to confirm the change with you first. It is refused when the record no longer exists. The answer is the saved record, and the change usually reaches every DNS server within a few minutes. It needs the Manage domains permission, and the domain must be active or expiring. The workspace can make 30 domain changes a minute, shared with the Domains page and covering DNS records, nameservers, the registrant, the transfer lock, auto-renew and transfer codes, and a refusal says how long to wait. See Edit or delete a record.

Request

Call it with a POST to https://api.modulify.ai/v1/update_dns_record, sending the inputs below as a JSON object. The token needs the domains:write scope.

This method is marked destructive: it deletes or overwrites data. Check the inputs before you call it, and send an Idempotency-Key header whenever you might retry it.

curl -X POST https://api.modulify.ai/v1/update_dns_record \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID","domainId":"DOMAIN_ID","recordId":1,"type":"TYPE","host":"HOST","value":"VALUE","ttl":1}'

Over MCP, the same method is the update_dns_record tool.

Inputs

Input Type Required Description
workspaceId string Yes The workspace that owns the domain.
domainId string Yes The _id of the bought domain, from list_bought_domains.
recordId integer Yes The Id of the record, from list_dns_records.
type string Yes The record type: A, AAAA, ANAME, CNAME, MX, NS, SRV or TXT.
host string Yes The name relative to the domain, @ for the domain itself or a part such as www. Up to 253 characters.
value string Yes What the record answers: an address, a hostname or the text, depending on the type. For SRV, the target hostname. Up to 4,096 characters as sent.
priority integer No Required for MX and SRV, ignored for other types. From 0 to 65535, lower is tried first.
weight integer No Required for SRV, ignored for other types. From 0 to 65535.
port integer No Required for SRV, ignored for other types. From 1 to 65535.
ttl integer Yes Seconds DNS servers keep the record, from 300 to 604800. Pass the current Ttl to keep it.

Response

Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.