Home
Content Management API⁡𝅶‍‍𝅺⁡‍𝅴⁡𝅴𝅹‍‍⁢𝅵‍‍⁣⁣‌⁡⁣𝅺⁣⁢⁣𝅸⁠⁢‍‍‍𝅷‍‍𝅳⁡‍⁠‍‍⁢𝅵‍‍𝅳⁡⁣⁡⁣⁡​⁡⁢⁢𝅵‍𝅺‍𝅺⁢𝅸⁡⁢‍𝅹⁣‌⁡⁣𝅺⁢𝅸⁡⁢‍𝅹⁢𝅺𝅸‍𝅺⁠⁣𝅴⁡⁣𝅺⁡‍‍𝅺𝅴⁡⁣⁠𝅸⁠𝅺⁡⁣⁡𝅴⁡​⁠⁡⁢‍𝅺⁢𝅳⁢‌⁢​⁢𝅴⁢‍⁢⁠‍𝅺𝅴⁡⁣⁠𝅸⁡⁢‍𝅺⁢⁢⁢𝅴⁢𝅳⁢⁢⁢‌⁢⁡⁢𝅳⁢‌‍‍⁡𝅸
Main resources
Upload-related
Site Search
Environments
UI
Workflows
Async jobs
Roles & permissions
Webhooks
Hosting & CI integrations
Subscription
Enterprise
    Show examples in:
    Update the site's settings

    Parameters

    no_index  boolean  Optional

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

    favicon  string, null  Optional

    The upload id for the favicon

    global_seo  object, null  Optional

    Specifies default global settings

    name  string  Optional

    Site name

    theme  object  Optional

    Specifies the theme to use in administrative area

    locales  Array<string>  Optional

    Available locales

    timezone  string  Optional

    Site default timezone

    require_2fa  boolean  Optional

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

    ip_tracking_enabled  boolean  Optional

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

    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

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

    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,
    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,
    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: '44'
    }
    ]
    }