Skip to main content
POST
/
streaming
/
video_protection
/
v2
/
rulesets
cURL
curl --request POST \
  --url https://api.mottostreaming.com/streaming/video_protection/v2/rulesets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "name": "<string>",
  "geo_restrictions_disallow": {
    "country_codes": [
      "<string>"
    ]
  },
  "geo_restrictions_allow": {
    "country_codes": [
      "<string>"
    ]
  },
  "allow_all_geographies": true,
  "disallow_vpn_usage": true,
  "disallow_hotlinking": true,
  "domains": {
    "domains": [
      "<string>"
    ]
  },
  "allow_all_domains": true,
  "require_authentication": true,
  "disabled": true,
  "require_entitlement": true,
  "geo_applicability_exempt": {
    "country_codes": [
      "<string>"
    ]
  },
  "geo_applicability_apply": {
    "country_codes": [
      "<string>"
    ]
  },
  "applies_to_all": true,
  "target": {
    "entity_ids": [
      "<string>"
    ],
    "event_ids": [
      "<string>"
    ],
    "creative_work_ids": [
      "<string>"
    ],
    "content_start_time": "2023-11-07T05:31:56Z",
    "content_end_time": "2023-11-07T05:31:56Z"
  },
  "drm": {
    "enabled": true,
    "hws_minimum_quality": 123,
    "split_keys": true
  },
  "enforce_concurrency_limits": true,
  "priority": "<string>"
}
'
{
  "video_protection_ruleset": {
    "project_id": "<string>",
    "name": "<string>",
    "id": "<string>",
    "geo_restrictions_disallow": {
      "country_codes": [
        "<string>"
      ]
    },
    "geo_restrictions_allow": {
      "country_codes": [
        "<string>"
      ]
    },
    "allow_all_geographies": true,
    "disallow_vpn_usage": true,
    "disallow_hotlinking": true,
    "domains": {
      "domains": [
        "<string>"
      ]
    },
    "allow_all_domains": true,
    "require_authentication": true,
    "disabled": true,
    "require_entitlement": true,
    "geo_applicability_exempt": {
      "country_codes": [
        "<string>"
      ]
    },
    "geo_applicability_apply": {
      "country_codes": [
        "<string>"
      ]
    },
    "applies_to_all": true,
    "target": {
      "entity_ids": [
        "<string>"
      ],
      "event_ids": [
        "<string>"
      ],
      "creative_work_ids": [
        "<string>"
      ],
      "content_start_time": "2023-11-07T05:31:56Z",
      "content_end_time": "2023-11-07T05:31:56Z"
    },
    "drm": {
      "enabled": true,
      "hws_minimum_quality": 123,
      "split_keys": true
    },
    "enforce_concurrency_limits": true,
    "priority": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
project_id
string
required

The ID of the project that the VideoProtectionRuleset belongs to.

name
string
required

Name of the Ruleset

geo_restrictions_disallow
object

Viewers are disallowed to consume the video from these countries (and allowed from all others)

geo_restrictions_allow
object

Viewers are allowed to consume the video from these countries (and disallowed from all others)

allow_all_geographies
boolean

Viewers from everywhere are allowed to watch. Set this to true explicitly (false will be treated as empty, i.e. neutral)

disallow_vpn_usage
boolean

Disallow viewers from using a VPN to consume the video

To leave this to neutral, leave the disallow_vpn_usage field empty. To explicitly allow VPN usage, set disallow_vpn_usage to false.

disallow_hotlinking
boolean

Disallow viewers from sharing a playlist URL with others (i.e. hotlink protection). This is done by binding the viewer's IP address to the playlist URL.

To leave this to neutral, leave the disallow_hotlinking field empty. To explicitly allow hotlinking, set disallow_hotlinking to false.

domains
object

A list of domains that are allowed to playback the video. An empty list implies all domains are valid. This uses the HTTP referrer, which can be spoofed and as such is not a strong protection mechanism.

Note: this uses the HTTP referrer. As native apps do not send any HTTP referrer, any client that does not send a referrer will be allowed.

To leave this to neutral, leave the allowed_domains field empty. To explicitly allow all domains, pass allow_all_domains as true.

allow_all_domains
boolean

All domains are treated as allowed. Set this to true explicitly (false will be treated as empty, i.e. neutral)

require_authentication
boolean

Require viewers to be signed in. This requires the viewer to have a valid JWT, signed by the Motto identity service. The JWT should be passed either via the Authorization header or as a Cookie.

To leave this to neutral, leave the require_authentication field empty. To explicitly allow unauthenticated access, set require_authentication to false.

disabled
boolean

Disables the ruleset. This is useful for ensuring the ruleset no longer shows up as an option in the UI. It will continue to apply to any videos that already have this ruleseet applied (unlike a deleted ruleset).

require_entitlement
boolean

Instruct the Motto content-delivery API to do an entitlement lookup for the user ID that the viewer is providing in a JWT when trying to access the content. This works in tandem with the Entitlement and Offer types in Motto's monetization section.

Note: This requires require_authentication to be set to true.

To leave this to neutral, leave the require_entitlement field empty. To explicitly not require entitlement, set require_entitlement to false.

geo_applicability_exempt
object

Viewers from these countries will not have this ruleset applied.

geo_applicability_apply
object

Viewers from these countries will have this ruleset applied.

applies_to_all
boolean

This ruleset applies to all videos in the project.

target
object

This ruleset applies to a specific set of videos, as defined by the target.

drm
object

The DRM settings for the video. If not provided, the video will not have any DRM applied.

To leave this to neutral, leave the drm field empty. To explicitly not apply any DRM, set drm.enabled to false.

enforce_concurrency_limits
boolean

If true, Motto's streaming platform will enforce concurrency limits for this video. This only works in combination with require_authentication and require_entitlement being set to true.

To leave this to neutral, leave the enforce_concurrency_limits field empty. To explicitly not enforce concurrency limits, set enforce_concurrency_limits to false.

priority
string

The priority of the ruleset. If multiple rulesets apply to a video, the ruleset with the highest priority will be used.

Response

OK

video_protection_ruleset
object