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

# Get a property rule tree

```curl cURL
propertyVersion="3"
propertyId="prp_175780"
contractId="ctr_1-1TJZFW"
groupId="grp_15166"
validateRules="true"
validateMode="full"

egcurl --eg-section default --request GET \

  --url "https://$hostname/papi/v1/properties/$propertyId/versions/$propertyVersion/rules?contractId=$contractId&groupId=$groupId&validateRules=$validateRules&validateMode=$validateMode" \
  --header "Accept: application/json"
  --header "PAPI-Use-Prefixes: true"
```

```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 propertyVersion = "3";
const propertyId = "prp_175780";

eg.auth({
  path: `/papi/v1/properties/${propertyId}/versions/${propertyVersion}/rules`,
  method: "GET",
  headers: {
    
    "Accept": "application/json",
    "PAPI-Use-Prefixes": "true"},
  qs: {
    "contractId": "ctr_1-1TJZFW",
    "groupId": "grp_15166",
    "validateRules": "true",
    "validateMode": "full"
}                    
});
eg.send(function(error, response, body) {
  console.log(body);    
});
```

```python Python
import requests
from akamai.edgegrid import EdgeGridAuth, EdgeRc
from urlparse 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)
propertyVersion = "3"
propertyId = "prp_175780"
 

path= '/papi/v1/properties/{}/versions/{}/rules'.format(propertyId, propertyVersion)
headers = {
  
  "Accept": "application/json",
  "PAPI-Use-Prefixes": "true"
} 
querystring = {
  "contractId": "ctr_1-1TJZFW",
  "groupId": "grp_15166",
  "validateRules": "true",
  "validateMode": "full"
}  

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

```json Response Example
{
    "accountId": "act_1-1TJZFB",
    "contractId": "ctr_1-1TJZH5",
    "groupId": "grp_15225",
    "propertyId": "prp_173136",
    "propertyVersion": 3,
    "etag": "a9dfe78cf93090516bde891d009eaf57",
    "ruleFormat": "v2015-08-08",
    "rules": {
        "name": "default",
        "criteria": [],
        "children": [],
        "options": {
            "is_secure": false
        },
        "behaviors": [
            {
                "name": "origin",
                "options": {
                    "httpPort": 80,
                    "enableTrueClientIp": false,
                    "compress": true,
                    "cacheKeyHostname": "ORIGIN_HOSTNAME",
                    "forwardHostHeader": "REQUEST_HOST_HEADER",
                    "hostname": "origin.test.com",
                    "originType": "CUSTOMER"
                }
            },
            {
                "name": "cpCode",
                "options": {
                    "value": {
                        "id": 12345,
                        "name": "my CP code"
                    }
                }
            }
        ]
    }
}
```

# Set up authentication

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

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.

# Get property information

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

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

* `propertyId`. The unique identifier ​Akamai​ assigned to the property.
* `contractId`. The unique identifier applied to the ​Akamai​ contract used to create the property.
* `groupId`. The unique identifier assigned to the group associated with the contract used to create the property, if applicable.
* `latestVersion`, `stagingVersion`, or `productionVersion`. Determine which version of the property you want to use, and store this value.

# Form the request URL

<!-- curl@10 -->
<!-- node@14 -->
<!-- python@15 -->

Specify the target endpoint.

# Set property values

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

You need to name the specific property version you want to update. Include both the `propertyVersion` and `propertyId` values you stored (step 2).

# Set your headers

<!-- curl@11-12 -->
<!-- node@16-19 -->
<!-- python@16-20 -->

Include these headers:

* `Accept: 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@3-6 -->
<!-- node@20-25 -->
<!-- python@21-26 -->

Include these query string values:

* `contractId` and `groupId` (if applicable). Include the values you stored (step 3).
* `validateRules` (optional). Used to perform a validation of the rules in your tree and identify potential problems within the response object's `errors` and `warnings` arrays. Defaults to `true`. See [Validation errors](https://techdocs.akamai.com/property-mgr/reference/validation-errors) for details on this error feedback. Validation is recommended, but you can set this to `false` to avoid delays the validation may cause. See [Fast validation, activation, and fallback](https://techdocs.akamai.com/property-mgr/reference/fast) for details on potential delays.
* `validateMode` (optional, requires `validateRules`). Set to `fast`, this performs a quick validation check. Set it to `full` to perform a more extensive check.

# Call the API

<!-- curl@1-12 -->
<!-- node@1-29 -->
<!-- python@1-30 -->

Call GET on the request URL.

# View the response



The response object lists the rule tree details associated with the specified property.