Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Role

List all roles

Returns

Returns an array of resource objects of type role.

Examples

1
GET https://site-api.datocms.com/roles 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/roles' \
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/roles", {
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": "role",
11
"id": "34",
12
"attributes": {
13
"name": "Editor",
14
"can_edit_site": true,
15
"can_edit_favicon": true,
16
"can_edit_schema": true,
17
"can_manage_menu": true,
18
"can_manage_users": true,
19
"can_manage_shared_filters": true,
20
"can_manage_upload_collections": true,
21
"can_manage_environments": true,
22
"can_manage_webhooks": true,
23
"environments_access": "primary_only",
24
"can_manage_sso": true,
25
"can_access_audit_log": true,
26
"can_manage_workflows": true,
27
"can_edit_environment": true,
28
"can_promote_environments": true,
29
"can_manage_build_triggers": true,
30
"can_manage_access_tokens": true,
31
"can_perform_site_search": true,
32
"can_access_build_events_log": true,
33
"positive_item_type_permissions": [
34
{
35
"environment": "main",
36
"action": "all"
37
}
38
],
39
"negative_item_type_permissions": [
40
{
41
"environment": "main",
42
"action": "all"
43
}
44
],
45
"positive_upload_permissions": [
46
{
47
"action": "all",
48
"environment": "main"
49
}
50
],
51
"negative_upload_permissions": [
52
{
53
"action": "all",
54
"environment": "main"
55
}
56
],
57
"positive_build_trigger_permissions": [
58
{}
59
],
60
"negative_build_trigger_permissions": [
61
{}
62
]
63
},
64
"relationships": {
65
"inherits_permissions_from": {
66
"data": [
67
{
68
"type": "role",
69
"id": "34"
70
}
71
]
72
}
73
},
74
"meta": {
75
"final_permissions": {
76
"can_edit_site": true,
77
"can_edit_favicon": true,
78
"can_edit_schema": true,
79
"can_manage_menu": true,
80
"can_manage_users": true,
81
"can_manage_environments": true,
82
"can_manage_webhooks": true,
83
"environments_access": "primary_only",
84
"can_manage_sso": true,
85
"can_access_audit_log": true,
86
"can_manage_workflows": true,
87
"can_edit_environment": true,
88
"can_promote_environments": true,
89
"can_manage_shared_filters": true,
90
"can_manage_build_triggers": true,
91
"can_manage_upload_collections": true,
92
"can_manage_access_tokens": true,
93
"can_perform_site_search": true,
94
"can_access_build_events_log": true,
95
"positive_item_type_permissions": [
96
{
97
"environment": "main",
98
"action": "all"
99
}
100
],
101
"negative_item_type_permissions": [
102
{
103
"environment": "main",
104
"action": "all"
105
}
106
],
107
"positive_upload_permissions": [
108
{
109
"action": "all",
110
"environment": "main"
111
}
112
],
113
"negative_upload_permissions": [
114
{
115
"action": "all",
116
"environment": "main"
117
}
118
],
119
"positive_build_trigger_permissions": [
120
{}
121
],
122
"negative_build_trigger_permissions": [
123
{}
124
]
125
}
126
}
127
}
128
]
129
}