Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Model/Block

List all models

Returns

Returns an array of resource objects of type item_type.

Examples

1
GET https://site-api.datocms.com/item-types 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' \
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", {
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
{
10
"type": "item_type",
11
"id": "DxMaW10UQiCmZcuuA-IkkA",
12
"relationships": {
13
"singleton_item": {
14
"data": null
15
},
16
"fields": {
17
"data": [
18
{
19
"type": "field",
20
"id": "Pkg-oztERp6o-Rj76nYKJg"
21
}
22
]
23
},
24
"fieldsets": {
25
"data": [
26
{
27
"type": "fieldset",
28
"id": "93Y1C2sySkG4Eg0atBRIwg"
29
}
30
]
31
},
32
"title_field": {
33
"data": null
34
},
35
"image_preview_field": {
36
"data": null
37
},
38
"excerpt_field": {
39
"data": null
40
},
41
"ordering_field": {
42
"data": null
43
},
44
"workflow": {
45
"data": null
46
}
47
},
48
"attributes": {
49
"name": "Blog post",
50
"api_key": "post",
51
"singleton": false,
52
"sortable": true,
53
"modular_block": false,
54
"tree": false,
55
"ordering_direction": null,
56
"ordering_meta": "created_at",
57
"draft_mode_active": false,
58
"all_locales_required": false,
59
"collection_appearance": "compact",
60
"hint": "Blog posts will be shown in our website under the Blog section",
61
"inverse_relationships_enabled": false
62
},
63
"meta": {
64
"has_singleton_item": false
65
}
66
}
67
]
68
}