Configure DRM protection

Configure profile defaults, register an RSA public key, protect VODs and livestreams, and apply custom DRM settings.

Need help implementing DRM playback?

This article explains how to configure DRM through API v2, including profile defaults, content visibility, and custom DRM settings.

To implement protected playback with the Dailymotion Player — including backend JWT generation, RSA signing, license authorization, and player configuration, see Implement DRM using Dailymotion Player.

API v2 lets you configure DRM protection at two levels:

  • Profile level: Define default DRM settings for VOD and livestreams.
  • Content level: Apply a custom configuration to an individual VOD or livestream, overriding the default settings.

You can use the profile defaults for all protected content or customize the settings for specific content.

API vs. Studio

API v2 supports both profile-level default configurations and content-level custom configurations.

In Dailymotion Studio, you can only configure default DRM settings for VODs and livestreams. Custom configurations for individual content items are available through the API only.


1. Check if DRM is enabled on your organization

Before configuring DRM, check whether the DRM feature is available for your Dailymotion organization.

Retrieve the can_use_drm field from the profile object.

Required scope: profile.read

// Replace {PROFILE_ID} and {ACCESS_TOKEN} with your own.

curl --request GET \
     --url 'https://api.dailymotion.com/v2/profiles/{PROFILE_ID}?fields=can_use_drm' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}'

DRM is available if can_use_drm is true.

If the value is false, DRM cannot be configured on that profile. Reach out to your Dailymotion Success Manager or our Support team to add the feature to your plan.


2. Configure default DRM settings at profile level

Profile-level settings define the default DRM configuration for protected content.

VOD and livestreams have separate configurations. Both support license expiration and optional key rotation, but only VOD supports play_duration field.


2.1. Register your RSA public key

​First, generate an RSA key pair on your backend.

Keep the private key secure: it is used to sign playback JWTs and must never be shared with Dailymotion or exposed to the client. Only the public key needs to be registered.

Send a PATCH request to the profile endpoint.

Required scope: profile.manage

// Replace {PROFILE_ID} and {ACCESS_TOKEN} with your own

curl --request PATCH \
     --url 'https://api.dailymotion.com/v2/profiles/{PROFILE_ID}' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}' \
     --header 'content-type: application/json' \
     --data '
{
  "drm_public_key": "-----BEGIN PUBLIC KEY-----\\nMIIBIj...\\n-----END PUBLIC KEY-----"
}
'

The public key must meet the following requirements:

  • Be PEM-encoded.
  • Be a valid public key.
  • Not exceed 2,000 characters.

Verify the registered key: To check that the key was registered successfully, retrieve the drm_public_key field.

Required scope: profile.read

// Replace {PROFILE_ID} and {ACCESS_TOKEN} with your own.

curl --request GET \
     --url 'https://api.dailymotion.com/v2/profiles/{PROFILE_ID}?fields=drm_public_key' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}'

To remove the registered public key, set drm_public_key to null.


2.2. Configure default DRM settings for VOD and livestreams

Use the following request to define separate default DRM settings for VOD and livestream content. DRM configuration objects are replaced as a whole. Always include all required fields when updating them.

Required scope: profile.manage

// Replace {PROFILE_ID} and {ACCESS_TOKEN} with your own.

curl --request PATCH \
     --url 'https://api.dailymotion.com/v2/profiles/{PROFILE_ID}' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}' \
     --header 'content-type: application/json' \
     --data '
{
  "vod_drm_configuration": {
    "protection_granularity": "per_video",
    "protected_media_type": "both",
    "play_duration": "PT2H",
    "relative_expiration": "PT48H",
    "enable_key_rotation": true,
    "key_rotation_period": "PT24H"
  },
  "live_drm_configuration": {
    "protection_granularity": "per_live",
    "protected_media_type": "both",
    "relative_expiration": "PT48H",
    "enable_key_rotation": true,
    "key_rotation_period": "PT24H"
  }
}
'

2.3. Optionally, enable DRM protection by default for new content

Defining profile-level DRM settings does not automatically protect newly created content.

To apply DRM protection automatically to new content, set its default visibility to drm_protected in the profile's content_defaults .

Required scope: profile.manage

// Replace {PROFILE_ID} and {ACCESS_TOKEN} with your own.

