Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Scheduled publication

Create a new scheduled publication

Body parameters

type string Required

Must be exactly "scheduled_publication".

attributes.publication_scheduled_at date-time Required

The future date for the publication

Example: "2025-02-10T11:03:42Z"
attributes.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

1
POST https://site-api.datocms.com/items/:item_id/scheduled-publication HTTP/1.1
2
Authorization: Bearer YOUR-API-TOKEN
3
Accept: application/json
4
X-Api-Version: 3
5
Content-Type: application/vnd.api+json
6
7
{
8
"data": {
9
"type": "scheduled_publication",
10
"attributes": {
11
"publication_scheduled_at": "2025-02-10T11:03:42Z"
12
}
13
}
14
}
Terminal window
1
curl -g 'https://site-api.datocms.com/items/:item_id/scheduled-publication' \
2
-X POST \
3
-H "Authorization: Bearer YOUR-API-TOKEN" \
4
-H "Accept: application/json" \
5
-H "X-Api-Version: 3" \
6
-H "Content-Type: application/vnd.api+json" \
7
--data-binary '{"data":{"type":"scheduled_publication","attributes":{"publication_scheduled_at":"2025-02-10T11:03:42Z"}}}'
1
await fetch(
2
"https://site-api.datocms.com/items/:item_id/scheduled-publication",
3
{
4
method: "POST",
5
headers: {
6
Authorization: "Bearer YOUR-API-TOKEN",
7
Accept: "application/json",
8
"X-Api-Version": "3",
9
"Content-Type": "application/vnd.api+json",
10
},
11
body: JSON.stringify({
12
data: {
13
type: "scheduled_publication",
14
attributes: { publication_scheduled_at: "2025-02-10T11:03:42Z" },
15
},
16
}),
17
},
18
);
1
HTTP/1.1 200 OK
2
Content-Type: application/json
3
Cache-Control: cache-control: max-age=0, private, must-revalidate
4
X-RateLimit-Limit: 30
5
X-RateLimit-Remaining: 28
6
7
{
8
"data": {
9
"type": "scheduled_publication",
10
"id": "34",
11
"attributes": {
12
"publication_scheduled_at": "2025-02-10T11:03:42Z",
13
"selective_publication": {
14
"content_in_locales": [
15
"en"
16
],
17
"non_localized_content": true
18
}
19
},
20
"relationships": {
21
"item": {
22
"data": {
23
"type": "item",
24
"id": "hWl-mnkWRYmMCSTq4z_piQ"
25
}
26
}
27
}
28
},
29
"included": [
30
{
31
"type": "item",
32
"id": "hWl-mnkWRYmMCSTq4z_piQ",
33
"relationships": {
34
"item_type": {
35
"data": {
36
"type": "item_type",
37
"id": "DxMaW10UQiCmZcuuA-IkkA"
38
}
39
}
40
},
41
"attributes": {
42
"title": "My first blog post!",
43
"content": "Lorem ipsum dolor sit amet...",
44
"category": "24",
45
"image": {
46
"alt": "Alt text",
47
"title": "Image title",
48
"custom_data": {},
49
"focal_point": null,
50
"upload_id": "20042921"
51
}
52
},
53
"meta": {
54
"created_at": "2020-04-21T07:57:11.124Z",
55
"updated_at": "2020-04-21T07:57:11.124Z",
56
"published_at": "2020-04-21T07:57:11.124Z",
57
"first_published_at": "2020-04-21T07:57:11.124Z",
58
"publication_scheduled_at": "2020-04-21T07:57:11.124Z",
59
"unpublishing_scheduled_at": "2020-04-21T07:57:11.124Z",
60
"status": "published",
61
"is_current_version_valid": true,
62
"is_published_version_valid": true,
63
"current_version": "4234",
64
"stage": null
65
}
66
}
67
]
68
}