Sorry, no results found for "".

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.draft_mode_default boolean Optional

The default value for the draft mode option in all the environment's models

meta.improved_validation_at_publishing boolean Optional

Whether the Improved validation at publishing 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:

PUT https://site-api.datocms.com/site HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Content-Type: application/vnd.api+json
{
"data": {
"type": "site",
"attributes": {}
}
}
Terminal window
curl -g 'https://site-api.datocms.com/site' \
-X PUT \
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3" \
-H "Content-Type: application/vnd.api+json" \
--data-binary '{"data":{"type":"site","attributes":{}}}'
await fetch("https://site-api.datocms.com/site", {
method: "PUT",
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
"Content-Type": "application/vnd.api+json",
},
body: JSON.stringify({ data: { type: "site", attributes: {} } }),
});
HTTP/1.1 202 Accepted
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": {
"type": "job",
"id": "4235"
}
}

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:

GET https://site-api.datocms.com/job-results/:job_result_id HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/job-results/:job_result_id' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch("https://site-api.datocms.com/job-results/:job_result_id", {
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
});
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": {
"type": "job_result",
"id": "34",
"attributes": {
"status": 200,
"payload": {
"data": {
"type": "site",
"id": "155",
"relationships": {
"item_types": {
"data": [
{
"type": "item_type",
"id": "DxMaW10UQiCmZcuuA-IkkA"
}
]
},
"owner": {
"data": {
"type": "account",
"id": "312"
}
}
},
"attributes": {
"domain": "admin.my-awesome-website.com",
"favicon": "123",
"global_seo": {},
"google_maps_api_token": "xxxxxxxxxxxxx",
"imgix_host": "www.datocms-assets.com",
"internal_domain": "my-website.admin.datocms.com",
"last_data_change_at": "2017-03-30T09:29:14.872Z",
"locales": [
"en"
],
"name": "My Awesome Website",
"no_index": true,
"require_2fa": false,
"theme": {
"type": "monochromatic",
"hue": 16,
"primary_color": {
"red": 128,
"green": 128,
"blue": 128,
"alpha": 128
},
"light_color": {
"red": 128,
"green": 128,
"blue": 128,
"alpha": 128
},
"accent_color": {
"red": 128,
"green": 128,
"blue": 128,
"alpha": 128
},
"dark_color": {
"red": 128,
"green": 128,
"blue": 128,
"alpha": 128
},
"logo": "123"
},
"timezone": "Europe/London",
"ip_tracking_enabled": true,
"force_use_of_sandbox_environments": true,
"assets_cdn_default_settings": {
"image": {},
"video": {}
}
},
"meta": {
"created_at": "2020-04-21T07:57:11.124Z",
"improved_timezone_management": true,
"improved_hex_management": true,
"improved_gql_multilocale_fields": true,
"improved_gql_visibility_control": true,
"improved_boolean_fields": true,
"draft_mode_default": true,
"improved_validation_at_publishing": true
}
}
}
}
}
}