move

Move an asset into a different folder.

move

Move an asset into a different folder.

Move asset_id into destination_folder_id.

Safety class: A · API type: admin · Min version:

📘

Confinement

Both asset_id and destination_folder_id must be within your run-root anchor.

Signatures

def move(sdk, asset_id, destination_folder_id):
    """Move asset_id into destination_folder_id. Returns the move response dict."""
    return sdk.move_asset(asset_id, destination_folder_id, None, None, None)
export async function move(sdk, assetId, destinationFolderId) {
    // The three nulls are name, batchAction, contentDefinitionId.
    return await sdk.moveAsset(assetId, destinationFolderId, null, null, null);
}

Parameters

Parameter (Python)Parameter (JS)TypeRequiredNotes
sdksdkNomad_SDKyes
asset_idassetIdstryese.g. <asset-uuid>
destination_folder_iddestinationFolderIdstryese.g. <folder-uuid>

Returns

dict | None — {items:[{assetStatus: 'Moving'}], totalItemCount}. ASYNC - poll get(asset_id).parentId until it flips.

Errors

  • 401 unauthenticated
  • 404 asset or destination not found

Notes

The three Nones are name, batch_action, content_definition_id — required positional
args with no defaults. The move is asynchronous: the response items[*] come back with
assetStatus.description == "Moving", so confirm by polling the asset back until
parentId equals the destination. On the wire this is
{"targetIds": [asset_id], "actionArguments": {"destinationFolderAssetId": dest}}; passing a
non-None name adds actionArguments.name and renames the asset as it moves.

The move is asynchronous: the response items[*] come back with
assetStatus.description === "Moving". Confirm by polling getAsset(assetId) until
parentId equals the destination. On the wire this is
{ targetIds: [assetId], actionArguments: { destinationFolderAssetId: destinationFolderId } };
a non-null NAME adds actionArguments.name, renaming the asset as it moves.

See also: Python ↔ JS naming map · Return shapes.