curl --request PATCH \
     --url 'https://api.dailymotion.com/v2/profiles/{PROFILE_ID}' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer ••••' \
     --header 'content-type: application/json' \
     --data '
{
    "content_defaults": {
      "visibility": "drm_protected"
    }
  }'

This setting applies to newly created content only. Existing content remains unchanged.


3. Configure DRM on a VOD or livestream

When creating or updating content, you can choose between:

  • Default settings: use the DRM configuration defined at profile level.
  • Custom settings: override the profile defaults for a specific VOD or livestream.

In both cases, the content must have visibility set to drm_protected.


3.1. Apply default DRM settings

To use the profile defaults, set the content visibility to drm_protected. Dailymotion will apply the corresponding vod_drm_configuration or live_drm_configuration.

Required scope: video.manage live.manage


For new content

// Replace {PROFILE_ID}, {ACCESS_TOKEN} and {VIDEO_URL} with your own.

curl --request POST \
     --url 'https://api.dailymotion.com/v2/profiles/{PROFILE_ID}/videos' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}' \
     --header 'content-type: application/json' \
     --data '
{
  "title": "My new video",
  "visibility": "drm_protected",
  "is_for_kids": false,
  "source": {
    "file_url": "{VIDEO_URL}"
  }
}
'

The default vod_drm_configuration set at profile-level will apply.


For existing content

// Replace {VIDEO_ID} and {ACCESS_TOKEN} with your own.

curl --request PATCH \
  --url 'https://api.dailymotion.com/v2/videos/{VIDEO_ID}' \
  --header 'Authorization: Bearer {ACCESS_TOKEN}' \
  --header 'Content-Type: application/json' \
  --data '{
    "visibility": "drm_protected"
  }'

The default vod_drm_configuration set at profile-level will apply.


3.2. Apply a custom DRM settings

To use different DRM settings for a specific VOD or livestream, provide a custom drm_configuration at content level.

Set drm_configuration_source to custom in the protection object.

Custom configuration

A custom configuration overrides the profile defaults for the selected VOD or livestream only. It does not modify the profile-level settings or affect other content.

Content-level custom configurations are currently supported through PATCH requests only.

Required scope: video.manage live.manage

// Replace {VIDEO_ID} and {ACCESS_TOKEN} with your own.

curl --request PATCH \
  --url 'https://api.dailymotion.com/v2/videos/{VIDEO_ID}' \
  --header 'Authorization: Bearer {ACCESS_TOKEN}' \
  --header 'Content-Type: application/json' \
  --data '{
    "drm_configuration": {
      "protection_granularity": "per_quality",
      "protected_media_type": "both",
      "play_duration": "PT4H",
      "relative_expiration": "PT24H",
      "enable_key_rotation": true,
      "key_rotation_period": "PT12H"
    },
    "protection": {
      "drm_configuration_source": "custom"
    }
  }'

Keep in mind:

  • The custom configuration replaces the existing default configuration. Include all required fields.
  • VOD and livestream configurations have different schemas: play_duration is supported for VOD only.

4. Read the DRM configuration

You can read the DRM settings applied to a VOD or livestream, whether they come from the profile defaults or a custom configuration.

DRM fields are not returned by default. Include them explicitly in the fields parameter.

Required scope: video.read live.Read

// Replace {VIDEO_ID} and {ACCESS_TOKEN} with your own.

curl --request GET \
  --url 'https://api.dailymotion.com/v2/videos/{VIDEO_ID}?fields=video_id,visibility,protection.drm_configuration' \
  --header 'Authorization: Bearer {ACCESS_TOKEN}' \
  --header 'Accept: application/json'

Understand the response:

The response indicates which configuration source is being used through protection.drm_configuration_source.

{
  "video_id": "xvideo123",
  "visibility": "drm_protected",
  "protection": {
    "drm_configuration_source": "channel"
  },
  "drm_configuration": null
}

5. DRM configuration fields reference

The following fields are available for DRM configuration. DRM-specific fields are optional and must be explicitly requested with the fields query parameter when reading resources.


Profile DRM fields

