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

# Create a hostname bucket property

```c cURL
contractId="ctr_1-ABCDEF"
groupId="grp_12345"

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

  --url "https://$hostname/papi/v1/properties?contractId=$contractId&groupId=$groupId" \
  --header "Accept: application/json"
  --header "PAPI-Use-Prefixes: true"
 \
  --header "Content-Type: application/json" \
  --data '
{
    "productId": "prd_Alta",
    "propertyName": "pdvassociates.com",
    "ruleFormat": "v2022-10-18",
    "useHostnameBucket": 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
});   


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

    "Accept": "application/json",
    "PAPI-Use-Prefixes": "true"},
  body: {
    "productId": "prd_Alta",
    "propertyName": "my.new.property1.com",
    "ruleFormat": "v2022-10-18",
    "useHostnameBucket": true
},
  qs: {
    "contractId": "ctr_1-ABCDEF",
    "groupId": "grp_12345"
}                    
});
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)
 

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

  "Accept": "application/json",
  "PAPI-Use-Prefixes": "true"
}
payload = {
    "productId": "prd_Alta",
    "propertyName": "my.new.property1.com",
    "ruleFormat": "v2022-10-18",
  	"useHostnameBucket": true
} 
querystring = {
  "contractId": "ctr_1-ABCDEF",
  "groupId": "grp_12345"
}  

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

```json Response Example
{
    "propertyLink": "/papi/v1/properties/prp_173137?contractId=ctr_1-ABCDEF&groupId=grp_12345"
}
```

# Set up authentication

<!-- c@4 -->
<!-- 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.

# Form the request URL

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

Specify the target endpoint.

# Set your headers

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

Include these headers:

* `Accept: application/json` 
* `Content-Type: application/json` 
* `PAPI-Use-Prefixes`. Include this and set it to `true` or `false`. This sets whether to represent ID prefixes in response data. Set it to `false` if you're exchanging PAPI data with other APIs. Set it to `true` if you're using the data with other PAPI operations.

# Set your query string parameters

<!-- c@1-2 -->
<!-- node@25-28 -->
<!-- python@26-29 -->

Include the `contractId` and `groupId` you want to use for your property as query string parameters.

If you need these values, run [list contracts](https://techdocs.akamai.com/property-mgr/reference/get-contracts) and [list groups](https://techdocs.akamai.com/property-mgr/reference/get-groups) if necessary.

# Get your productId

<!-- c@13 -->
<!-- node@20 -->
<!-- python@21 -->

Run the [List Products](https://techdocs.akamai.com/property-mgr/reference/get-products) operation and store the unique `productId` assigned to the product you're using with your property.

# Build a POST object

<!-- c@12-16 -->
<!-- node@19-24 -->
<!-- python@20-25 -->

Include the `productId` you stored as well as a unique `propertyName`. 
Enable [hostname buckets](https://techdocs.akamai.com/property-mgr/reference/add-hostnames-to-the-hostname-bucket#3---add-hostnames-to-the-hostname-bucket) by setting `useHostnameBucket` to "true". 
You can also include the `ruleFormat` object to set the PAPI catalog version to use for rules and behaviors.

# Call the API

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

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

# Review the response output



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

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.