> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mottostreaming.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update ruleset

> UpdateVideoProtectionRuleset

 Updates a video_protection_ruleset. When updating a ruleset that is already attached to one or more videos, this
 change will apply to all of those videos (including past ones).

 These changes apply asynchronously and may take a bit of time to propagate.



## OpenAPI

````yaml patch /streaming/video_protection/v2/rulesets/{video_protection_ruleset_id}
openapi: 3.0.3
info:
  title: Studio API - Motto
  version: 0.0.0
servers:
  - url: https://api.mottostreaming.com
    description: Production server
security:
  - BearerAuth: []
tags:
  - name: AccountService
    description: Account management service
  - name: ActionConfigurationService
    description: Action configuration service definition
  - name: ActionSecretService
    description: Action type service definition
  - name: ActionService
    description: Action service definition
  - name: ActionTypeService
    description: Action type service definition
  - name: ActivityService
    description: Activity service definition
  - name: AdService
    description: Ad management service.
  - name: AnnotationService
    description: Annotation service definition
  - name: AnnotationSetService
    description: Annotation service definition
  - name: AnnotationTypeService
    description: Annotation service definition
  - name: AssetService
    description: Asset management service.
  - name: AuthService
    description: Auth service definition
  - name: BannerService
    description: Banner service definition
  - name: BannerV2Service_v2
    description: Banner service definition
  - name: CleengService
    description: CleengService service definition
  - name: ClipService
    description: ClipService is the service that handles Clip operations.
  - name: ConfigurationService
    description: >-
      Configuration management service. These configurations allow modifying the
      behavior of streams, uploads, simulcasts, etc.
  - name: ContentTypeService
    description: ContentType service definition
  - name: CreativeWorkService
    description: CreativeWork service definition
  - name: EntitlementService
    description: Entitlement service definition
  - name: EntityService
    description: Entity service definition
  - name: EventService
    description: Event service definition
  - name: FileService
    description: OTT files management.
  - name: IngestService
    description: Ingest management service.
  - name: IngestService_v2
    description: Ingest management service.
  - name: LiveStreamService
    description: LiveStream management service.
  - name: LiveStreamService_v2
    description: LiveStream management service.
  - name: OfferService
    description: Offer service definition
  - name: OrganizationService
    description: Organization management service.
  - name: PageService
    description: Page service definition
  - name: PlatformService
    description: Platform service definition
  - name: PlaylistService
    description: Playlist management service.
  - name: ProjectService
    description: Project management service.
  - name: SimulcastService
    description: Simulcast management service.
  - name: SlugService
    description: Slug service definition
  - name: SpiideoService
    description: SpiideoService service definition
  - name: StandingService
    description: Standing service definition
  - name: StitcherService
    description: StitcherService is the service that handles stitching operations.
  - name: StripeService
    description: StripeService service definition
  - name: SubscriptionService
    description: Subscription service definition
  - name: SubtitleService
    description: SubtitleService is the service that handles Subtitle operations.
  - name: TransactionService
    description: Transaction service definition
  - name: UploadService
    description: Upload management service.
  - name: UsageService
    description: The UsageService provides methods to retrieve usage data for SKUs.
  - name: UserService
    description: User management service
  - name: VODService
    description: VODService is the service that handles VOD operations.
  - name: VODService_v2
    description: VODService is the service that handles VOD operations.
  - name: VideoProtectionService
    description: VideoProtection management service.
  - name: VideoProtectionService_v2
    description: VideoProtection management service.
  - name: VideoService
    description: Video management service.
