List Assets

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

Listing, Sorting and Filtering Assets

This endpoint returns the list of assets 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, labels, name, properties/alternateId, properties/assetId, properties/container, properties/containerDeletionPolicy, properties/created, properties/lastModified, properties/storageAccountName, properties/subPath, updated, updatedBy

Filtering

There are two ways to filter the set of returned assets from this endpoint - the first is to use the $filter query parameter, the second is to use the $label_key and $label query parameters.

The $filter query parameter allows for assets to be filtered on the basis of fields in the schema using OData query syntax. See this document for more details on the syntax used.

Filters are valid on the following fields: created, createdBy, createdByEmail, createdByName, id, labels, name, properties/alternateId, properties/assetId, properties/container, properties/containerDeletionPolicy, properties/created, properties/lastModified, properties/storageAccountName, properties/subPath, updated, updatedBy, updatedByEmail, updatedByName

$label_key and $label are specific to querying assets based on their labels. Labels are a set of key-value pairs that can be used to identify assets with any arbitrary metadata you want, specifically for the purpose of retrieving relevant subsets of assets.

Examples:

?$top=10 - Returns only the first 10 assets from the list.

?$orderby=name desc - Sorts assets by name in descending order.

?$filter=name eq 'descriptive name' - Returns assets that match the provided name.

?$orderby=created desc - Sorts assets by creation date in descending order.

?$filter=created ge 2021-01-01T00:00:00Z - Returns assets created after January 1, 2021.

?$label=studio=paravalley - Returns assets with the label studio set to paravalley.

?$label=release-date~2023 - Returns assets with the label release-date set to a value that contains 2023.

?$label_key=studio&label_key=release-date - Returns assets with any value set for the studio label and the release-date label.

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.
$label_key string Optional
Filters the set to the specified label key. If multiple $label_keys are specified, matching items must have all labels.
$label string Optional
Filters the set to the specified label key/value pair. Supports equality, inequality, and inexact matching. If multiple values are provided for the same key, items matching either value will be returned.

Response

200 A list of assets
@odata.nextLinkstringOptional
@odata.nextLink URL if the page length and number of items match.
supplementalobjectListResponseSupplementalSchemaRequired
Supplemental info
Show 5 propertiesHide 5 properties
countintegerRequired
Number of items returned
kindstringRequired
Type of items in the list
operationstringRequired
Operation type. Should always say 'list'
paginationobjectPaginationInfoSchemaRequired
Pagination info
Show 4 propertiesHide 4 properties
endintegerRequired
Position of the last item in the list
recordsintegerRequired
Total number of items returned in the list
startintegerRequired
Position of the first item in the list
totalintegerRequired
Total number of items in the project
subscriptionobjectProjectInfoSchemaOptional
Project info
Show 2 propertiesHide 2 properties
idstringRequired
Project ID
namestringRequired
Project name
valuelist of objectsAssetSchemaRequired
A list of assets.
Show 6 propertiesHide 6 properties
idstringOptional
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
labelsmap from strings to stringOptional

A dictionary of labels associated with the resource.

  • Maximum number of labels: 32.
  • Maximum length of a label or value: 256 characters.
  • Label: alphanumeric, hyphens and underscores.
  • Value: alphanumeric, hyphens, underscores and spaces.
Show value schemaHide value schema
[any key]string
namestringOptional1-260 characterspattern: ^[^\^\'<>%&:\\?/*+]+$
The name of the resource
propertiesobjectAssetPropertiesRequired
The properties of the asset.
Show 11 propertiesHide 11 properties
alternateIdstringOptional0-64 characters
An alternate ID of the asset.
assetIdstringOptionalformat: uuid
The Asset ID.
containerstringOptional3-63 characterspattern: ^(?!.*--)(?=[a-z0-9-]{3,63}$)(?!-)[a-z0-9]+(?:-[a-z0-9]+)*$
The name of the container if this asset is stored in an Azure storage account.
containerDeletionPolicyenumOptional

This field defines the deletion policy for the underlying storage. This determines the behavior when an asset record is deleted. There are two options, 'Delete', and 'Retain'.

A deletion policy of 'Delete' will result in the associated storage container or folder and all its contents being removed. A deletion policy of 'Retain' will leave the content in place. If left blank, the default behavior of the system will be to retain content.

Once set by the user, this value can be modified, but not un-set.

Allowed values:DeleteRetain
createdstringOptionalformat: date-time
The creation date of the Asset.
descriptionstringOptional0-4096 characters
The Asset description.
encryptionScopestring or nullOptional
Accepted, not supported. The name of the encryption scope to use within your storage container. Errors may be cryptic.
lastModifiedstringOptionalformat: date-time
The last modified date of the Asset.
storageAccountNamestringRequired0-255 characters
The name of the storage in MK.IO.
storageEncryptionFormatenumOptional
This field was deprecated in the v3 API. Accepted, not supported. Use an encryption scope instead.
Allowed values:NoneMediaStorageClientEncryption
subPathstringOptional1-256 characterspattern: ^(?!/)(?!.*(//|\?|%|&)).*[^/]$

Optional subpath for instances where your asset is not in the root of the container. This needs to be an absolute directory path and can't be an empty string or start with '.', './' or '/' or end with '/'.

Valid examples: 'path', 'path2', 'path/to/asset'

systemDataobjectSystemDataSchemaOptional
Metadata pertaining to creation and last modification of the resource.
Show 7 propertiesHide 7 properties
createdAtstringRequiredformat: date-time
The timestamp of resource creation (UTC).
createdBystringRequired
The identity that created the resource.
createdByTypeenumRequired
The type of identity that created the resource.
Allowed values:UserApplicationManagedIdentityKey
internalIdstringRequiredformat: uuid
The internal ID of the resource.
lastModifiedAtstringRequiredformat: date-time
The timestamp of resource last modification (UTC).
lastModifiedBystringRequired
The identity that last modified the resource.
lastModifiedByTypeenumRequired
The type of identity that last modified the resource.
Allowed values:UserApplicationManagedIdentityKey
typestringOptional
The type of the resource. E.g. "Microsoft.Media/mediaservices/assets"

Errors

400 Bad Request
errorobjectErrorDetailRequired
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
extraDetailmap from strings to anyOptional
Extra information regarding this error.
Show value schemaHide value schema
[any key]any
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
401 Unauthorized
errorobjectErrorDetailRequired
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
extraDetailmap from strings to anyOptional
Extra information regarding this error.
Show value schemaHide value schema
[any key]any
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
403 Forbidden
errorobjectErrorDetailRequired
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
extraDetailmap from strings to anyOptional
Extra information regarding this error.
Show value schemaHide value schema
[any key]any
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
404 Not Found
errorobjectErrorDetailRequired
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
extraDetailmap from strings to anyOptional
Extra information regarding this error.
Show value schemaHide value schema
[any key]any
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
429 Too Many Requests
errorobjectErrorDetailRequired
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
extraDetailmap from strings to anyOptional
Extra information regarding this error.
Show value schemaHide value schema
[any key]any
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
500 Internal Server Error
errorobjectErrorDetailRequired
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
extraDetailmap from strings to anyOptional
Extra information regarding this error.
Show value schemaHide value schema
[any key]any
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code