curl --request PATCH \
--url https://api.galtea.ai/userGroups/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Name",
"description": "A description",
"allProducts": false,
"permissions": [
"product.read",
"analytics.read"
]
}
'import requests
url = "https://api.galtea.ai/userGroups/{id}"
payload = {
"name": "Example Name",
"description": "A description",
"allProducts": False,
"permissions": ["product.read", "analytics.read"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Name',
description: 'A description',
allProducts: false,
permissions: ['product.read', 'analytics.read']
})
};
fetch('https://api.galtea.ai/userGroups/{id}', 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.galtea.ai/userGroups/{id}",
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' => 'Example Name',
'description' => 'A description',
'allProducts' => false,
'permissions' => [
'product.read',
'analytics.read'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.galtea.ai/userGroups/{id}"
payload := strings.NewReader("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissions\": [\n \"product.read\",\n \"analytics.read\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.galtea.ai/userGroups/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissions\": [\n \"product.read\",\n \"analytics.read\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/userGroups/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissions\": [\n \"product.read\",\n \"analytics.read\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "ug_123",
"organizationId": "org_123",
"name": "QA Team",
"type": "EVALUATOR",
"description": "Quality assurance team",
"createdAt": "2023-11-07T05:31:56Z",
"userIds": [
"user_123"
],
"metricIds": [
"metric_123"
],
"productIds": [
"product_123"
],
"allProducts": false,
"permissions": [
"product.read",
"analytics.read"
],
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Update user group
Update an existing user group. Send only the fields you change: an absent field keeps its value, and a null permissions removes the custom list. Only an owner of the organization or an admin may change a group, its permission list included. See User Groups.
curl --request PATCH \
--url https://api.galtea.ai/userGroups/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Name",
"description": "A description",
"allProducts": false,
"permissions": [
"product.read",
"analytics.read"
]
}
'import requests
url = "https://api.galtea.ai/userGroups/{id}"
payload = {
"name": "Example Name",
"description": "A description",
"allProducts": False,
"permissions": ["product.read", "analytics.read"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Name',
description: 'A description',
allProducts: false,
permissions: ['product.read', 'analytics.read']
})
};
fetch('https://api.galtea.ai/userGroups/{id}', 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.galtea.ai/userGroups/{id}",
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' => 'Example Name',
'description' => 'A description',
'allProducts' => false,
'permissions' => [
'product.read',
'analytics.read'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.galtea.ai/userGroups/{id}"
payload := strings.NewReader("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissions\": [\n \"product.read\",\n \"analytics.read\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.galtea.ai/userGroups/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissions\": [\n \"product.read\",\n \"analytics.read\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/userGroups/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissions\": [\n \"product.read\",\n \"analytics.read\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "ug_123",
"organizationId": "org_123",
"name": "QA Team",
"type": "EVALUATOR",
"description": "Quality assurance team",
"createdAt": "2023-11-07T05:31:56Z",
"userIds": [
"user_123"
],
"metricIds": [
"metric_123"
],
"productIds": [
"product_123"
],
"allProducts": false,
"permissions": [
"product.read",
"analytics.read"
],
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
Headers
Body
The product permissions the group grants on its products, each written entity.action, sorted. Null means no custom list: the group grants every permission its members role allows. An empty list grants nothing. A user in several groups may do an action when any group that reaches the product lists it, and the role of the user still limits what a list can grant. Send null to remove the custom list; omit the field to keep it.
["product.read", "analytics.read"]
Response
User group updated successfully. The body is the resource as its GET answers it.
The product permissions the group grants on its products, each written entity.action, sorted. Null means no custom list: the group grants every permission its members role allows. An empty list grants nothing. A user in several groups may do an action when any group that reaches the product lists it, and the role of the user still limits what a list can grant.
["product.read", "analytics.read"]