---
updatedAt: 2026-03-01T18:07:46.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/netstorage-usage/llms.txt
---

# Make a new directory

```python Python
import requests

apiKey = "AbCd3fgoURanooXsbZ6deuZwIBRui4HvO57gf6Hr1CZGu"
domainPrefix = "baseball"
apiHostname = "-nsu.akamaihd.net"
fullHostname = "{domainPrefix}{apiHostname}"
url = "https://{fullHostname}/123456/files_baseball"

headers = {
    "Accept": "text/html",
    "X-Akamai-ACS-Action": "version=1&action=mkdir",
    "X-Akamai-ACS-Auth-Data": "5, 0.0.0.0, 0.0.0.0, 1280000000, 382644692, UploadAccountMedia",
    "X-Akamai-ACS-Auth-Sign": "yh1MXm/rv7RKZhfKlTuSUBV69Acph5IyOWCU0/nFjms=",
    "Host": "baseball-nsu.akamaihd.net"
}

response = requests.request("PUT", url, headers=headers)

print(response.text)
```

```json Response Example
{"success":true}
```

# Obtain your API key



Each call to the API requires the `apiKey` assigned to your upload account.

You can use the [Config API](https://techdocs.akamai.com/netstorage/reference/get-upload-account) or [Control Center](https://techdocs.akamai.com/netstorage/docs/the-netstorage-usage-api-1) to get this value. Store the `key` value.

# Define your prefix and hostname



Each call uses your [domain name prefix](https://techdocs.akamai.com/netstorage-usage/reference/how-to-format-an-api-call#each-call-needs-your-connection-hostname).

This API uses the `-nsu.akamaihd.net` for the `apiHostname` URL.

Prepend your `domainPrefix` to the `apiHostname` to create the `fullHostname`.

# Define the endpoint



Include the `fullHostname` ending with the directory name to create.

# Define your action header



Define your action. Include `version=1` as a constant value, followed by the action.

# Build your auth-data header



See [X-Akamai-ACS-Auth-Data](https://techdocs.akamai.com/netstorage-usage/reference/each-call-needs-signature-header-authentication#the-x-akamai-acs-auth-data-authentication-header) for details.

# Sign your header



See [X-Akamai-ACS-Auth-Sign](https://techdocs.akamai.com/netstorage-usage/reference/each-call-needs-signature-header-authentication#the-x-akamai-acs-auth-sign-header) for details.

# Include your host



Include your `fullHostname` for the `Host` value.

# Confirm your headers



Ensure your headers are accurate with the correct keys.

# Submit your request



Populate your request with the method, url, and headers.

# View your response