Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Model/Block

Retrieve a model

Returns

Returns a resource object of type item_type.

Examples

1
GET https://site-api.datocms.com/item-types/:model_id_or_api_key HTTP/1.1
2
Authorization: Bearer YOUR-API-TOKEN
3
Accept: application/json
4
X-Api-Version: 3
Terminal window
1
curl -g 'https://site-api.datocms.com/item-types/:model_id_or_api_key' \
2
\
3
-H "Authorization: Bearer YOUR-API-TOKEN" \
4
-H "Accept: application/json" \
5
-H "X-Api-Version: 3"
1
await fetch("https://site-api.datocms.com/item-types/:model_id_or_api_key", {
2
headers: {
3
Authorization: "Bearer YOUR-API-TOKEN",
4
Accept: "application/json",
5
"X-Api-Version": "3",
6
},
7
});
1
HTTP/1.1 200 OK
2
Content-Type: application/json
3
Cache-Control: cache-control: max-age=0, private, must-revalidate
4
X-RateLimit-Limit: 30
5
X-RateLimit-Remaining: 28
6
7
{
8
"data": {
9
"type": "item_type",
10
"id": "DxMaW10UQiCmZcuuA-IkkA",
11
"relationships": {
12
"singleton_item": {
13
"data": null
14
},
15
"fields": {
16
"data": [
17
{
18
"type": "field",
19
"id": "Pkg-oztERp6o-Rj76nYKJg"
20
}
21
]
22
},
23
"fieldsets": {
24
"data": [
25
{
26
"type": "fieldset",
27
"id": "93Y1C2sySkG4Eg0atBRIwg"
28
}
29
]
30
},
31
"title_field": {
32
"data": null
33
},
34
"image_preview_field": {
35
"data": null
36
},
37
"excerpt_field": {
38
"data": null
39
},
40
"ordering_field": {
41
"data": null
42
},
43
"workflow": {
44
"data": null
45
}
46
},
47
"attributes": {
48
"name": "Blog post",
49
"api_key": "post",
50
"singleton": false,
51
"sortable": true,
52
"modular_block": false,
53
"tree": false,
54
"ordering_direction": null,
55
"ordering_meta": "created_at",
56
"draft_mode_active": false,
57
"all_locales_required": false,
58
"collection_appearance": "compact",
59
"hint": "Blog posts will be shown in our website under the Blog section",
60
"inverse_relationships_enabled": false
61
},
62
"meta": {
63
"has_singleton_item": false
64
}
65
}
66
}