Show examples in:
Javascript HTTP
Endpoint info
Available examples
Content Management API > Site

Retrieve the site

Query parameters

include string

Comma-separated list of relationship paths. A relationship path is a dot-separated list of relationship names. Allowed relationship paths: item_types, item_types.fields, item_types.fieldsets, item_types.singleton_item, account, owner.

Example: "item_types,item_types.fields"
fields object

Sparse fieldsets: for each entity type, the attributes and the relationships to return, separated by commas. Each entity declares its attributes and its relationships in its own schema.

site string

Attributes and relationships to return for each site that this endpoint returns.

Example: "name,domain,google_maps_api_token,owner"
item_type string

Attributes and relationships to return for each item_type that this endpoint returns.

Example: "name,api_key,collection_appearance,singleton_item"
field string

Attributes and relationships to return for each field that this endpoint returns.

Example: "label,field_type,localized,item_type"
fieldset string

Attributes and relationships to return for each fieldset that this endpoint returns.

Example: "title,hint,collapsible,item_type"
item string

Attributes and relationships to return for each item that this endpoint returns.

Example: "title,content,category,item_type"
account string

Attributes and relationships to return for each account that this endpoint returns.

Example: "email,first_name,last_name"
organization string

Attributes and relationships to return for each organization that this endpoint returns.

Example: "name"

Returns

Returns a resource object of type site.

Examples

GET https://site-api.datocms.com/site HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/site' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch("https://site-api.datocms.com/site", {
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": "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,
"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,
"improved_exposure_of_inline_blocks_in_cda": true,
"improved_items_listing": true,
"milliseconds_in_datetime": true,
"non_localized_focal_points": true,
"allow_custom_theme": true
}
}
}