Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Upload

Put assets into a collection in bulk

Body parameters

uploads Required

Assets to assign to the collection

upload_collection Required

Asset collection to put uploads into

Examples

1
import { buildClient } from "@datocms/cma-client-node";
2
3
async function run() {
4
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
5
6
const upload = await client.uploads.bulkSetUploadCollection({
7
uploads: [{ type: "upload", id: "q0VNpiNQSkG6z0lif_O1zg" }],
8
upload_collection: null,
9
});
10
11
// Check the 'Returned output' tab for the result ☝️
12
console.log(upload);
13
}
14
15
run();
1
[]