Show examples in:
    Create a new filter

    Body Parameters

    id  string  Optional
    RFC 4122 UUID of upload filter expressed in URL-safe base64 format
    name  Required  string  Example: "Draft posts"

    The name of the filter

    filter  Required  object  Example: {"status":{"eq":"draft"}}

    The actual filter

    shared  Required  boolean  Example: true

    Whether it's a shared filter or not

    Returns

    Returns a upload_filter resource object.

    Examples

    Example Basic example
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const uploadFilter = await client.uploadFilters.create({
    name: 'Draft posts',
    filter: {
    status: {
    eq: 'draft'
    }
    },
    shared: true
    });
    console.log(uploadFilter);
    }
    run();