Content Management API > Scheduled publication
Create a new scheduled publication
Body parameters
publication_scheduled_at date-time Required
The future date for the publication
Example:
"2025-02-10T11:03:42Z"
selective_publication null, object Optional
Specifies which content should be published. If null, the whole record will be published.
content_in_locales Required
List of locales whose content will be published
Type:
Array<string>
non_localized_content boolean Required
Whether the non-localized content has to be published or not
Returns
Returns a resource object of type scheduled_publication
Examples
import { buildClient } from "@datocms/cma-client-node";
async function run() { const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const itemId = "34";
const scheduledPublication = await client.scheduledPublication.create( itemId, { publication_scheduled_at: "2025-02-10T11:03:42Z" }, );
// Check the 'Returned output' tab for the result ☝️ console.log(scheduledPublication);}
run();
{ 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" },}