To update an existing record, send a PATCH request to
/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID
. Any attribute valid for
the record type can be set to a new value for the record.
See the attribute table for details regarding record types and their respective attributes.
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
domain_name |
string | True | The name of the domain itself. | |
domain_record_id |
integer | True | The unique identifier of the domain record. | |
body |
JSON or IO[bytes] | False |
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"name": "blog",
"type": "A"
}
resp = client.domains.patch_record(domain_name="example.com", domain_record_id=2432342, body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.