Skip to main content

Update an Edge Key

Update an Edge Key

Modify the access settings of an existing Edge Key without creating a new one. This is useful for changing privacy settings, updating domain restrictions, or enabling/disabling DRM.

API Reference

PATCH /v1/edge-keys/{edgeKey}

Path Parameters

ParameterTypeDescription
edgeKeystringThe Edge Key identifier to update

Request Body

All fields are optional. Only include the fields you want to change.

FieldTypeDescription
isPrivatebooleanSet to true to require JWT authentication, false for public access
restrictedHostListstring[]Replace the list of allowed domains for playback. Set to [] to remove all restrictions
drmStrategystringDRM configuration. Options: widevine, fairplay, or null to disable

Example Request (cURL)

Terminal window
# Make an Edge Key private and restrict to specific domains
curl -X PATCH "https://api.antcdn.net/v1/edge-keys/my-video-premium" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"isPrivate": true,
"restrictedHostList": ["app.example.com", "staging.example.com"]
}'

Example Request (JavaScript)

const response = await fetch('https://api.antcdn.net/v1/edge-keys/my-video-premium', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
isPrivate: true,
restrictedHostList: ['app.example.com', 'staging.example.com']
})
});
const updatedKey = await response.json();

Response

{
"edgeKey": "my-video-premium",
"assetId": "vid_abc123xyz",
"isPrivate": true,
"restrictedHostList": ["app.example.com", "staging.example.com"],
"drmStrategy": null,
"updatedAt": "2024-01-29T14:30:00Z"
}

Common Use Cases

Make a Public Video Private

When you need to put a video behind authentication:

Terminal window
curl -X PATCH "https://api.antcdn.net/v1/edge-keys/free-preview" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"isPrivate": true}'

Remove Domain Restrictions

Allow playback from any domain:

Terminal window
curl -X PATCH "https://api.antcdn.net/v1/edge-keys/partner-embed" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"restrictedHostList": []}'

Add a New Partner Domain

Update the domain list to include additional allowed domains:

Terminal window
curl -X PATCH "https://api.antcdn.net/v1/edge-keys/partner-embed" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"restrictedHostList": ["partner1.com", "partner2.com", "newpartner.com"]}'

Important: The restrictedHostList field replaces the entire list, not appends to it. Always include all domains you want to allow.

Error Responses

StatusDescription
404Edge Key not found
403Edge Key belongs to a different organization or environment
400Invalid request body

What’s Next?