---
updatedAt: 2026-03-01T18:37:47.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/property-mgr/llms.txt
---

# Clone an include

```curl cURL
contractId="ctr_1-1TJZFW"
groupId="grp_15166"

egcurl --eg-section default --request POST \

  --url "https://$hostname/papi/v1/includes?contractId=$contractId&groupId=$groupId" \
  --header "Accept: application/json"
  --header "PAPI-Use-Prefixes: true"
 \
  --header "Content-Type: application/json" \
  --data '
{
    "productId": "prd_Alta",
    "includeName": "my.new.include1.com",
    "cloneFrom": {
      "includeId": "inc_175780",
      "version": 2,
      "cloneFromVersionEtag": "a9dfe78cf93090516bde891d009eaf57"
    }
}'
```

```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)
 

path= '/papi/v1/includes'
headers = {
  "Content-Type": "application/json",

  "Accept": "application/json",
  "PAPI-Use-Prefixes": "true"
}
payload = {
    "productId": "prd_Alta",
    "includeName": "my.new.include1.com",
    "cloneFrom": {
      "includeId": "inc_175780",
      "version": 2,
      "cloneFromVersionEtag": "a9dfe78cf93090516bde891d009eaf57"
    }
} 
querystring = {
  "contractId": "ctr_1-1TJZFW",
  "groupId": "grp_15166"
}  

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

```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
});   


eg.auth({
  path: `/papi/v1/includes`,
  method: "POST",
  headers: {
    "Content-Type": "application/json",

    "Accept": "application/json",
    "PAPI-Use-Prefixes": "true"},
  body: {
    "productId": "prd_Alta",
    "includeName": "my.new.include1.com",
    "cloneFrom": {
      "includeId": "inc_175780",
      "version": 2,
      "cloneFromVersionEtag": "a9dfe78cf93090516bde891d009eaf57"
    }
  },
  qs: {
    "contractId": "ctr_1-1TJZFW",
    "groupId": "grp_15166"
}                    
});
eg.send(function(error, response, body) {
  console.log(body);    
});
```

```json Response Example
{
  "includeLink": "/papi/v0/includes/inc_243237?contractId=ctr_1-1TJZFW&groupId=grp_15166"
}
```

# Set up authentication

<!-- curl@4 -->
<!-- python@1-8 -->
<!-- node@1-8 -->

If you haven't already, you need to [create your authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials) in an API client in Control Center. Set up the API client with:

* Access to the Property Manager API (PAPI).
* PAPI's access level set to READ-WRITE.

Then, you can include this code to apply the token values to validate your requests.

# Determine the include to clone



Run [list includes](https://techdocs.akamai.com/property-mgr/recipes/list-includes) to view all of your existing includes and locate the one you want to clone. Store these values:

* `contractId`. The unique identifier applied to the ​Akamai​ contract used to create the target include.
* `groupId`. The unique identifier assigned to the group associated with the contract used to create the target include, if applicable.
* `latestVersion`, `stagingVersion`, or `productionVersion`. Determine which version of the include you want to clone, and store this value. You can review the rule tree for each version, using the [get an include's rule tree](https://techdocs.akamai.com/property-mgr/recipes/get-an-includes-rule-tree) operation.
* `productId`. The identifier for the ​Akamai​ product used in the include.

# Get the version's etag



To get this value, run the [list include versions](https://techdocs.akamai.com/property-mgr/recipes/list-include-versions) operation, using the stored `includeId`, `contractId` and `groupId` (if applicable). Locate the applicable `version` and store its `etag` value.

# Form the request URL

<!-- curl@6 -->
<!-- python@13 -->
<!-- node@12 -->

Specify the target endpoint.

# Set your headers

<!-- curl@7-10 -->
<!-- python@14-19 -->
<!-- node@14-18 -->

Include these headers:

* `Accept: application/json`
* `Content-Type: application/json`
* `PAPI-Use-Prefixes`. This sets whether to represent ID prefixes in response data. Set to `false` when exchanging PAPI data with other APIs. Set it to `true` here because we're working in PAPI.

# Set your query string parameters

<!-- curl@1-2 -->
<!-- python@29-32 -->
<!-- node@28-30 -->

Include the stored `contractId` and `groupId` (if applicable) values as query string parameters. 

**Note**: To clone an existing include, you need to use the same contract and group (if applicable) that were used to create that include.

# Build a POST object

<!-- curl@11-20 -->
<!-- python@20-28 -->
<!-- node@19-27 -->

Include these values:

* `productId`. Include the stored `productId` for product used in the property to be cloned.
* `productName`. Set a new name for your cloned property.
* `propertyId`. Include the stored `propertyId` for the property to be cloned.
* `version`. Include the stored version number of the property to be cloned.
* `cloneFromVersionEtag`. Include the stored `etag` for the target property. This performs an etag data integrity check on the original property. See [Concurrency control](https://techdocs.akamai.com/property-mgr/reference/concurrency-control) for guidance.
* `copyHostnames` (optional). Include this and set it to `true` to assign the same set of hostnames to the new property.

# Call the API

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

Call POST on the request URL, providing the body request object.

# View the response



The response object lists the `includeLink`. You can use this in a URL to poll the API and get the new include.

You should also store the `prp_###` value that precedes the query string. This is the unique `propertyId` for your property and it's used in other PAPI operations.