# List Streaming Policies

get ` https://app.mk.io/api/v1/projects/:project_name/media/streamingPolicies`

## Listing, Sorting and Filtering Streaming Policies

This endpoint returns the list of streaming policies in the specified project.

### Sorting

The results from this endpoint can be ordered using the `$orderby` query parameter. Specify a list of field names, separated by commas where each one can optionally specify `asc` or `desc`.

Sorting is valid on the following fields: `created`, `createdBy`, `id`, `name`, `properties/created`, `updated`, `updatedBy`

### Filtering

The `$filter` query parameter allows for streaming policies to be filtered on the basis of fields in the schema using OData query syntax.  See [this document](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#filter) for more details on the syntax used.

Filters are valid on the following fields: `created`, `createdBy`, `createdByEmail`, `createdByName`, `id`, `name`, `properties/created`, `updated`, `updatedBy`, `updatedByEmail`, `updatedByName`

### Examples:

`?$top=10` \- Returns only the first 10 streaming policies from the list.

`?$orderby=name desc` \- Sorts streaming policies by name in descending order.

`?$filter=name eq 'descriptive name'` \- Returns streaming policies that match the provided name.

`?$orderby=created desc` \- Sorts streaming policies by creation date in descending order.

`?$filter=created ge 2021-01-01T00:00:00Z` \- Returns streaming policies created after January 1, 2021.

## Note that the default policies will always appear in the results

RBAC Capability Required: `ams.streamingpolicy.get`

## Authentication

Authorization Bearer

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

## Path parameters

project_name string Required

## Query parameters

$orderby string Optional

Specifies the key by which the result collection should be ordered.

$filter string Optional

Restricts the set of items returned.

$top string Optional

Specifies a non-negative integer `n` that limits the number of items returned from a collection.  The service returns the number of available items up to but not greater than the specified value `n`.

$skiptoken string Optional

Specifies a start offset to support paginated results.  Use `@odata.nextLink` in the result object to enumerate the collection - it will be present only if there's more than one page of entities.

## Response

200 A list of streaming policies.

@odata.nextLink string Optional

@odata.nextLink URL if the page length and number of items match.

supplemental object [ListResponseSupplementalSchema](https://docs.mediakind.com/api-reference/media-api/schemas/listresponsesupplementalschema) Required

Supplemental info

count integer Required

Number of items returned

kind string Required

Type of items in the list

operation string Required

Operation type. Should always say 'list'

pagination object [PaginationInfoSchema](https://docs.mediakind.com/api-reference/media-api/schemas/paginationinfoschema) Required

Pagination info

end integer Required

Position of the last item in the list

records integer Required

Total number of items returned in the list

start integer Required

Position of the first item in the list

total integer Required

Total number of items in the project

subscription object [ProjectInfoSchema](https://docs.mediakind.com/api-reference/media-api/schemas/projectinfoschema) Optional

Project info

id string Required

Project ID

name string Required

Project name

value list of objects [StreamingPolicySchema](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicyschema) Required

A list of streaming policies.

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 [StreamingPolicyProperties](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicyproperties) Required

The properties of the streaming policy.

catalog map from strings to any Optional

The custom catalog configuration.

commonEncryptionCbcs object [CommonEncryptionCbcs](https://docs.mediakind.com/api-reference/media-api/schemas/commonencryptioncbcs) Optional

CommonEncryptionCbcs

clearKeyEncryptionConfiguration object [ClearKeyEncryptionConfiguration](https://docs.mediakind.com/api-reference/media-api/schemas/clearkeyencryptionconfiguration) Optional

Clear key configuration

customKeysAcquisitionUrlTemplate string Optional

The custom license acquisition URL template for a Clear Key license delivery service.

clearTracks list of objects [StreamingPolicyTrackSelection](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicytrackselection) Optional

This represents which tracks should _not_ be encrypted.

trackSelections list of objects [StreamingPolicyTrackPropertyCondition](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicytrackpropertycondition) Optional

track selections is used to specify a set or a subset of track for selection by the streaming policy.

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 [StreamingPolicyContentKeys](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicycontentkeys) Optional

Content keys used by the streaming policy.

defaultKey object [DefaultKey](https://docs.mediakind.com/api-reference/media-api/schemas/defaultkey) 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 [StreamingPolicyContentKey](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicycontentkey) 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.

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 [StreamingPolicyTrackSelection](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicytrackselection) Optional

This represents which tracks should be encrypted.

track selections is used to specify a set or a subset of track for selection by the streaming policy.

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 [CbcsDrmConfiguration](https://docs.mediakind.com/api-reference/media-api/schemas/cbcsdrmconfiguration) Optional

DRM configuration

fairPlay object [StreamingPolicyFairPlayConfiguration](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicyfairplayconfiguration) 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 [StreamingPolicyPlayReadyConfiguration](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicyplayreadyconfiguration) 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 [StreamingPolicyWidevineConfiguration](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicywidevineconfiguration) Optional

Widevine configuration

customLicenseAcquisitionUrlTemplate string Optional

The custom license acquisition URL template for a Widevine license delivery service.

enabledProtocols object [EnabledProtocols](https://docs.mediakind.com/api-reference/media-api/schemas/enabledprotocols) 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 [CommonEncryptionCenc](https://docs.mediakind.com/api-reference/media-api/schemas/commonencryptioncenc) Optional

CommonEncryptionCenc

Clear key configuration

customKeysAcquisitionUrlTemplate string Optional

The custom license acquisition URL template for a Clear Key license delivery service.

clearTracks list of objects [StreamingPolicyTrackSelection](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicytrackselection) Optional

This represents which tracks should _not_ be encrypted.

track selections is used to specify a set or a subset of track for selection by the streaming policy.

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 [StreamingPolicyContentKeys](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicycontentkeys) Optional

Content keys used by the streaming policy.

defaultKey object [DefaultKey](https://docs.mediakind.com/api-reference/media-api/schemas/defaultkey) 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 [StreamingPolicyContentKey](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicycontentkey) 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.

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 [StreamingPolicyTrackSelection](https://docs.mediakind.com/api-reference/media-api/schemas/streamingpolicytrackselection) Optional

This represents which tracks should be encrypted.

track selections is used to specify a set or a subset of track for selection by the streaming policy.

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 [EnabledProtocols](https://docs.mediakind.com/api-reference/media-api/schemas/enabledprotocols) 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 [NoEncryption](https://docs.mediakind.com/api-reference/media-api/schemas/noencryption) Optional

NoEncryption

enabledProtocols object [EnabledProtocols](https://docs.mediakind.com/api-reference/media-api/schemas/enabledprotocols) 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 [SystemDataSchema](https://docs.mediakind.com/api-reference/media-api/schemas/systemdataschema) 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 Managed Identity 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 Managed Identity Key

type string Optional

The type of the resource. E.g. "Microsoft.Media/mediaservices/assets"

## Errors

400 Bad Request

error object [ErrorDetail](https://docs.mediakind.com/api-reference/media-api/schemas/errordetail) 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.

ref string Required

A reference to the request that caused the error.

status integer Required

The HTTP status code

401 Unauthorized

error object [ErrorDetail](https://docs.mediakind.com/api-reference/media-api/schemas/errordetail) 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.

ref string Required

A reference to the request that caused the error.

status integer Required

The HTTP status code

403 Forbidden

error object [ErrorDetail](https://docs.mediakind.com/api-reference/media-api/schemas/errordetail) 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.

ref string Required

A reference to the request that caused the error.

status integer Required

The HTTP status code

404 Not Found

error object [ErrorDetail](https://docs.mediakind.com/api-reference/media-api/schemas/errordetail) 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.

ref string Required

A reference to the request that caused the error.

status integer Required

The HTTP status code

429 Too Many Requests

error object [ErrorDetail](https://docs.mediakind.com/api-reference/media-api/schemas/errordetail) 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.

ref string Required

A reference to the request that caused the error.

status integer Required

The HTTP status code

500 Internal Server Error

error object [ErrorDetail](https://docs.mediakind.com/api-reference/media-api/schemas/errordetail) 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.

ref string Required

A reference to the request that caused the error.

status integer Required

The HTTP status code
