Show examples in:
    Create a new scheduled publication

    Parameters

    publication_scheduled_at  Required  date-time  Example: "2025-02-10T11:03:42Z"

    The future date for the publication

    selective_publication  Optional  null, object

    Specifies which content should be published. If null, the whole record will be published.

    Returns

    Returns a scheduled_publication resource object.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const itemId = '34';
    const scheduledPublication = await client.scheduledPublication.create(itemId, {
    publication_scheduled_at: '2025-02-10T11:03:42Z',
    selective_publication: {
    content_in_locales: [
    'en'
    ],
    non_localized_content: true
    }
    });
    console.log(scheduledPublication);
    }
    run();
    Returned output:
    {
    id: '34',
    publication_scheduled_at: '2025-02-10T11:03:42Z',
    selective_publication: {
    content_in_locales: [
    'en'
    ],
    non_localized_content: true
    },
    item: {
    type: 'item',
    id: 'hWl-mnkWRYmMCSTq4z_piQ'
    }
    }