# Assets An [`Asset`](#tag/Assets) is the main resource in Dash. It consists of: * One or more [`AssetFile`](#operation/getAssetFiles) resources, detailing the versions of a file for an [`Asset`](#tag/Assets). Only the current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned with the [`Asset`](#tag/Assets) resource. Use [GET Asset Files](#operation/getAssetFiles) to retrieve all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) * [`Asset.metadata`](#tag/Assets) which defines the assigned values for this [`Asset`](#tag/Assets) for [`Field`](#tag/Fields) resources * A number of fixed properties, e.g. `addedBy` the `User.id` of whoever added the [`Asset`](#tag/Assets) For the sake of performance any [`Field`](#tag/Fields) and [`FieldOption`](#tag/Field-Options) resources referenced in the [`Asset.metadata.values`](#tag/Assets) will need to be retrieved separately, if required. ## Get an asset. - [GET /assets/{id}](https://api-docs.dash.app/dash/openapi/assets/getasset.md): Get an Asset ## Delete an asset - [DELETE /assets/{id}](https://api-docs.dash.app/dash/openapi/assets/deleteasset.md): Delete an Asset. All associated AssetFile resources will also be deleted. ## Update an asset - [PATCH /assets/{id}](https://api-docs.dash.app/dash/openapi/assets/patchasset.md): Patch an Asset ## Create some new assets - [POST /assets-creations](https://api-docs.dash.app/dash/openapi/assets/postassetscreations.md): Create a specified number of new Assets without files. AssetUploads can be done separately. ## Create assets and upload files - [POST /asset-and-upload-batch-jobs](https://api-docs.dash.app/dash/openapi/assets/postassetanduploadbatchjob.md): An AssetAndUploadBatchJob should be created when you want to create multiple Asset resources and also create an AssetUpload for each of them. Each asset can be uploaded in a single part or in multiple parts. If the filesize is less than 5MiB then it must be uploaded in a single part. If the filesize is greater than 5GiB then it must be uploaded in multiple parts, each smaller than 5GiB. The AssetUpload resources in the completed job should then be used to upload the files for each and asset and complete each upload. After the Asset resources have been created and files uploaded to them they will still be in Asset.lifecycleStatus.state = 'STAGED'. To send them for approval or put them live see Asset Lifecycle. ## Get the status of creating assets and uploading files - [GET /asset-and-upload-batch-jobs/{id}](https://api-docs.dash.app/dash/openapi/assets/getassetanduploadbatchjob.md): Get the status and eventual result of an AssetAndUploadBatchJob ## Upload an asset file - [POST /asset-uploads](https://api-docs.dash.app/dash/openapi/assets/postassetupload.md): Create a new AssetUpload resource for an existing Asset. ## Upload files to assets - [POST /asset-upload-batch-jobs](https://api-docs.dash.app/dash/openapi/assets/postassetuploadbatchjob.md): An AssetUploadBatchJob should be created when you want to create an AssetUpload for multiple assets. The AssetUpload resources in the completed job should then be used to upload the files for each and asset and complete each upload. After the files have been uploaded to the Assets they will still be in Asset.lifecycleStatus.state = 'STAGED'. To send them for approval or put them live see Asset Lifecycle. ## Get the status of uploading files - [GET /asset-upload-batch-jobs/{id}](https://api-docs.dash.app/dash/openapi/assets/getassetuploadbatchjob.md): Get the status and eventual result of an AssetUploadBatchJob ## Complete an asset file upload - [POST /asset-upload-completions](https://api-docs.dash.app/dash/openapi/assets/postassetuploadcompletion.md): After an AssetUpload has been created and each part of the file data has been PUT to the relavant URL the eTag from each PUT must be sent to indicate the upload is complete. ## Get an asset's files - [GET /assets/{id}/files](https://api-docs.dash.app/dash/openapi/assets/getassetfiles.md): Get all of the AssetFile resources for the specified Asset. ## Delete an asset file - [DELETE /asset-files/{id}](https://api-docs.dash.app/dash/openapi/assets/deleteassetfile.md): Delete an AssetFile resource. The Asset's current AssetFile cannot be deleted and will return an error if tried. (Only older version AssetFiles can be deleted.) ## Download assets - [POST /asset-download-batch-jobs](https://api-docs.dash.app/dash/openapi/assets/postassetdownloadbatchjob.md): An AssetDownloadBatchJob should be created when you want to download and optionally transform multiple AssetFile resources. You can optionally request that a zip is created of all the transformed files. The transformationDescription in the request can be one of two types, CUSTOM or PRESET. A CUSTOM transformationDescription is a list of candidateTransformations which are evaluated in turn against each AssetFile specified in the request. If the AssetFile meets the candidateTransformation.criteria then the candidateTransformation.transformation is applied. Otherwise, the next candiate is considered. The candidateTransformation.transformation is a series of operations to apply to the AssetFile in order (e.g. resize to 200 by 100 and then covert to JPG). An empty list of operations indicates the file should be left untransformed. Putting this all together this allows you to describe a transformations such as: * Resized any image file, otherwise leave the file untransformed * Convert any image that supports transparency to PNG otherwise convert to JPG A PRESET transformationDescription is similar to a CUSTOM transformation except the transformationDescription has been predefined. These presets are currently only configurable via the Dash frontend, but can be found via a PresetTransformationSearch. ## Get the status of downloading assets - [GET /asset-download-batch-jobs/{id}](https://api-docs.dash.app/dash/openapi/assets/getassetdownloadbatchjob.md): Get the status and eventual result of an AssetDownloadBatchJob ## Search for assets - [POST /asset-searches](https://api-docs.dash.app/dash/openapi/assets/postassetsearch.md): A standard AssetSearch will only allow you to page to 10,000 results regardless of the value returned in the totalResults property. If you need to be able to process more than 10,000 results consider an AssetScrollSearch instead. ## Scroll search for assets - [POST /asset-scroll-searches](https://api-docs.dash.app/dash/openapi/assets/postassetscrollsearch.md): Asset scroll searches provide a means of scrolling one way through search results of any number of Asset resources. Page size can stil be specified, but a scroll search will always proceed sequentially once through each page. The AssetScrollSearch.scrollId in the search the response is used to continue the scroll search. ## Continue an asset scroll search - [POST /asset-scroll-search-scrolls](https://api-docs.dash.app/dash/openapi/assets/postassetscrollsearchscroll.md): Continue a previoulsy started AssetScrollSearch. > You must use the scrollId resturned in each new response as a scrollId is not guarenteed to remain fixed over the course of a scroll ## Update assets' metadata - [POST /asset-metadata-edit-batch-jobs](https://api-docs.dash.app/dash/openapi/assets/postassetmetadataeditbatchjob.md): Edit the metadata of a set of Assets by the specified assets selector. Use the BY_IDS selector to edit a specific list of Asset.ids, or the BY_CRITERION selector to edit a search criterion, e.g. all Assets in a specific folder. See AssetSearch for more detail on the available criterion. metadataFieldValueUpdates also has two types of objects that can be used. For example, a FieldOption with a value of "My Option" and an id of "3ba2cb5b-dbe9-48ed-8e07-71f26929e617" can be set either BY_VALUES by using the value "My Option", or BY_IDS by using the id "3ba2cb5b-dbe9-48ed-8e07-71f26929e617". For Fields that do not have FieldOptions (e.g. text fields), either type can be used. ## Get the status of updating assets' metadata - [GET /asset-metadata-edit-batch-jobs/{id}](https://api-docs.dash.app/dash/openapi/assets/getassetmetadataeditbatchjob.md): Get the status of a Asset Metadata Edit Batch Job ## Get metadata suggestions for assets - [POST /asset-metadata-suggestion-batch-jobs](https://api-docs.dash.app/dash/openapi/assets/postassetmetadatasuggestionbatchjob.md): Get metadata suggestions for a set of Assets by the specified assets selector. Use the BY_IDS selector to get suggestions for a specific list of Asset.ids, or the BY_CRITERION selector to get suggestions for a search criterion, e.g. all Assets in a specific folder. See AssetSearch for more detail on the available criterion. ## Create rejected asset metadata suggestions - [POST /rejected-asset-metadata-suggestion-batches](https://api-docs.dash.app/dash/openapi/assets/postrejectedassetmetadatasuggestionbatches.md): Record the fact that some asset metadata suggestions have been rejected, and should therefore not be suggested again for the given asset. ## Get the status of metadata suggestions for assets - [GET /asset-metadata-suggestion-batch-jobs/{id}](https://api-docs.dash.app/dash/openapi/assets/getassetmetadatasuggestionbatchjob.md): Get the status of a Asset Suggestion Edit Batch Job ## Update assets' lifecycle stage - [POST /asset-lifecycle-transition-batch-jobs](https://api-docs.dash.app/dash/openapi/assets/postassetlifecycletransitionbatchjob.md): Move a set of Asset resources from one Asset.lifecycleStatus.state to another. The Asset resources to be added to the batch job are specified using the AssetSearch criteria language or by a simple set of ids > If you are selecting by search criteria you must explicitly include criteria describing the state you are moving from in order to account for the fact that the Dash API will only return Assets in the 'LIVE' state by default. See the request examples for more. ## Get the status of updating assets' lifecycle stage - [GET /asset-lifecycle-transition-batch-jobs/{id}](https://api-docs.dash.app/dash/openapi/assets/getassetlifecycletransitionbatchjob.md): Get the status of an AssetLifecycleTransitionBatchJob ## Delete assets - [POST /asset-deletion-batch-jobs](https://api-docs.dash.app/dash/openapi/assets/postassetdeletionbatchjob.md): Delete a set of Asset by the specified assets selector