User group
Update user group
Rename a user group, or add and remove members. At least one of “name”, “addUserIds” or “removeUserIds” must be provided.
PATCH
/
v1
/
user-groups
/
{userGroupId}
cURL
curl --request PATCH \
--url https://api.claap.io/v1/user-groups/{userGroupId} \
--header 'Content-Type: application/json' \
--header 'X-Claap-Key: <api-key>' \
--data '
{
"name": "<string>",
"addUserIds": [
"<string>"
],
"removeUserIds": [
"<string>"
]
}
'import requests
url = "https://api.claap.io/v1/user-groups/{userGroupId}"
payload = {
"name": "<string>",
"addUserIds": ["<string>"],
"removeUserIds": ["<string>"]
}
headers = {
"X-Claap-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Claap-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', addUserIds: ['<string>'], removeUserIds: ['<string>']})
};
fetch('https://api.claap.io/v1/user-groups/{userGroupId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.claap.io/v1/user-groups/{userGroupId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'addUserIds' => [
'<string>'
],
'removeUserIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Claap-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.claap.io/v1/user-groups/{userGroupId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"addUserIds\": [\n \"<string>\"\n ],\n \"removeUserIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Claap-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.claap.io/v1/user-groups/{userGroupId}")
.header("X-Claap-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"addUserIds\": [\n \"<string>\"\n ],\n \"removeUserIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.claap.io/v1/user-groups/{userGroupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Claap-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"addUserIds\": [\n \"<string>\"\n ],\n \"removeUserIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"result": {
"userGroup": {
"userGroupId": "<string>",
"name": "<string>",
"memberUserIds": [
"<string>"
]
}
}
}Renames a user group, or adds and removes members. A new name must not be used by another user group. Users are identified by the
id returned by the list users endpoint.
- All user identifiers are checked first: if one is not found, nothing is changed.
- Guests cannot be in user groups and are skipped.
- Removing a user who is not in the group does nothing.
Authorizations
Path Parameters
User group identifier
Body
application/json
New user group name. It must not be used by another user group of the workspace.
Required string length:
1 - 100Identifiers of the users to add to the group. Guests cannot be in groups and are skipped.
Maximum array length:
50Identifiers of the users to remove from the group.
Maximum array length:
50Response
User group was successfully updated
Show child attributes
Show child attributes
⌘I
cURL
curl --request PATCH \
--url https://api.claap.io/v1/user-groups/{userGroupId} \
--header 'Content-Type: application/json' \
--header 'X-Claap-Key: <api-key>' \
--data '
{
"name": "<string>",
"addUserIds": [
"<string>"
],
"removeUserIds": [
"<string>"
]
}
'import requests
url = "https://api.claap.io/v1/user-groups/{userGroupId}"
payload = {
"name": "<string>",
"addUserIds": ["<string>"],
"removeUserIds": ["<string>"]
}
headers = {
"X-Claap-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Claap-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', addUserIds: ['<string>'], removeUserIds: ['<string>']})
};
fetch('https://api.claap.io/v1/user-groups/{userGroupId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.claap.io/v1/user-groups/{userGroupId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'addUserIds' => [
'<string>'
],
'removeUserIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Claap-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.claap.io/v1/user-groups/{userGroupId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"addUserIds\": [\n \"<string>\"\n ],\n \"removeUserIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Claap-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.claap.io/v1/user-groups/{userGroupId}")
.header("X-Claap-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"addUserIds\": [\n \"<string>\"\n ],\n \"removeUserIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.claap.io/v1/user-groups/{userGroupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Claap-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"addUserIds\": [\n \"<string>\"\n ],\n \"removeUserIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"result": {
"userGroup": {
"userGroupId": "<string>",
"name": "<string>",
"memberUserIds": [
"<string>"
]
}
}
}