Content Management API > Upload
Put assets into a collection in bulk
Body parameters
uploadsRequired
Assets to assign to the collection
Type:Array<<a href="/docs/content-management-api/resources/upload">ResourceLinkage<"upload"></a>>
upload_collectionRequired
Asset collection to put uploads into
Type:null, <a href="/docs/content-management-api/resources/upload_collection">ResourceLinkage<"upload_collection"></a>
Examples
import { buildClient } from "@datocms/cma-client-node";
async function run() { const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const upload = await client.uploads.bulkSetUploadCollection({ uploads: [{ type: "upload", id: "q0VNpiNQSkG6z0lif_O1zg" }], upload_collection: null, });
// Check the 'Returned output' tab for the result ☝️ console.log(upload);}
run();[]