Show examples in:
Put assets into a collection in bulk

Body Parameters

uploads  Required  Array of { type: "upload", id: upload.id }

Assets to assign to the collection

upload_collection  Required  null, { type: "upload_collection", id: upload_collection.id }

Asset collection to put uploads into

Examples

Example Basic example
import { buildClient } from '@datocms/cma-client-node';
async function run() {
const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
const result = await client.uploads.bulkSetUploadCollection({
uploads: [
{
type: 'upload',
id: 'q0VNpiNQSkG6z0lif_O1zg'
}
],
upload_collection: null
});
console.log(result);
}
run();