Skip to main content

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

FieldTypeRequiredDescription
edgeKeystringYesUnique identifier for this Edge Key. Use alphanumeric characters, dashes, and underscores only. This becomes the playback path: /v1/{edgeKey}/master.m3u8
isPrivatebooleanNoWhen true, playback requires a valid JWT token. Default: false
restrictedHostListstring[]NoList of allowed domains for playback. Supports wildcards like *.example.com
drmStrategystringNoDRM configuration to apply. Options: widevine, fairplay, or null

Example Request (cURL)

Terminal window
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 TypePlayback URL
Publichttps://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-trailer for public preview
  • my-movie-full-premium for subscriber-only content
  • partner-acme-embed for 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 Conflict error.

What’s Next?