Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Site

Update CDN settings default assets

Allows to modify default settings for assets serving optimization from the CDN

Body parameters

assets_cdn_default_settings object Required

Allows setting default parameters for assets served through the CDN

image object Required

Allows setting default parameters for optimizing images served by the CDN

q integer Optional

Controls the output quality of lossy file formats (jpg, pjpg, webp, avif, or jxr). Valid values are in the range 0 – 100 and the default is 75.

Example: 50
auto Optional

The auto parameter helps automating a baseline level of optimization. Specify one or more settings

Type: Array<string>
Example: ["compress", "format"]
cs enum Optional

Specifies the color space of the output image

Example: "srgb"
srgb Optional

Uses the sRGB colorspace which is an internet standard. This is the default

adobergb1998 Optional

Refers to the Adobe RGB (1998) color space, which provides accurate color reproduction from screen to print

tinysrgb Optional

Reduces the color space metadata but may cause a slight shift in color values

strip Optional

Removes the colorspace for maximum size reduction. Note that colors will still be rendered, but a colorspace will not be specified

video object Required

Allows setting default parameters for optimizing videos served by the CDN

disable_serving_raw_videos boolean Optional

When true, attempting to retrieve raw video files directly instead of their optimized counterparts will result in a HTTP 422 status code

Returns

Returns a resource object of type site

Examples

1
import { buildClient } from "@datocms/cma-client-node";
2
3
async function run() {
4
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
5
6
const site = await client.site.updateAssetsCdnDefaultSettings({
7
assets_cdn_default_settings: { image: {}, video: {} },
8
});
9
10
// Check the 'Returned output' tab for the result ☝️
11
console.log(site);
12
}
13
14
run();
1
{
2
id: "155",
3
domain: "admin.my-awesome-website.com",
4
favicon: "123",
5
global_seo: {},
6
google_maps_api_token: "xxxxxxxxxxxxx",
7
imgix_host: "www.datocms-assets.com",
8
internal_domain: "my-website.admin.datocms.com",
9
last_data_change_at: "2017-03-30T09:29:14.872Z",
10
locales: ["en"],
11
name: "My Awesome Website",
12
no_index: true,
13
require_2fa: false,
14
theme: {
15
type: "monochromatic",
16
hue: 16,
17
primary_color: { red: 128, green: 128, blue: 128, alpha: 128 },
18
light_color: { red: 128, green: 128, blue: 128, alpha: 128 },
19
accent_color: { red: 128, green: 128, blue: 128, alpha: 128 },
20
dark_color: { red: 128, green: 128, blue: 128, alpha: 128 },
21
logo: "123",
22
},
23
timezone: "Europe/London",
24
ip_tracking_enabled: true,
25
force_use_of_sandbox_environments: true,
26
assets_cdn_default_settings: { image: {}, video: {} },
27
meta: {
28
created_at: "2020-04-21T07:57:11.124Z",
29
improved_timezone_management: true,
30
improved_hex_management: true,
31
improved_gql_multilocale_fields: true,
32
improved_gql_visibility_control: true,
33
improved_boolean_fields: true,
34
},
35
item_types: [{ type: "item_type", id: "DxMaW10UQiCmZcuuA-IkkA" }],
36
owner: { type: "account", id: "312" },
37
}