Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > SSO Group

Update a SSO group

Body parameters

type string Required

Must be exactly "sso_group".

attributes.priority integer Required

When an user belongs to multiple groups, the role associated to the group with the highest priority will be used

Example: 1
relationships.role.data Required

Sso Group's role

Returns

Returns a resource object of type sso_group.

Examples

1
PUT https://site-api.datocms.com/sso-groups/:sso_group_id HTTP/1.1
2
Authorization: Bearer YOUR-API-TOKEN
3
Accept: application/json
4
X-Api-Version: 3
5
Content-Type: application/vnd.api+json
6
7
{
8
"data": {
9
"type": "sso_group",
10
"id": "312",
11
"attributes": {
12
"priority": 1
13
},
14
"relationships": {
15
"role": {
16
"data": {
17
"type": "role",
18
"id": "34"
19
}
20
}
21
}
22
}
23
}
Terminal window
1
curl -g 'https://site-api.datocms.com/sso-groups/:sso_group_id' \
2
-X PUT \
3
-H "Authorization: Bearer YOUR-API-TOKEN" \
4
-H "Accept: application/json" \
5
-H "X-Api-Version: 3" \
6
-H "Content-Type: application/vnd.api+json" \
7
--data-binary '{"data":{"type":"sso_group","id":"312","attributes":{"priority":1},"relationships":{"role":{"data":{"type":"role","id":"34"}}}}}'
1
await fetch("https://site-api.datocms.com/sso-groups/:sso_group_id", {
2
method: "PUT",
3
headers: {
4
Authorization: "Bearer YOUR-API-TOKEN",
5
Accept: "application/json",
6
"X-Api-Version": "3",
7
"Content-Type": "application/vnd.api+json",
8
},
9
body: JSON.stringify({
10
data: {
11
type: "sso_group",
12
id: "312",
13
attributes: { priority: 1 },
14
relationships: { role: { data: { type: "role", id: "34" } } },
15
},
16
}),
17
});
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": "sso_group",
10
"id": "312",
11
"attributes": {
12
"name": "Admin",
13
"priority": 1
14
},
15
"relationships": {
16
"role": {
17
"data": {
18
"type": "role",
19
"id": "34"
20
}
21
},
22
"users": {
23
"data": [
24
{
25
"type": "sso_user",
26
"id": "312"
27
}
28
]
29
}
30
}
31
}
32
}