Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Site

Update the site's settings

Body parameters

type string Required

Must be exactly "site".

attributes.no_index boolean Optional

Whether the website needs to be indexed by search engines or not

attributes.favicon string, null Optional

The upload id for the favicon

Example: "123"
attributes.global_seo object, null Optional

Specifies default global settings

site_name string Optional

Site name, used in social sharing

Example: "My Awesome Website"
fallback_seo object Optional
title string Required
Example: "Default meta title"
description string Required
Example: "Default meta description"
image null, string Required

The id of the image

Example: "123"
twitter_card null, enum Optional

Determines how a Twitter link preview is shown

Example: "summary_large_image"
summary Optional

Twitter summary card

summary_large_image Optional

Twitter summary card with large image

title_suffix null, string Optional

Title meta tag suffix

Example: " - My Awesome Website"
facebook_page_url null, string Optional

URL of facebook page

Example: "http://facebook.com/awesomewebsite"
twitter_account null, string Optional

Twitter account associated to website

Example: "@awesomewebsite"
attributes.name string Optional

Site name

Example: "My Awesome Website"
attributes.theme undefined Optional
attributes.locales Optional

Available locales

Type: Array<string>
Example: ["en"]
attributes.timezone string Optional

Site default timezone

Example: "Europe/London"
attributes.require_2fa boolean Optional

Specifies whether all users of this site need to authenticate using two-factor authentication

attributes.ip_tracking_enabled boolean Optional

Specifies whether you want IPs to be tracked in the Project usages section

attributes.force_use_of_sandbox_environments boolean Optional

If enabled, blocks schema changes of primary environment

meta.improved_timezone_management boolean Optional

Whether the Improved API Timezone Management option is active or not

meta.improved_hex_management boolean Optional

Whether the Improved API Hex Management option is active or not

meta.improved_gql_multilocale_fields boolean Optional

Whether the Improved GraphQL multi-locale fields option is active or not

meta.improved_gql_visibility_control boolean Optional

Whether the Improved GraphQL visibility control option is active or not

meta.improved_boolean_fields boolean Optional

Whether the Improved boolean fields option is active or not

meta.custom_upload_storage_settings boolean Optional

Whether the site has custom upload storage settings

relationships.sso_default_role.data Optional

Returns

Returns a Job ID. You can then poll for the completion of the job that will eventually return a resource object of type site

Examples

The response contains the ID of the asynchronous job that started:

1
PUT https://site-api.datocms.com/site 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": "site",
10
"attributes": {}
11
}
12
}
Terminal window
1
curl -g 'https://site-api.datocms.com/site' \
2
-X PUT \
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":"site","attributes":{}}}'
1
await fetch("https://site-api.datocms.com/site", {
2
method: "PUT",
3
headers: {
4
Authorization: "Bearer YOUR-API-TOKEN",
5
Accept: "application/json",
6
"X-Api-Version": "3",
7
"Content-Type": "application/vnd.api+json",
8
},
9
body: JSON.stringify({ data: { type: "site", attributes: {} } }),
10
});
1
HTTP/1.1 202 Accepted
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": "job",
10
"id": "4235"
11
}
12
}

To get the asynchronous job result, poll the job result endpoint. While the task is in progress, the endpoint returns a 404 status code. When the job completes, the status changes to 200 OK:

1
GET https://site-api.datocms.com/job-results/:job_result_id HTTP/1.1
2
Authorization: Bearer YOUR-API-TOKEN
3
Accept: application/json
4
X-Api-Version: 3
Terminal window
1
curl -g 'https://site-api.datocms.com/job-results/:job_result_id' \
2
\
3
-H "Authorization: Bearer YOUR-API-TOKEN" \
4
-H "Accept: application/json" \
5
-H "X-Api-Version: 3"
1
await fetch("https://site-api.datocms.com/job-results/:job_result_id", {
2
headers: {
3
Authorization: "Bearer YOUR-API-TOKEN",
4
Accept: "application/json",
5
"X-Api-Version": "3",
6
},
7
});
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": "job_result",
10
"id": "34",
11
"attributes": {
12
"status": 200,
13
"payload": {
14
"data": {
15
"type": "site",
16
"id": "155",
17
"relationships": {
18
"item_types": {
19
"data": [
20
{
21
"type": "item_type",
22
"id": "DxMaW10UQiCmZcuuA-IkkA"
23
}
24
]
25
},
26
"owner": {
27
"data": {
28
"type": "account",
29
"id": "312"
30
}
31
}
32
},
33
"attributes": {
34
"domain": "admin.my-awesome-website.com",
35
"favicon": "123",
36
"global_seo": {},
37
"google_maps_api_token": "xxxxxxxxxxxxx",
38
"imgix_host": "www.datocms-assets.com",
39
"internal_domain": "my-website.admin.datocms.com",
40
"last_data_change_at": "2017-03-30T09:29:14.872Z",
41
"locales": [
42
"en"
43
],
44
"name": "My Awesome Website",
45
"no_index": true,
46
"require_2fa": false,
47
"theme": {
48
"type": "monochromatic",
49
"hue": 16,
50
"primary_color": {
51
"red": 128,
52
"green": 128,
53
"blue": 128,
54
"alpha": 128
55
},
56
"light_color": {
57
"red": 128,
58
"green": 128,
59
"blue": 128,
60
"alpha": 128
61
},
62
"accent_color": {
63
"red": 128,
64
"green": 128,
65
"blue": 128,
66
"alpha": 128
67
},
68
"dark_color": {
69
"red": 128,
70
"green": 128,
71
"blue": 128,
72
"alpha": 128
73
},
74
"logo": "123"
75
},
76
"timezone": "Europe/London",
77
"ip_tracking_enabled": true,
78
"force_use_of_sandbox_environments": true,
79
"assets_cdn_default_settings": {
80
"image": {},
81
"video": {}
82
}
83
},
84
"meta": {
85
"created_at": "2020-04-21T07:57:11.124Z",
86
"improved_timezone_management": true,
87
"improved_hex_management": true,
88
"improved_gql_multilocale_fields": true,
89
"improved_gql_visibility_control": true,
90
"improved_boolean_fields": true
91
}
92
}
93
}
94
}
95
}
96
}