Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Uploads filter

Update a filter

Body parameters

name string Required

The name of the filter

Example: "Draft posts"
filter object Required

The actual filter

Example: { status: { eq: "draft" } }
shared boolean Optional

Whether it's a shared filter or not

Returns

Returns a resource object of type upload_filter

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const uploadFilterId = "-Lo34LFSTLmgPToamzJLcg";
const uploadFilter = await client.uploadFilters.update(uploadFilterId, {
id: "-Lo34LFSTLmgPToamzJLcg",
name: "Draft posts",
filter: { status: { eq: "draft" } },
});
// Check the 'Returned output' tab for the result ☝️
console.log(uploadFilter);
}
run();
{
id: "-Lo34LFSTLmgPToamzJLcg",
name: "Draft posts",
filter: { status: { eq: "draft" } },
shared: true,
}