---
updatedAt: 2026-03-01T18:30:31.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/edge-hostnames/llms.txt
---

# Patch an edge hostname

```curl cURL
recordName="www.example.com"
dnsZone="edgesuite.net"
comments="Editing CNAME"
statusUpdateEmail="someperson@somedomain.com"

egcurl --eg-section default --request PATCH \
  --url "https://$hostname/hapi/v1/dns-zones/$dnsZone/edge-hostnames/$recordName?comments=$comments&statusUpdateEmail=$statusUpdateEmail" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json-patch+json" \
  --data '
[
    {
        "op": "replace",
        "path": "/ttl",
        "value": "43200"
    },
    {
        "op": "replace",
        "path": "/ipVersionBehavior",
        "value": "IPV4"
    }
]'
```

```node Node
const EdgeGrid = require("akamai-edgegrid");
const os = require("os");
const edgercPath = os.homedir + "/.edgerc.txt";
const edgercSection = "default";  
const eg = new EdgeGrid({
  path: edgercPath,
  section: edgercSection
});   

const recordName = "www.example.com";
const dnsZone = "edgesuite.net";

eg.auth({
  path: `/hapi/v1/dns-zones/${dnsZone}/edge-hostnames/${recordName}`,
  method: "PATCH",
  headers: {
    "Content-Type": "application/json-patch+json",

    "Accept": "application/json"},
  body: [
    {
        "op": "replace",
        "path": "/ttl",
        "value": "500"
    },
    {
        "op": "replace",
        "path": "/ipVersionBehavior",
        "value": "IPV4"
    }
],
  qs: {
    "comments": "Editing CNAME",
    "statusUpdateEmail": "someperson@somedomain.com"
}                    
});
eg.send(function(error, response, body) {
  console.log(body);    
});
```

```python Python
import requests
from akamai.edgegrid import EdgeGridAuth, EdgeRc
from urllib.parse import urljoin

edgerc = EdgeRc('~/.edgerc.txt')
section = 'default'
baseurl = 'https://%s' % edgerc.get(section, 'host')

session = requests.Session()
session.auth = EdgeGridAuth.from_edgerc(edgerc, section)
recordName = "www.example.com"
dnsZone = "edgesuite.net"
 

path= '/hapi/v1/dns-zones/{}/edge-hostnames/{}'.format(dnsZone, recordName)
headers = {
  "Content-Type": "application/json-patch+json",

  "Accept": "application/json"}
payload = [
    {
        "op": "replace",
        "path": "/ttl",
        "value": "500"
    },
    {
        "op": "replace",
        "path": "/ipVersionBehavior",
        "value": "IPV4"
    }
] 
querystring = {
  "comments": "Editing CNAME",
  "statusUpdateEmail": "someperson@somedomain.com"
}  

result = session.patch(urljoin(baseurl, path), headers=headers, json=payload, params=querystring)
print(result.status_code)
print(result.json()) 
```

```json Response Example
{
    "action": "EDIT",
    "changeId": 53494819,
    "edgeHostnames": [
        {
            "edgeHostnameId": 1803728,
            "recordName": "www.example.com",
            "dnsZone": "edgesuite.net",
            "securityType": "ENHANCED-TLS",
            "useDefaultMap": false,
            "ipVersionBehavior": "IPV4",
            "useDefaultTtl": false,
            "ttl": 43200
            "map": "e;b.akamaiedge.net",
            "slotNumber": 91899,
            "comments": "Edited for Super Bowl"
        }
    ],
    "comments": "Editing CNAME",
    "status": "SUCCEEDED",
    "statusUpdateDate": "2016-11-18T20:21:17.0Z",
    "statusUpdateEmail": "someperson@somedomain.com",
    "submitDate": "2016-11-18T20:21:12.0Z",
    "submitter": "nobody",
    "submitterEmail": "nobody@somedomain.com"
}
```

# Set up authorization

<!-- curl@0-100 -->
<!-- node@0-100 -->
<!-- python@0-100 -->

Before you can use this API, you need to [Create authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials). 

Then, you can use these code samples to apply the token values to your requests.

# Get the record name and DNS zone

<!-- curl@1-2 -->
<!-- node@10-11 -->
<!-- python@11-12 -->

Run the [List edge hostnames] (https://techdocs.akamai.com/edge-hostnames/recipes/list-edge-hostnames) operation, choose the edge hostname that you are updating the `ttl` or `ipVersionBehavior`. Note the edge hostnames `recordName` and `dnsZone`.

# Add a comment

<!-- curl@3 -->
<!-- node@33 -->
<!-- python@33 -->

Optionally, set the `comments` query parameter to include any comments about the edge hostname being patched.

# Set up email notifications

<!-- curl@4 -->
<!-- node@34 -->
<!-- python@34 -->

Optionally, set the `statusUpdateEmail` query parameter to the addresses you wish to notify when updates occur. To specify more than one email address, separate the addresses with a comma (,) or repeat the parameter with each address.

# Create the JSON PATCH

<!-- curl@14-21 -->
<!-- node@22-29 -->
<!-- python@22-29 -->

Form an array of [JSON patch](http://jsonpatch.com/) objects to replace the edge hostname `ttl` or `ipVersionBehavior` values.

# Form the URL

<!-- curl@1-2,7 -->
<!-- node@14,10-11,33-34 -->
<!-- python@11-12,15,33-34 -->

Enter the `recordName` and `dnsZone` values into the URL. Optionally, add comments and email addresses for notifications.

# Call the API

<!-- curl@1-100 -->
<!-- node@1-100 -->
<!-- python@0-100 -->

Call PATCH on the request URL and include the JSON patch array.

# Review the response

<!-- curl@101 -->
<!-- node@101 -->
<!-- python@101 -->

The operation responds with the
`edgeHostname` array for the edge hostname that was patched and the `changeRequest`, which the `Location` response header links to.  

The  `changeRequest` includes details for:
- `action`. The action requested that is represented by the change request. 
- `changeId`. The unique identifier for a specific change request.
- `comments`. The comment added when the change request was created.
- `status`. The status of the change request. Can be `PENDING`, `SUCCEEDED`, `FAILED`, or `IGNORED`.
- `statusUpdateDate`. The ISO–8601 timestamp indicating the time of the most recent status update.
- `statusUpdateEmail`. The email addresses receiving status update notifications.
- `submitDate`. The ISO–8601 timestamp indicating the time of the submitted change request.
- `submitter`. The username of the person who submitted the change request.
- `submitterEmail`. The email address for the change request’s submitter.