FieldResourceAccessDescription
can_use_drmProfileRead-onlyIndicates whether the caller can use DRM for the profile. This is true when the caller belongs to an organization that owns the profile and has DRM enabled.
drm_public_keyProfileRead/writePEM-encoded RSA public key used by Dailymotion to verify partner-signed JWTs. The key must be valid and no longer than 2,000 characters.
It only contains the public key. Never send the private key to Dailymotion or expose it to the client.
vod_drm_configurationProfileRead/writeDefault DRM configuration applied to VOD content when the profile defaults are used.
live_drm_configurationProfileRead/writeDefault DRM configuration applied to livestream content when the profile defaults are used.
content_defaults.visibilityProfileRead/writeDefault visibility for newly created VODs. Set it to drm_protected to make DRM protection the default for new VODs.

Content DRM fields

FieldResourceAccessDescription
visibilityVideo, livestreamRead/writeControls content visibility. drm_protected makes the content use DRM protection.
protection.drm_configuration_sourceVideo, livestreamRead/writeIndicates whether the content uses the profile configuration or a custom configuration.

Accepted values:
  • channel: Use the DRM configuration defined on the profile.
  • custom: Use the content-level drm_configuration object.
drm_configurationVideo, livestreamRead/write through PATCHCustom DRM configuration for the specific VOD or livestream.

For custom content settings, set drm_configuration_source to custom and provide the complete drm_configuration object. Content-level drm_configuration is currently available through PATCH requests only.


VOD DRM configuration fields

The vod_drm_configuration and VOD drm_configuration objects use the following fields:

FieldDescriptionAccepted values
protection_granularityDefines the granularity at which DRM protection is applied to the VOD.per_video, per_quality
protected_media_typeDefines which media tracks are protected.audio, video, both
play_durationDefines how long the VOD remains playable after the viewer starts playback.

ISO 8601 duration format.
PT1H, PT2H, PT4H, PT8H
relative_expirationDefines how long the DRM license remains valid after it is issued and before playback starts.

ISO 8601 duration format.
PT30M, PT1H, PT2H, PT4H, PT8H, PT12H, PT24H, PT48H, PT96H
enable_key_rotationDetermines whether the encryption key is rotated during playback.true, false
key_rotation_periodDefines the time between two encryption key rotations.

Required when enable_key_rotation is true.

ISO 8601 duration format.
PT30M, PT1H, PT2H, PT4H, PT8H, PT12H, PT24H, PT48H

Example:

{
  "protection_granularity": "per_quality",
  "protected_media_type": "both",
  "play_duration": "PT2H",
  "relative_expiration": "PT48H",
  "enable_key_rotation": true,
  "key_rotation_period": "PT24H"
}

Livestream DRM configuration fields

The live_drm_configuration and livestream drm_configuration objects use the following fields:

FieldDescriptionAccepted values
protection_granularityDefines the granularity at which DRM protection is applied to the livestream.per_live, per_quality
protected_media_typeDefines which media tracks are protected.audio, video, both
relative_expirationDefines how long the DRM license remains valid after it is issued and before playback starts.

ISO 8601 duration format.
PT30M, PT1H, PT2H, PT4H, PT8H, PT12H, PT24H, PT48H, PT96H
enable_key_rotationDetermines whether the encryption key is rotated during the livestream.true, false
key_rotation_periodDefines the time between two encryption key rotations.

Required when enable_key_rotation is true.

ISO 8601 duration format.
PT30M, PT1H, PT2H, PT4H, PT8H, PT12H, PT24H, PT48H

Livestream configuration does not include play_duration.


Important behavior and limitations

Keep the following points in mind when working with DRM-protected content:

  • Content visibility: A DRM-protected resource is returned with visibility=drm_protected only to authorized members of the organization that owns the profile. Other callers see its visibility as private.

  • Listings: DRM-specific fields are not included in content listings. The drm_protected visibility is not a supported listing filter.

  • Unavailable DRM fields: Requests for DRM-specific fields on a profile without DRM enabled can return 403. A 409 response from the upstream content configuration route is represented as drm_configuration: null.

  • Configuration updates: DRM configuration objects are replaced as a whole. Always provide all required fields when updating a configuration.

  • Playback implementation: Configuring DRM through the API does not replace the Dailymotion DRM playback flow. Your backend must sign a JWT, which you then pass to the Player through setDrmConfig(). The Player automatically requests the appropriate license.

    Dailymotion supports Widevine, FairPlay and PlayReady. For implementation details, including JWT generation, RSA signing, license authorization and Player configuration, see implement DRM with the Dailymotion Player.


Did this page help you?