Beta - Bulk move items to another library.

This is a Beta API it is subject to change. Use the /changes/set-library endpoint to move multiple items to library. Currently, only assets and content are supported. Admin can move items between libraries without restrictions. Manager and Editor must be a contributor in both the source and destination libraries.

Requests

Specify the items that you want to move in the request body. Specify destination library id as well

  {
    "ids": [
      {
        "id": "579c2232-7398-4c8b-921d-3932bfc45d19",
        "classification": "content"
      },
      {
        "id": "448e8d63-ed15-4d59-85e5-53908a84ca93",
        "classification": "asset"
      }
    ],
    "libraryId": ""
  }

Alternatively you can also make requests with the content hub unique ID. The unique ID is the items classification and the ID combined to create an ID that is unique across all content hub items.

  {
    "ids": [
      { "id": "content:579c2232-7398-4c8b-921d-3932bfc45d19" },
      { "id": "asset:448e8d63-ed15-4d59-85e5-53908a84ca93" }
    ],
    "libraryId": ""
  }

Responses

When the request succeeds for all items, then the status field will have the value success. If all items fail, the status field will have the value failure.

There are a number of arrays which are returned when items fail to delete. These help categorize the errors which you may want to action in different ways. In the case where all items succeed, only the successful array will be returned.

  • successful - Items that were successfully moved.
  • userError - Items that cannot be moved because they require must be either removed from the request or require some further user action before they can succeed. Following error can occur:
    • Insufficient Permissions - User must have access to remove items from old library/ies and re-create them in destination library. Exception is Admin user who can move items without restrictions.
  • skipped - Items which would have been moved but were not due to other failures. Once the other failures are resolved these items should be successfully moved.
  • genericErrors - Items that the system failed to move.
  • missing - Field is present in the error response but it is never used.

The messages object contains information on the specific failure for each individual failing item.

Examples

Success

Where a request to move a content and an asset are successful.

Request

  {
    "ids": [
      { "id": "content:a" },
      { "id": "asset:b" }
    ],
    "libraryId": "lib-id"
  }

Response

  {
    "status": "success"
    "successful": ["content:a", "content:b"]
  }

Failure

In the example that is shown, the goal was to move items with IDs a and b. Items cannot be moved user has insufficient permissions. Both content itema a and b are marked as userError.

Request

  {
    "ids": [
      { "id": "content:a" },
      { "id": "content:b" }
    ],
    "libraryId": "lib-id"
  }

Response

  {
    "status": "failure",
    "successful": [],
    "skipped": [],
    "genericErrors": [],
    "userErrors": [
      "asset:1234",
      "content:5678"
    ],
    "missing": [],
    "messages": {
      "asset:1234": {
        "uid": "asset:1234",
        "id": "1234",
        "classification": "asset",
        "key": "insufficient.permissions.20010",
        "code": 20010,
        "parameters": {
          "items": []
        }
      },
      "content:5678": {
        "uid": "content:5678",
        "id": "5678",
        "classification": "content",
        "key": "insufficient.permissions.20010",
        "code": 20010,
        "parameters": {
          "items": []
        }
      }
    }
  }


User roles: admin, manager, editor

Language
Click Try It! to start a request and see the response here!