---
updatedAt: 2026-03-01T18:49:08.000Z
---

# Test EdgeWorkers functions in your sandbox

```curl cURL
edgeWorkerId="123";
sandboxId="2956607f-854e-11e8-898a-0242ac110002"
access="USER"

egcurl --eg-section default --request PUT \ 

     --url "https://$hostname/sandbox-api/v1/sandboxes/$sandboxId/edgeworkers/$edgeWorkerId?access=$access" \ 
     --header "Content-Type: application/tar+gzip" \
     --data "/path/to/file.tgz"
```

```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 edgeWorkerId = "123";
const sandboxId = "2956607f-854e-11e8-898a-0242ac110002";

eg.auth({
  path: `/sandbox-api/v1/sandboxes/${sandboxId}/edgeworkers/${edgeWorkerId}`,
method: 'PUT',
  headers: {'Content-Type': 'application/tar+gzip'},
  body: '/path/to/file.tgz'
};
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)
edgeWorkerId = "123";
sandboxId = "2956607f-854e-11e8-898a-0242ac110002";
 

path = '/sandbox-api/v1/sandboxes/{}/edgeworkers/{}'.format(sandboxId, edgeWorkerId)

payload = {"/path/to/file.tgz"}
headers = {"Content-Type": "application/tar+gzip"}
 
querystring = {
		"access": "USER"
}  


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

```json Response Example
The resource was created.
```

# Set up authorization

<!-- curl@5 -->
<!-- node@1-7 -->
<!-- python@1-10 -->

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.

# Identify the EdgeWorker code to add to your sandbox



First, you need to [Create an EdgeWorker ID](https://techdocs.akamai.com/edgeworkers/docs/create-an-edgeworker-id) and [Create a code bundle](https://techdocs.akamai.com/edgeworkers/docs/create-a-code-bundle).

# Add the EdgeWorker to the sandbox

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

Run a PUT operation that references the `sandboxId` and the `edgeWorkerId`. 

The code bundle is compressed as a `.tgz` file. Include the path to this file in the payload.

# Call the API

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

Issue a PUT request.

# Review the response

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

You'll see a message indicating that the resource was created.

Learn more about [EdgeWorkers](https://techdocs.akamai.com/edgeworkers/docs).