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
| Parameter | Type | Description |
|---|---|---|
edgeKey | string | The Edge Key identifier to update |
Request Body
All fields are optional. Only include the fields you want to change.
| Field | Type | Description |
|---|---|---|
isPrivate | boolean | Set to true to require JWT authentication, false for public access |
restrictedHostList | string[] | Replace the list of allowed domains for playback. Set to [] to remove all restrictions |
drmStrategy | string | DRM configuration. Options: widevine, fairplay, or null to disable |
Example Request (cURL)
# Make an Edge Key private and restrict to specific domainscurl -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:
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:
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:
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
restrictedHostListfield replaces the entire list, not appends to it. Always include all domains you want to allow.
Error Responses
| Status | Description |
|---|---|
404 | Edge Key not found |
403 | Edge Key belongs to a different organization or environment |
400 | Invalid request body |
What’s Next?
- Delete Edge Keys — Remove Edge Keys you no longer need
- Private Video Playback — Generate JWT tokens for private content