> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://akamai.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://akamai.ferndocs.com/_mcp/server.

# Get a secure token

GET https://{hostname}/edgeworkers/v1/secure-token/{propertyId}

__Deprecated__ Use the [Create a secure token](https://techdocs.akamai.com/edgeworkers/reference/post-secure-token) operation instead. This returns a generated authentication token, for use with enhanced debug headers for EdgeWorkers.

Reference: https://akamai.ferndocs.com/edge-workers/api/edge-workers-api/secure-tokens/get-secure-token

## Request

### Path parameters

- `propertyId` (string, required)

### Query parameters

- `acl` (string, optional, default: /*) — Path prefix of the response pages to debug. This value can be a pattern that matches multiple pages, and is explicitly part of the final token. The default is `/*`. If you specify an `acl`, don't specify a `url`.
- `url` (string, optional) — Exact path of the response pages to debug. This value is not explicitly part of the final token, but is used as a salt in the HMAC computation. If you specify a `url`, don't specify an `acl`.
- `expiry` (integer, optional, default: 15) — Number of minutes before the authentication token expires, from a minute to an hour. The default is 15.
- `network` (enum, optional) — __Enum__ The network on which to use this authentication token, either `STAGING` or `PRODUCTION`. If not specified, the token is created for the network where the last property version activation occurred.
  - Allowed values: `STAGING`, `PRODUCTION`
- `accountSwitchKey` (string, optional) — For customers who manage more than one account, this [runs the operation from another account](https://techdocs.akamai.com/developer/docs/manage-many-accounts-with-one-api-client). The Identity and Access Management API provides a [list of available account switch keys](https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys).

## Response

### 200

A generated authentication token, for use with enhanced debug headers for EdgeWorkers. See [Enhanced debug headers](https://techdocs.akamai.com/edgeworkers/docs/enhanced-debug-header-details).

- `akamaiEwTrace` (string, required) — The JWT authentication token, for use with enhanced debug headers for EdgeWorkers.

## Examples

**Response**

```json
{
  "akamaiEwTrace": "eyJ0eXAiOiJKV1Qi ... iu1XOS9eJOl-54Yw"
}
```

**SDK Code**

```python
import requests

url = "https://{hostname}/edgeworkers/v1/secure-token/propertyId"

querystring = {"acl":"{{acl}}","url":"{{url}}","expiry":"15","network":"STAGING","accountSwitchKey":"{{accountSwitchKey}}"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://{hostname}/edgeworkers/v1/secure-token/propertyId?acl=%7B%7Bacl%7D%7D&url=%7B%7Burl%7D%7D&expiry=15&network=STAGING&accountSwitchKey=%7B%7BaccountSwitchKey%7D%7D';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{hostname}/edgeworkers/v1/secure-token/propertyId?acl=%7B%7Bacl%7D%7D&url=%7B%7Burl%7D%7D&expiry=15&network=STAGING&accountSwitchKey=%7B%7BaccountSwitchKey%7D%7D"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{hostname}/edgeworkers/v1/secure-token/propertyId?acl=%7B%7Bacl%7D%7D&url=%7B%7Burl%7D%7D&expiry=15&network=STAGING&accountSwitchKey=%7B%7BaccountSwitchKey%7D%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{hostname}/edgeworkers/v1/secure-token/propertyId?acl=%7B%7Bacl%7D%7D&url=%7B%7Burl%7D%7D&expiry=15&network=STAGING&accountSwitchKey=%7B%7BaccountSwitchKey%7D%7D")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{hostname}/edgeworkers/v1/secure-token/propertyId?acl=%7B%7Bacl%7D%7D&url=%7B%7Burl%7D%7D&expiry=15&network=STAGING&accountSwitchKey=%7B%7BaccountSwitchKey%7D%7D');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://{hostname}/edgeworkers/v1/secure-token/propertyId?acl=%7B%7Bacl%7D%7D&url=%7B%7Burl%7D%7D&expiry=15&network=STAGING&accountSwitchKey=%7B%7BaccountSwitchKey%7D%7D");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://{hostname}/edgeworkers/v1/secure-token/propertyId?acl=%7B%7Bacl%7D%7D&url=%7B%7Burl%7D%7D&expiry=15&network=STAGING&accountSwitchKey=%7B%7BaccountSwitchKey%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```