Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Field

List all fields

Returns

Returns an array of resource objects of type field.

Examples

1
GET https://site-api.datocms.com/item-types/:model_id_or_api_key/fields 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/fields' \
2
\
3
-H "Authorization: Bearer YOUR-API-TOKEN" \
4
-H "Accept: application/json" \
5
-H "X-Api-Version: 3"
1
await fetch(
2
"https://site-api.datocms.com/item-types/:model_id_or_api_key/fields",
3
{
4
headers: {
5
Authorization: "Bearer YOUR-API-TOKEN",
6
Accept: "application/json",
7
"X-Api-Version": "3",
8
},
9
},
10
);
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": "field",
11
"id": "Pkg-oztERp6o-Rj76nYKJg",
12
"attributes": {
13
"label": "Title",
14
"field_type": "string",
15
"api_key": "title",
16
"localized": true,
17
"validators": {
18
"required": {}
19
},
20
"position": 1,
21
"hint": "This field will be used as post title",
22
"default_value": {
23
"en": "A default value",
24
"it": "Un valore di default"
25
},
26
"appearance": {
27
"editor": "single_line",
28
"parameters": {
29
"heading": false
30
},
31
"addons": [
32
{
33
"id": "1234",
34
"field_extension": "lorem_ipsum",
35
"parameters": {}
36
}
37
]
38
},
39
"deep_filtering_enabled": true
40
},
41
"relationships": {
42
"item_type": {
43
"data": {
44
"type": "item_type",
45
"id": "DxMaW10UQiCmZcuuA-IkkA"
46
}
47
},
48
"fieldset": {
49
"data": null
50
}
51
}
52
}
53
]
54
}