# Get

> Media API · Streaming Policies

```http
GET https://app.mk.io/api/v1/projects/{project_name}/media/streamingPolicies/{policy_name}
```

Get one Streaming Policy

RBAC Capability Required: `ams.streamingpolicy.get`

## Authentication

- `Authorization` header — Bearer authentication of the form `Bearer <token>`.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_name` | string | Yes | — |
| `policy_name` | string | Yes | — |

## Example request

```bash
curl -X GET "https://app.mk.io/api/v1/projects/{project_name}/media/streamingPolicies/{policy_name}" \
  -H "Authorization: Bearer <token>"
```

## Responses

### 200 — Returns a single Streaming Policy

- `id` · string · Optional — Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
- `name` · string · Optional · _1-260 characters_ · _pattern: ^[^\^\'<>%&:\\?/*+]+$_ — The name of the resource
- `properties` · object · **Required** — The properties of the streaming policy.
  - `catalog` · map from strings to any · Optional — The custom catalog configuration.
    - `[any key]` · any — map of additional properties
  - `commonEncryptionCbcs` · object · Optional — CommonEncryptionCbcs
    - `clearKeyEncryptionConfiguration` · object · Optional — Clear key configuration
      - `customKeysAcquisitionUrlTemplate` · string · Optional — The custom license acquisition URL template for a Clear Key license delivery service.
    - `clearTracks` · list of objects · Optional — This represents which tracks should *not* be encrypted.
      - Array items (object):
        - `trackSelections` · list of objects · Optional — track selections is used to specify a set or a subset of track for selection by the streaming policy.
          - Array items (object):
            - `operation` · enum · **Required** — Track property operation. Only equality is supported.
              - Allowed values: `Unknown`, `Equal`
            - `property` · enum · **Required** — Track property type
              - Allowed values: `Unknown`, `FourCC`
            - `value` · string · Optional — Track property value
    - `contentKeys` · object · Optional — Content keys used by the streaming policy.
      - `defaultKey` · object · Optional — Default content key used by the encryption.
        - `label` · string · Optional — Labels are a potential matching field for selecting a content key via a streaming locator.
        - `policyName` · string · Optional — Policy used by the key.
      - `keyToTrackMappings` · list of objects · Optional — List of content keys used by the key. Used to assign different keys to different tracks. For instance, using widevine L3 for SD and L1 for HD.
        - Array items (object):
          - `label` · string · Optional — Labels are a potential matching field for selecting a content key via a streaming locator.
          - `policyName` · string · Optional — Policy used by the key.
          - `tracks` · list of objects · Optional — This represents which tracks should be encrypted.
            - Array items (object):
              - `trackSelections` · list of objects · Optional — track selections is used to specify a set or a subset of track for selection by the streaming policy.
                - Array items (object):
                  - `operation` · enum · **Required** — Track property operation. Only equality is supported.
                    - Allowed values: `Unknown`, `Equal`
                  - `property` · enum · **Required** — Track property type
                    - Allowed values: `Unknown`, `FourCC`
                  - `value` · string · Optional — Track property value
    - `drm` · object · Optional — DRM configuration
      - `fairPlay` · object · Optional — FairPlay configuration
        - `allowPersistentLicense` · boolean · **Required** — Allow persistent license
        - `customLicenseAcquisitionUrlTemplate` · string · Optional — The custom license acquisition URL template for a FairPlay license delivery service.
      - `playReady` · object · Optional — PlayReady configuration
        - `customLicenseAcquisitionUrlTemplate` · string · Optional — The custom license acquisition URL template for a PlayReady license delivery service.
        - `playReadyCustomAttributes` · string · Optional — The custom attributes for PlayReady.
      - `widevine` · object · Optional — Widevine configuration
        - `customLicenseAcquisitionUrlTemplate` · string · Optional — The custom license acquisition URL template for a Widevine license delivery service.
    - `enabledProtocols` · object · Optional — Enabled protocols. This is the set of protocols (dash, download, and hls) that will be delivered with common encryption.
      - `dash` · boolean · **Required** — Enable Dash protocol
      - `download` · boolean · **Required** — Enable download protocol
      - `hls` · boolean · **Required** — Enable HLS protocol
      - `smoothStreaming` · boolean · **Required** — Smooth streaming is not supported and the value of this field is ignored.
  - `commonEncryptionCenc` · object · Optional — CommonEncryptionCenc
    - `clearKeyEncryptionConfiguration` · object · Optional — Clear key configuration
      - `customKeysAcquisitionUrlTemplate` · string · Optional — The custom license acquisition URL template for a Clear Key license delivery service.
    - `clearTracks` · list of objects · Optional — This represents which tracks should *not* be encrypted.
      - Array items (object):
        - `trackSelections` · list of objects · Optional — track selections is used to specify a set or a subset of track for selection by the streaming policy.
          - Array items (object):
            - `operation` · enum · **Required** — Track property operation. Only equality is supported.
              - Allowed values: `Unknown`, `Equal`
            - `property` · enum · **Required** — Track property type
              - Allowed values: `Unknown`, `FourCC`
            - `value` · string · Optional — Track property value
    - `contentKeys` · object · Optional — Content keys used by the streaming policy.
      - `defaultKey` · object · Optional — Default content key used by the encryption.
        - `label` · string · Optional — Labels are a potential matching field for selecting a content key via a streaming locator.
        - `policyName` · string · Optional — Policy used by the key.
      - `keyToTrackMappings` · list of objects · Optional — List of content keys used by the key. Used to assign different keys to different tracks. For instance, using widevine L3 for SD and L1 for HD.
        - Array items (object):
          - `label` · string · Optional — Labels are a potential matching field for selecting a content key via a streaming locator.
          - `policyName` · string · Optional — Policy used by the key.
          - `tracks` · list of objects · Optional — This represents which tracks should be encrypted.
            - Array items (object):
              - `trackSelections` · list of objects · Optional — track selections is used to specify a set or a subset of track for selection by the streaming policy.
                - Array items (object):
                  - `operation` · enum · **Required** — Track property operation. Only equality is supported.
                    - Allowed values: `Unknown`, `Equal`
                  - `property` · enum · **Required** — Track property type
                    - Allowed values: `Unknown`, `FourCC`
                  - `value` · string · Optional — Track property value
    - `drm` · object · Optional — DRM configuration
      - `playReady` · object · Optional — PlayReady configuration
        - `customLicenseAcquisitionUrlTemplate` · string · Optional — The custom license acquisition URL template for a PlayReady license delivery service.
        - `playReadyCustomAttributes` · string · Optional — The custom attributes for PlayReady.
      - `widevine` · object · Optional — Widevine configuration
        - `customLicenseAcquisitionUrlTemplate` · string · Optional — The custom license acquisition URL template for a Widevine license delivery service.
    - `enabledProtocols` · object · Optional — Enabled protocols. This is the set of protocols (dash, download, and hls) that will be delivered with common encryption.
      - `dash` · boolean · **Required** — Enable Dash protocol
      - `download` · boolean · **Required** — Enable download protocol
      - `hls` · boolean · **Required** — Enable HLS protocol
      - `smoothStreaming` · boolean · **Required** — Smooth streaming is not supported and the value of this field is ignored.
  - `defaultContentKeyPolicyName` · string · Optional · _<=260 characters_ — The default content key policy name used by current streaming policy.
  - `envelopeEncryption` · object · Optional — EnvelopeEncryption
    - `clearTracks` · list of objects · Optional — Clear tracks. This is the set of tracks that will be delivered without envelope encryption.
      - Array items (object):
        - `trackSelections` · list of objects · Optional — track selections is used to specify a set or a subset of track for selection by the streaming policy.
          - Array items (object):
            - `operation` · enum · **Required** — Track property operation. Only equality is supported.
              - Allowed values: `Unknown`, `Equal`
            - `property` · enum · **Required** — Track property type
              - Allowed values: `Unknown`, `FourCC`
            - `value` · string · Optional — Track property value
    - `contentKeys` · object · Optional — Content keys used by the streaming policy.
      - `defaultKey` · object · Optional — Default content key used by the encryption.
        - `label` · string · Optional — Labels are a potential matching field for selecting a content key via a streaming locator.
        - `policyName` · string · Optional — Policy used by the key.
      - `keyToTrackMappings` · list of objects · Optional — List of content keys used by the key. Used to assign different keys to different tracks. For instance, using widevine L3 for SD and L1 for HD.
        - Array items (object):
          - `label` · string · Optional — Labels are a potential matching field for selecting a content key via a streaming locator.
          - `policyName` · string · Optional — Policy used by the key.
          - `tracks` · list of objects · Optional — This represents which tracks should be encrypted.
            - Array items (object):
              - `trackSelections` · list of objects · Optional — track selections is used to specify a set or a subset of track for selection by the streaming policy.
                - Array items (object):
                  - `operation` · enum · **Required** — Track property operation. Only equality is supported.
                    - Allowed values: `Unknown`, `Equal`
                  - `property` · enum · **Required** — Track property type
                    - Allowed values: `Unknown`, `FourCC`
                  - `value` · string · Optional — Track property value
    - `customKeyAcquisitionUrlTemplate` · string · Optional · _1-1024 characters_ — Optional template for the customer service to use for key acquisition. Not needed if using the built-in key delivery service.
    - `enabledProtocols` · object · Optional — Enabled protocols. This is the set of protocols (dash, download, and hls) that will be delivered with envelope encryption.
      - `dash` · boolean · **Required** — Enable Dash protocol
      - `download` · boolean · **Required** — Enable download protocol
      - `hls` · boolean · **Required** — Enable HLS protocol
      - `smoothStreaming` · boolean · **Required** — Smooth streaming is not supported and the value of this field is ignored.
  - `noEncryption` · object · Optional — NoEncryption
    - `enabledProtocols` · object · Optional — Enabled protocols. This is the set of protocols (dash, download, and hls) that will be delivered without encryption.
      - `dash` · boolean · **Required** — Enable Dash protocol
      - `download` · boolean · **Required** — Enable download protocol
      - `hls` · boolean · **Required** — Enable HLS protocol
      - `smoothStreaming` · boolean · **Required** — Smooth streaming is not supported and the value of this field is ignored.
- `systemData` · object · Optional — Metadata pertaining to creation and last modification of the resource.
  - `createdAt` · string · **Required** · _format: date-time_ — The timestamp of resource creation (UTC).
  - `createdBy` · string · **Required** — The identity that created the resource.
  - `createdByType` · enum · **Required** — The type of identity that created the resource.
    - Allowed values: `User`, `Application`, `ManagedIdentity`, `Key`
  - `internalId` · string · **Required** · _format: uuid_ — The internal ID of the resource.
  - `lastModifiedAt` · string · **Required** · _format: date-time_ — The timestamp of resource last modification (UTC).
  - `lastModifiedBy` · string · **Required** — The identity that last modified the resource.
  - `lastModifiedByType` · enum · **Required** — The type of identity that last modified the resource.
    - Allowed values: `User`, `Application`, `ManagedIdentity`, `Key`
- `type` · string · Optional — The type of the resource. E.g. "Microsoft.Media/mediaservices/assets"

Example:

```json
{
  "id": "string",
  "name": "name",
  "properties": {
    "catalog": {
      "key": null
    },
    "commonEncryptionCbcs": {
      "clearKeyEncryptionConfiguration": {
        "customKeysAcquisitionUrlTemplate": "string"
      },
      "clearTracks": [
        {
          "trackSelections": [
            {
              "operation": "Unknown",
              "property": "Unknown",
              "value": "string"
            }
          ]
        }
      ],
      "contentKeys": {
        "defaultKey": {
          "label": "string",
          "policyName": "string"
        },
        "keyToTrackMappings": [
          {
            "label": "string",
            "policyName": "string",
            "tracks": [
              {
                "trackSelections": [
                  {
                    "operation": "Unknown",
                    "property": "Unknown",
                    "value": "string"
                  }
                ]
              }
            ]
          }
        ]
      },
      "drm": {
        "fairPlay": {
          "allowPersistentLicense": true,
          "customLicenseAcquisitionUrlTemplate": "string"
        },
        "playReady": {
          "customLicenseAcquisitionUrlTemplate": "string",
          "playReadyCustomAttributes": "string"
        },
        "widevine": {
          "customLicenseAcquisitionUrlTemplate": "string"
        }
      },
      "enabledProtocols": {
        "dash": true,
        "download": true,
        "hls": true,
        "smoothStreaming": true
      }
    },
    "commonEncryptionCenc": {
      "clearKeyEncryptionConfiguration": {
        "customKeysAcquisitionUrlTemplate": "string"
      },
      "clearTracks": [
        {
          "trackSelections": [
            {
              "operation": "Unknown",
              "property": "Unknown",
              "value": "string"
            }
          ]
        }
      ],
      "contentKeys": {
        "defaultKey": {
          "label": "string",
          "policyName": "string"
        },
        "keyToTrackMappings": [
          {
            "label": "string",
            "policyName": "string",
            "tracks": [
              {
                "trackSelections": [
                  {
                    "operation": "Unknown",
                    "property": "Unknown",
                    "value": "string"
                  }
                ]
              }
            ]
          }
        ]
      },
      "drm": {
        "playReady": {
          "customLicenseAcquisitionUrlTemplate": "string",
          "playReadyCustomAttributes": "string"
        },
        "widevine": {
          "customLicenseAcquisitionUrlTemplate": "string"
        }
      },
      "enabledProtocols": {
        "dash": true,
        "download": true,
        "hls": true,
        "smoothStreaming": true
      }
    },
    "defaultContentKeyPolicyName": "string",
    "envelopeEncryption": {
      "clearTracks": [
        {
          "trackSelections": [
            {
              "operation": "Unknown",
              "property": "Unknown",
              "value": "string"
            }
          ]
        }
      ],
      "contentKeys": {
        "defaultKey": {
          "label": "string",
          "policyName": "string"
        },
        "keyToTrackMappings": [
          {
            "label": "string",
            "policyName": "string",
            "tracks": [
              {
                "trackSelections": [
                  {
                    "operation": "Unknown",
                    "property": "Unknown",
                    "value": "string"
                  }
                ]
              }
            ]
          }
        ]
      },
      "customKeyAcquisitionUrlTemplate": "string",
      "enabledProtocols": {
        "dash": true,
        "download": true,
        "hls": true,
        "smoothStreaming": true
      }
    },
    "noEncryption": {
      "enabledProtocols": {
        "dash": true,
        "download": true,
        "hls": true,
        "smoothStreaming": true
      }
    }
  },
  "systemData": {
    "createdAt": "2024-01-01T00:00:00Z",
    "createdBy": "string",
    "createdByType": "User",
    "internalId": "00000000-0000-0000-0000-000000000000",
    "lastModifiedAt": "2024-01-01T00:00:00Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User"
  },
  "type": "string"
}
```

### 400 — Bad Request

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 401 — Unauthorized

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 403 — Forbidden

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 404 — Not Found

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 429 — Too Many Requests

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 500 — Internal Server Error

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

---

Source spec: `media-api` · operationId: `[get]_/api/v1/projects/{project_name}/media/streamingPolicies/{policy_name}`
