Create an Edge Key
Create a New Edge Key
Edge Keys are your access points for video playback. Each Edge Key links to a single video (asset) and can have its own access policy—public or private, domain restrictions, DRM settings, and more.
Why Create Multiple Edge Keys?
While every video gets a default Edge Key during processing, you might want additional keys for:
- Different access policies: One public key for previews, one private key for full content
- Domain restrictions: Different keys for different partner websites
- A/B testing: Test different DRM or quality configurations
- Key rotation: Create a new key before revoking an old one
API Reference
POST /v1/videos/{assetId}/edge-keys
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
edgeKey | string | Yes | Unique identifier for this Edge Key. Use alphanumeric characters, dashes, and underscores only. This becomes the playback path: /v1/{edgeKey}/master.m3u8 |
isPrivate | boolean | No | When true, playback requires a valid JWT token. Default: false |
restrictedHostList | string[] | No | List of allowed domains for playback. Supports wildcards like *.example.com |
drmStrategy | string | No | DRM configuration to apply. Options: widevine, fairplay, or null |
Example Request (cURL)
curl -X POST "https://api.antcdn.net/v1/videos/{assetId}/edge-keys" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "edgeKey": "my-video-premium", "isPrivate": true, "restrictedHostList": ["app.example.com", "*.example.com"] }'Example Request (JavaScript)
const response = await fetch(`https://api.antcdn.net/v1/videos/${assetId}/edge-keys`, { method: 'POST', headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ edgeKey: 'my-video-premium', isPrivate: true, restrictedHostList: ['app.example.com', '*.example.com'] })});
const { edgeKey, assetId, isPrivate } = await response.json();Response
{ "edgeKey": "my-video-premium", "assetId": "vid_abc123xyz", "isPrivate": true, "restrictedHostList": ["app.example.com", "*.example.com"], "drmStrategy": null, "updatedAt": "2024-01-29T12:00:00Z"}Playback URLs
Once created, use the Edge Key in playback URLs:
| Video Type | Playback URL |
|---|---|
| Public | https://worker.antcdn.net/v1/{edgeKey}/master.m3u8 |
| Private (JWT required) | https://worker.antcdn.net/v1/{edgeKey}/master.m3u8?jwt={token} |
Naming Tips: Choose descriptive Edge Key names that help you identify their purpose:
my-movie-trailerfor public previewmy-movie-full-premiumfor subscriber-only contentpartner-acme-embedfor a specific partner integration
Note: An Edge Key cannot be reassigned to a different video once created. If you try to create an Edge Key that already exists for another asset, you’ll receive a
409 Conflicterror.
What’s Next?
- Update Edge Keys — Modify access policies
- Private Video Playback — Generate JWT tokens for private content
- SVOD Access Control — Build subscription-based access