How to Check-In and Check-Out an Asset using MediaValet's API?

Documentation Reference: How to Create a New Asset Version

Step 1: Authenticate to the library you wish to connect to, following the steps in: MediaValet API

Step 2: Find the asset you wish to perform the versioning on (check-out/check-in) by using the following endpoint:,Retrieve%20Asset,-https%3A//api.mediavalet

  • Example: GET/

Step 3: Perform a checkout against the asset in question by perform a POST request against the following endpoint:
(Optional): If you wish to leave a comment for the Check-Out as is the case in the portal UI, you can pass the following as a raw JSON payload body:

  • Note: “Test” would be replaced with whatever comment you wish to keep. This step is optional and can be skipped if you wish to leave no comment.

If successful, you will receive a response that looks similar to the below:


Download the version of the asset that was checked out from the SAS URL that is returned in the response if making modifications directly to the asset currently in the DAM. In the example above, this is:

If you wish to check in an entirely new version of the asset without needing to make any modifications to the current version in the DAM that was checked out, skip to Step 4


Step 4: Check-In Asset

  • Part A: Validate Asset Check-In
    • Perform a POST request against the following endpoint:
      :id is the assetId that was checked out.
      In the JSON Body, ensure to encase the name of the updated filename of the asset to be checked in as the new version as shown below:


  • Part B: Get an Upload Url for the Asset being checked-in
    • Perform a GET request against the following endpoint:


    • Copy the value found in the uploadUrl parameter as this will be needed for the next step. In our example above this was:

"uploadUrl": "",

  • Part C: Upload File using Azure blob Storage
    • The upload is accomplished by issuing a PUT or a number of PUT requests against the SAS URL with the binary segments of the file as the body.
      Note: This SAS URL generated from Step 3 will expire after 24 hours and a new one will need to be generated at that point.

    • Maximum file size Azure supports is 200GB. If the file being uloaded is greater than 64MB, it needs to be broken up into segmented uploads. The maximum segment size is 64MB but we recommend using smaller segments for successful uploads.
      • This requirement would need to be fulfilled on the client’s end either via a C# code that would meet the segment limitation of 64MB imposed by Azure. MediaValet recommends using Azure SDK for this requirement. Alternatively, Azure does have a REST API available as shown here: Put Blob (REST API) - Azure Storage
      • If smaller than 64MB, please proceed with the following steps:
        • Perform a PUT request against the uploadUrl received in Part B’s response:
        • You will need to remove the Bearer Token authorization if performing the request from the same tab in Postman as the previous request.
        • Ensure to set the header value x-ms-blob-type with the value BlockBlob
        • d995e4a7-43d4-447b-970b-b222631a5a59.png
        • On the Body tab, select the option binary and then select the asset file from your local machine that should be used as the new version.
        • 3c44fef5-54d5-477b-ae4d-a31dd8cd1094.png
        • Click “Send” once complete. If successful, you will see a status of 201 Created.


Step 5: Finalize Upload/Set Asset Metadata
Once you have uploaded all segments in Part B to the SAS URL in Azure defined, you can finalize the check-in process by following the steps below:

  • Perform a PUT request agains the following endpoint:
    • Please re-add the Bearer Token that was used initially to the Authorization section if using the same tab as the one Step 4, Part C (Upload to Azure) was performed in
    • In the Body tab, use the following JSON payload:
      "id": "{assetId}",
      "uploadUrl": "{uploadUrl provided in Step 4B",
      "uploadFileName": "{uploadFileName provided in Step 4B}",
      "mediaFileId": "{mediaFileId provided in Step 4B}",
      "_links": {
      "self": "assetCheckIn",
      "functions": [
      "status": 0,
      "comment": "{Insert comments for the check-in if any}",
      "fileSizeInBytes": XXXXXX,
      "fileName": "{value of the filename used in Step 3}",
      "whenCancelled": {}

Note: The fileSizeInBytes can be confirmed by accessing the properties for the new asset version uploaded on your local machine as shown below:


An example of the request would look as follows:


If successful, you should see a 202 Accepted response with the updated asset details. Navigate back to the library to confirm the check-in was successful (open the detailed info page and check Versions to make sure that a new version was uploaded).

Was this article helpful?
0 out of 0 found this helpful