paths:
  /streaming/video_protection/v2/rulesets/{video_protection_ruleset_id}:
    patch:
      tags:
        - VideoProtectionService_v2
      description: |-
        UpdateVideoProtectionRuleset

         Updates a video_protection_ruleset. When updating a ruleset that is already attached to one or more videos, this
         change will apply to all of those videos (including past ones).

         These changes apply asynchronously and may take a bit of time to propagate.
      operationId: VideoProtectionService_v2_UpdateVideoProtectionRuleset
      parameters:
        - name: video_protection_ruleset_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/motto.streaming.video_protection.v2.UpdateVideoProtectionRulesetRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/motto.streaming.video_protection.v2.UpdateVideoProtectionRulesetResponse
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
components:
  schemas:
    motto.streaming.video_protection.v2.UpdateVideoProtectionRulesetRequest:
      required:
        - video_protection_ruleset_id
      type: object
      properties:
        video_protection_ruleset_id:
          type: string
        video_protection_ruleset:
          $ref: >-
            #/components/schemas/motto.streaming.video_protection.v2.VideoProtectionRuleset
        update_mask:
          type: string
          format: field-mask
    motto.streaming.video_protection.v2.UpdateVideoProtectionRulesetResponse:
      type: object
      properties:
        video_protection_ruleset:
          $ref: >-
            #/components/schemas/motto.streaming.video_protection.v2.VideoProtectionRuleset
    google.rpc.Status:
      type: object
      properties:
        code:
          type: integer
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          format: int32
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
          description: >-
            A list of messages that carry the error details.  There is a common
            set of message types for APIs to use.
      description: >-
        The `Status` type defines a logical error model that is suitable for
        different programming environments, including REST APIs and RPC APIs. It
        is used by [gRPC](https://github.com/grpc). Each `Status` message
        contains three pieces of data: error code, error message, and error
        details. You can find out more about this error model and how to work
        with it in the [API Design
        Guide](https://cloud.google.com/apis/design/errors).
    motto.streaming.video_protection.v2.VideoProtectionRuleset:
      required:
        - project_id
        - name
      type: object
      properties:
        id:
          readOnly: true
          type: string
        project_id:
          type: string
          description: The ID of the project that the VideoProtectionRuleset belongs to.
        name:
          type: string
          description: Name of the Ruleset
        geo_restrictions_disallow:
          allOf:
            - $ref: >-
                #/components/schemas/motto.streaming.video_protection.v2.CountryCodes
          description: >-
            Viewers are disallowed to consume the video from these countries
            (and allowed from all others)


            Important: at most one of `geo_restrictions_disallow`,
            `geo_restrictions_allow`, `allow_all_geographies` may be set per
            request.
        geo_restrictions_allow:
          allOf:
            - $ref: >-
                #/components/schemas/motto.streaming.video_protection.v2.CountryCodes
          description: >-
            Viewers are allowed to consume the video from these countries (and
            disallowed from all others)


            Important: at most one of `geo_restrictions_disallow`,
            `geo_restrictions_allow`, `allow_all_geographies` may be set per
            request.
        allow_all_geographies:
          type: boolean
          description: >-
            Viewers from everywhere are allowed to watch. Set this to true
            explicitly (false will be treated as empty, i.e. neutral)


            Important: at most one of `geo_restrictions_disallow`,
            `geo_restrictions_allow`, `allow_all_geographies` may be set per
            request.
        disallow_vpn_usage:
          type: boolean
          description: |-
            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:
          type: boolean
          description: >-
            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:
          allOf:
            - $ref: '#/components/schemas/motto.streaming.video_protection.v2.Domains'
          description: >-
            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.

            Important: at most one of `domains`, `allow_all_domains` may be set
            per request.
        allow_all_domains:
          type: boolean
          description: >-
            All domains are treated as allowed. Set this to true explicitly
            (false will be treated as empty, i.e. neutral)


            Important: at most one of `domains`, `allow_all_domains` may be set
            per request.
        require_authentication:
          type: boolean
          description: >-
            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:
          type: boolean
          description: >-
            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:
          type: boolean
          description: >-
            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:
          allOf:
            - $ref: >-
                #/components/schemas/motto.streaming.video_protection.v2.CountryCodes
          description: >-
            Viewers from these countries will not have this ruleset applied.


            Important: at most one of `geo_applicability_exempt`,
            `geo_applicability_apply` may be set per request.
        geo_applicability_apply:
          allOf:
            - $ref: >-
                #/components/schemas/motto.streaming.video_protection.v2.CountryCodes
          description: >-
            Viewers from these countries will have this ruleset applied.


            Important: at most one of `geo_applicability_exempt`,
            `geo_applicability_apply` may be set per request.
        applies_to_all:
          type: boolean
          description: >-
            This ruleset applies to all videos in the project.


            Important: at most one of `applies_to_all`, `target`, `filter` may
            be set per request.
        target:
          allOf:
            - $ref: '#/components/schemas/motto.streaming.video_protection.v2.Target'
          description: >-
            This ruleset applies to a specific set of videos, as defined by the
            target.


            Important: at most one of `applies_to_all`, `target`, `filter` may
            be set per request.
        filter:
          allOf:
            - $ref: >-
                #/components/schemas/motto.streaming.video_protection.v2.FilterTarget
          description: >-
            This ruleset applies to a complex set of events and creative works,
            as defined by the filter target.


            Important: at most one of `applies_to_all`, `target`, `filter` may
            be set per request.
        drm:
          allOf:
            - $ref: '#/components/schemas/motto.streaming.video_protection.v2.DRM'
          description: >-
            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:
          type: boolean
          description: >-
            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:
          type: string
          description: >-
            The priority of the ruleset. If multiple rulesets apply to a video,
            the ruleset with the highest priority will be used.
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
          description: The type of the serialized message.
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
    motto.streaming.video_protection.v2.CountryCodes:
      type: object
      properties:
        country_codes:
          type: array
          items:
            type: string
          description: >-
            A country code (ISO 3316-1 alpha-2:
            https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
      description: A list of country codes
    motto.streaming.video_protection.v2.Domains:
      type: object
      properties:
        domains:
          type: array
          items:
            type: string
          description: A list of domains
      description: A list of domains
    motto.streaming.video_protection.v2.Target:
      type: object
      properties:
        entity_ids:
          type: array
          items:
            type: string
          description: >-
            The entities with which this ruleset is associated. If provided, all
            videos that are associated with these entities will be included in
            the ruleset.
        event_ids:
          type: array
          items:
            type: string
          description: >-
            The events with which this ruleset is associated. If provided, all
            videos that are associated with these events will be included in the
            ruleset.
        creative_work_ids:
          type: array
          items:
            type: string
          description: >-
            The creative works with which this ruleset is associated. If
            provided, all videos that are associated with these creative works
            will be included in the ruleset.
        content_start_time:
          type: string
          description: >-
            Any content defined by `entity_ids`, `event_ids` and
            `creative_work_ids` after `content_start_time` will be considered as
            part of the ruleset (as long as it is before `content_end_time`).
             If not provided, there is no lower time bound on the content.
          format: date-time
        content_end_time:
          type: string
          description: >-
            Any content defined by `entity_ids`, `event_ids` and
            `creative_work_ids` before `content_end_time` will be considered as
            part of the ruleset (as long as it is after `content_start_time`).
             If not provided, there is no upper time bound on the content.
          format: date-time
        video_ids:
          type: array
          items:
            type: string
          description: |-
            The video IDs of the videos that are associated with this ruleset.
             It is recommended to only use this when the videos are not associated with an event/creative work, or the event/creative work it is associated with
             has other videos with deviating configurations.
    motto.streaming.video_protection.v2.FilterTarget:
      type: object
      properties:
        filter_events:
          type: string
          description: >-
            The filter to apply to the events that should be targeted. To test
            your filter, you can use the `ListEvents` API
             on the CMS to see which results it includes.

             Important: an empty string means NO events are included (unlike in `ListEvents` API, where it includes all events).
             To target all events, pass the string `true`.
        filter_creative_works:
          type: string
          description: >-
            The filter to apply to the creative works that should be targeted.
            To test your filter, you can use the `ListCreativeWorks` API
             on the CMS to see which results it includes.

             Important: an empty string means NO creative works are included (unlike in `ListCreativeWorks` API, where it includes all events).
             To target all creative works, pass the string `true`.
    motto.streaming.video_protection.v2.DRM:
      required:
        - enabled
      type: object
      properties:
        enabled:
          type: boolean
          description: >-
            Whether to enable DRM for the video. This will not affect any
            content that has already been streamed or uploaded
             (for such content, the settings that were in place at the time of processing will still apply).
        hws_minimum_quality:
          type: integer
          description: >-
            Optional. If you want to enforce hardware secure (HWS) decryption
            for stream variant qualities, this value should
             be used to define the lower bound of the quality that should be protected with HWS.
             For example, if you set this to `720`, then all qualities >= 720p will require the Widevine L1 security level
             (which is the strictest level of security).
             Setting this to 0 will allow both HWS and SWS (decryption in software) for all qualities.
             Setting this to 1 will effectively disable SWS entirely, meaning that all qualities will require HWS decryption.

             Note: updating this will have no effect on content that has already been streamed or uploaded.
          format: int32
        split_keys:
          type: boolean
          description: >-
            Optional. When true, separate keys will be provisioned for video and
            audio tracks.
             If `false`, the audio track will be encrypted with the same key as the video track.
             If `false` in combination with `hws_minimum_quality` > 0, this will result in two keys: one for software secured video + audio, one for hardware-secured video.
             If `true` in combination with `hws_minimum_quality` > 0, this will result in three keys: one for software secured video, one for hardware-secured video, and one for audio.
             Defaults to false.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````