Show examples in:
    Update the site's settings

    Parameters

    no_index  Optional  boolean  Example: true

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

    favicon  Optional  string, null  Example: "123"

    The upload id for the favicon

    global_seo  Optional  object, null

    Specifies default global settings

    name  Optional  string  Example: "My Awesome Website"

    Site name

    theme  Optional  object

    Specifies the theme to use in administrative area

    locales  Optional  Array<string>  Example: ["en"]

    Available locales

    timezone  Optional  string  Example: "Europe/London"

    Site default timezone

    require_2fa  Optional  boolean

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

    ip_tracking_enabled  Optional  boolean  Example: true

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

    force_use_of_sandbox_environments  Optional  boolean  Example: true

    If enabled, blocks schema changes of primary environment

    meta.improved_timezone_management  Optional  boolean  Example: true

    Whether the Improved API Timezone Management option is active or not

    meta.improved_hex_management  Optional  boolean  Example: true

    Whether the Improved API Hex Management option is active or not

    meta.improved_gql_multilocale_fields  Optional  boolean  Example: true

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

    sso_default_role  Optional  { type: "role", id: role.id }

    Returns

    Returns a site resource object.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const site = await client.site.update({
    no_index: true,
    favicon: '123',
    global_seo: {
    site_name: 'My Awesome Website',
    fallback_seo: {
    title: 'Default meta title',
    description: 'Default meta description',
    image: '123',
    twitter_card: 'summary_large_image'
    },
    title_suffix: ' - My Awesome Website',
    facebook_page_url: 'http://facebook.com/awesomewebsite',
    twitter_account: '@awesomewebsite'
    },
    name: 'My Awesome Website',
    theme: {
    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'
    },
    locales: [
    'en'
    ],
    timezone: 'Europe/London',
    require_2fa: false,
    ip_tracking_enabled: true,
    force_use_of_sandbox_environments: true,
    meta: {
    improved_timezone_management: true,
    improved_hex_management: true,
    improved_gql_multilocale_fields: true
    },
    sso_default_role: {
    type: 'role',
    id: '34'
    }
    });
    console.log(site);
    }
    run();
    Returned output:
    {
    id: '155',
    name: 'My Awesome Website',
    domain: 'admin.my-awesome-website.com',
    google_maps_api_token: 'xxxxxxxxxxxxx',
    imgix_host: 'www.datocms-assets.com',
    internal_domain: 'my-website.admin.datocms.com',
    locales: [
    'en'
    ],
    timezone: 'Europe/London',
    no_index: true,
    favicon: '123',
    last_data_change_at: '2017-03-30T09:29:14.872Z',
    require_2fa: false,
    ip_tracking_enabled: true,
    force_use_of_sandbox_environments: true,
    theme: {
    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'
    },
    global_seo: {
    site_name: 'My Awesome Website',
    fallback_seo: {
    title: 'Default meta title',
    description: 'Default meta description',
    image: '123',
    twitter_card: 'summary_large_image'
    },
    title_suffix: ' - My Awesome Website',
    facebook_page_url: 'http://facebook.com/awesomewebsite',
    twitter_account: '@awesomewebsite'
    },
    meta: {
    improved_timezone_management: true,
    improved_hex_management: true,
    improved_gql_multilocale_fields: true
    },
    owner: {
    type: 'account',
    id: '312'
    },
    item_types: [
    {
    type: 'item_type',
    id: 'DxMaW10UQiCmZcuuA-IkkA'
    }
    ]
    }